Svn + Ant to Git and Gradle - MultiProject guidance / advice?


(Mark Neale) #1

Apologies in advance as I realise this is quite a specific scenario but :

We currently have a build system that makes use of subversion and ant to checkout and build a particular version of code in a source repository and upload the resultant jars to a binary code repository (basically an artifact store). We have around 30 Java projects , most of which are reliant on one or more other projects (at least one project called Common)

what we do is something like :

ant -Dsubversion.revision=1234 -Dupdate.binary.repo=true

which checks out code at that revision number, runs the build against that version then commits the resultant jars to the binary repo.

I’m playing around with testing some new tools and looking to re-create similar functionality using a combination of Gradle,Git and Artifactory.

I’ve come across differing advice on the best way of laying this out from :

  • One git repository for all the source code. (closer to what we have with svn , and therefore easier to label/tag)
  • Separate git repositories for each project (easier to manage, but how to handle applying a label/tag across them all for a ‘unique’ version)
  • Setting up multi project gradle dependencies and hence building all dependant jars when building a particular project
  • Building and storing each jar in artifactory and referencing it from there (which seems a bit laborious when we have a Common project that we just want to use the latest version of)

How would I get Gradle to checkout and build a specific version or versions from the source repository, or would i be better having a script to checkout a specific version and then run gradle on the results.

Again , apologies for the multitude of open ended questions, but just wondered if anyone had gone through a similar investigation.

Many thanks,

Mark


(Lucas Persson) #2

Hi

There is a git Gradle plugin called Grgit.

But I think you are better off using Jenkins or Gitlab CI (if you plan to move to git).
I.e. use a Continues Integration (CI) server to checkout from git/svn when someone commits.
All those CI have settings for svn and git.

And then I think you are better of with using only one code repository.
/Lucas


(Mark Neale) #3

Thank you.

I’ll have a look through the links.