Migrate from ant to gradle #489

Open
opened 2025-04-21 15:11:35 -04:00 by idk · 4 comments
Owner

ant requires system dependent libraries to be installed and doesn't handle dependencies. That leads to a system-dependent building process which gradle does away with.

Since most of the project build is done in ant, this should be quite the undertaking and might require milestones. I'll try and define a roadmap of how best to do this. Input is very welcome of course as I'm only getting back into Java and missed the introduction of Gradle completely.

These are all the ant targets (ant -p) and their migration status

Default target: all

  • -areRouterInfosEnabled
  • -pre-release
  • -pre-sign
  • -releaseit
  • -setepoch
  • -sign-update
  • all
  • bbLauncher
  • bench
  • bionic
  • build
  • build2
  • buildAddressbook
  • buildAddressbookJar
  • buildBOB
  • buildCore
  • buildCoreTest
  • buildDesktopGui
  • buildI2PControl
  • buildI2PSnark
  • buildI2PTunnel
  • buildI2PTunnelJars
  • buildImagegen
  • buildJetty
  • buildJrobin
  • buildMinistreaming
  • buildNewsXMLJar
  • buildProperties
  • buildRouter
  • buildRouterConsole
  • buildRouterTest
  • buildSAM
  • buildSmall
  • buildSmallOnly
  • buildStreaming
  • buildSusiDNS
  • buildSusiMail
  • buildSusiMailJar
  • buildSystray
  • buildTest
  • buildTools
  • buildUtilityJar
  • buildWEB
  • buildclean
  • builddep
  • builddepSmall
  • buildexe
  • buildrouter
  • bump
  • bumpBuild
  • buster
  • checkForGit
  • checkForIzpack2App
  • checkForMtn
  • checkForVCS
  • checkIfBumped
  • checkIfBumpedGit
  • checkIfBumpedMtn
  • checkoutFromGit
  • checkoutFromMtn
  • checkoutFromVCS
  • clean
  • clover.report
  • cobertura.report
  • consoleDocs
  • copy-bionic
  • copy-disco
  • copy-precise
  • copy-trusty
  • copy-xenial
  • copyJavadoc
  • copyflags
  • copyflags-unlesspkg
  • copyjetty
  • copyjetty-unlesspkg
  • copyjstl-unlesspkg
  • copystandard-unlesspkg
  • copystandard-unlesspkg1
  • copystandard-unlesspkg2
  • copytomcat-unlesspkg
  • debchange
  • debcheckpatch
  • debian
  • debian-binary
  • debian-clean
  • debian-patch
  • debian-release-tarball
  • debian-tarball
  • debian-unpatch
  • debianhowto
  • debianrepo
  • delete-j6-update
  • delete-nonwindows
  • deletepkg-temp
  • disableManifestClasspath
  • disco
  • dist
  • dist200
  • distclean
  • ensureIzpack5
  • failIfNoMtn
  • failIfNoVCS
  • findbugs
  • forceJava7
  • fulltest
  • getBuildNumber
  • getExtendedVersion
  • getGitRev
  • getMtnRev
  • getReleaseNumber
  • git-bundle
  • help
  • i2pseeds
  • i2psnark
  • installer
  • installer-all
  • installer-freebsd
  • installer-linux
  • installer-nowindows
  • installer-osx
  • installer-windows
  • installer2app
  • installer5
  • installer5-linux
  • installer5-nowindows
  • installer5-windows
  • installer5exe
  • installerexe
  • izpack-patches
  • izpack5-patches
  • jar
  • jarBote
  • jarSmall
  • javadoc
  • javadoc-test
  • javadoc-zip
  • jbigi
  • jbigi-freebsd-only
  • jbigi-linux-nonx86-only
  • jbigi-linux-only
  • jbigi-linux-x86-64-only
  • jbigi-linux-x86-only
  • jbigi-list-changes
  • jbigi-nowindows
  • jbigi-osx-only
  • jbigi-windows-only
  • jenkins.cobertura.report
  • jessie
  • junit.report
  • junit.test
  • justBOB
  • launch4j
  • mavenCentral
  • mavenCentral.deps
  • mavenLocal
  • mavenLocal.deps
  • osxLauncher
  • pack200
  • pkg
  • pkg-portable-clean
  • pkg-portable-win32
  • pkg200
  • pkgclean
  • poupdate
  • poupdate-source
  • precise
  • precise-release-tarball
  • prep-script-translation
  • prepCertificates
  • prepConsoleDocs
  • prepRouterInfos
  • prepTest
  • prepgeoupdate
  • prepgeoupdate-unlesspkg
  • prepjbigiupdate
  • prepjupdate
  • prepjupdatefixes
  • preplicenses
  • preplicenses-unlesspkg
  • preplicenses-windows
  • preppkg
  • preppkg-base
  • preppkg-freebsd
  • preppkg-freebsd-only
  • preppkg-linux
  • preppkg-linux-nonx86
  • preppkg-linux-only
  • preppkg-linux-x86
  • preppkg-nowindows
  • preppkg-osx
  • preppkg-osx-only
  • preppkg-portable-basic
  • preppkg-portable-linux-jbigi
  • preppkg-portable-win32
  • preppkg-portable-win32-jbigi
  • preppkg-unix
  • preppkg-windows
  • preppkg-windows-only
  • preppkgRepack
  • prepupdate
  • prepupdateRouter
  • prepupdateSmall
  • release
  • release200
  • releaseRepack
  • releaseWithGeoIP
  • releaseWithGeoIP200
  • releaseWithGeoIPRepack
  • releaseWithJbigi
  • releaseWithJbigi200
  • releaseWithJbigiRepack
  • repack200
  • revisions
  • revisionsGit
  • revisionsMtn
  • scalatest.report
  • scalatest.test
  • set-lg2-en
  • setBuildTimestamp
  • settomcatprop
  • signed-updater200
  • signed-updater200WithJavadoc
  • signed-updater200WithJavadocAndJetty
  • signed-updater200WithJetty
  • signed-updater200WithJettyAndGeoIP
  • slackpkg
  • sloccount.report
  • tarball
  • test
  • test.report
  • testCore
  • testMinistreaming
  • testRouter
  • testStreaming
  • testscripts
  • testscripts-all
  • testscripts-net
  • trimRev
  • truncatehistory
  • trusty
  • updateTest
  • updater
  • updater-torrent
  • updater200
  • updater200WithJavadoc
  • updater200WithJavadocAndJetty
  • updater200WithJbigi
  • updater200WithJetty
  • updater200WithJettyAndGeoIP
  • updater200WithJettyAndJbigi
  • updater200WithJettyFixes
  • updater200WithJettyFixesAndJbigi
  • updaterRepack
  • updaterRouter
  • updaterSmall
  • updaterWithGeoIP
  • updaterWithJavadoc
  • updaterWithJavadocAndJetty
  • updaterWithJbigi
  • updaterWithJetty
  • updaterWithJettyAndGeoIP
  • updaterWithJettyAndGeoIPRepack
  • updaterWithJettyAndJbigi
  • updaterWithJettyAndJbigiRepack
  • updaterWithJettyFixes
  • updaterWithJettyFixesAndGeoIP
  • updaterWithJettyFixesAndJbigi
  • updaterWithJettyRepack
  • util-list-changes
  • verifyReleaseBuildNumbers
  • webappDistclean
  • wheezy
  • xenial
  • xenial-release-tarball
  • zipit
  • zipit200
`ant` requires system dependent libraries to be installed and doesn't handle dependencies. That leads to a system-dependent building process which `gradle` does away with. Since most of the project build is done in ant, this should be quite the undertaking and might require milestones. I'll try and define a roadmap of how best to do this. Input is very welcome of course as I'm only getting back into Java and missed the introduction of Gradle completely. These are all the ant targets (`ant -p`) and their migration status Default target: all - [ ] -areRouterInfosEnabled - [ ] -pre-release - [ ] -pre-sign - [ ] -releaseit - [ ] -setepoch - [ ] -sign-update - [ ] all - [ ] bbLauncher - [ ] bench - [ ] bionic - [ ] build - [ ] build2 - [ ] buildAddressbook - [ ] buildAddressbookJar - [ ] buildBOB - [ ] buildCore - [ ] buildCoreTest - [ ] buildDesktopGui - [ ] buildI2PControl - [ ] buildI2PSnark - [ ] buildI2PTunnel - [ ] buildI2PTunnelJars - [ ] buildImagegen - [ ] buildJetty - [ ] buildJrobin - [ ] buildMinistreaming - [ ] buildNewsXMLJar - [ ] buildProperties - [ ] buildRouter - [ ] buildRouterConsole - [ ] buildRouterTest - [ ] buildSAM - [ ] buildSmall - [ ] buildSmallOnly - [ ] buildStreaming - [ ] buildSusiDNS - [ ] buildSusiMail - [ ] buildSusiMailJar - [ ] buildSystray - [ ] buildTest - [ ] buildTools - [ ] buildUtilityJar - [ ] buildWEB - [ ] buildclean - [ ] builddep - [ ] builddepSmall - [ ] buildexe - [ ] buildrouter - [ ] bump - [ ] bumpBuild - [ ] buster - [ ] checkForGit - [ ] checkForIzpack2App - [ ] checkForMtn - [ ] checkForVCS - [ ] checkIfBumped - [ ] checkIfBumpedGit - [ ] checkIfBumpedMtn - [ ] checkoutFromGit - [ ] checkoutFromMtn - [ ] checkoutFromVCS - [ ] clean - [ ] clover.report - [ ] cobertura.report - [ ] consoleDocs - [ ] copy-bionic - [ ] copy-disco - [ ] copy-precise - [ ] copy-trusty - [ ] copy-xenial - [ ] copyJavadoc - [ ] copyflags - [ ] copyflags-unlesspkg - [ ] copyjetty - [ ] copyjetty-unlesspkg - [ ] copyjstl-unlesspkg - [ ] copystandard-unlesspkg - [ ] copystandard-unlesspkg1 - [ ] copystandard-unlesspkg2 - [ ] copytomcat-unlesspkg - [ ] debchange - [ ] debcheckpatch - [ ] debian - [ ] debian-binary - [ ] debian-clean - [ ] debian-patch - [ ] debian-release-tarball - [ ] debian-tarball - [ ] debian-unpatch - [ ] debianhowto - [ ] debianrepo - [ ] delete-j6-update - [ ] delete-nonwindows - [ ] deletepkg-temp - [ ] disableManifestClasspath - [ ] disco - [ ] dist - [ ] dist200 - [ ] distclean - [ ] ensureIzpack5 - [ ] failIfNoMtn - [ ] failIfNoVCS - [ ] findbugs - [ ] forceJava7 - [ ] fulltest - [ ] getBuildNumber - [ ] getExtendedVersion - [ ] getGitRev - [ ] getMtnRev - [ ] getReleaseNumber - [ ] git-bundle - [ ] help - [ ] i2pseeds - [ ] i2psnark - [ ] installer - [ ] installer-all - [ ] installer-freebsd - [ ] installer-linux - [ ] installer-nowindows - [ ] installer-osx - [ ] installer-windows - [ ] installer2app - [ ] installer5 - [ ] installer5-linux - [ ] installer5-nowindows - [ ] installer5-windows - [ ] installer5exe - [ ] installerexe - [ ] izpack-patches - [ ] izpack5-patches - [ ] jar - [ ] jarBote - [ ] jarSmall - [ ] javadoc - [ ] javadoc-test - [ ] javadoc-zip - [ ] jbigi - [ ] jbigi-freebsd-only - [ ] jbigi-linux-nonx86-only - [ ] jbigi-linux-only - [ ] jbigi-linux-x86-64-only - [ ] jbigi-linux-x86-only - [ ] jbigi-list-changes - [ ] jbigi-nowindows - [ ] jbigi-osx-only - [ ] jbigi-windows-only - [ ] jenkins.cobertura.report - [ ] jessie - [ ] junit.report - [ ] junit.test - [ ] justBOB - [ ] launch4j - [ ] mavenCentral - [ ] mavenCentral.deps - [ ] mavenLocal - [ ] mavenLocal.deps - [ ] osxLauncher - [ ] pack200 - [ ] pkg - [ ] pkg-portable-clean - [ ] pkg-portable-win32 - [ ] pkg200 - [ ] pkgclean - [ ] poupdate - [ ] poupdate-source - [ ] precise - [ ] precise-release-tarball - [ ] prep-script-translation - [ ] prepCertificates - [ ] prepConsoleDocs - [ ] prepRouterInfos - [ ] prepTest - [ ] prepgeoupdate - [ ] prepgeoupdate-unlesspkg - [ ] prepjbigiupdate - [ ] prepjupdate - [ ] prepjupdatefixes - [ ] preplicenses - [ ] preplicenses-unlesspkg - [ ] preplicenses-windows - [ ] preppkg - [ ] preppkg-base - [ ] preppkg-freebsd - [ ] preppkg-freebsd-only - [ ] preppkg-linux - [ ] preppkg-linux-nonx86 - [ ] preppkg-linux-only - [ ] preppkg-linux-x86 - [ ] preppkg-nowindows - [ ] preppkg-osx - [ ] preppkg-osx-only - [ ] preppkg-portable-basic - [ ] preppkg-portable-linux-jbigi - [ ] preppkg-portable-win32 - [ ] preppkg-portable-win32-jbigi - [ ] preppkg-unix - [ ] preppkg-windows - [ ] preppkg-windows-only - [ ] preppkgRepack - [ ] prepupdate - [ ] prepupdateRouter - [ ] prepupdateSmall - [ ] release - [ ] release200 - [ ] releaseRepack - [ ] releaseWithGeoIP - [ ] releaseWithGeoIP200 - [ ] releaseWithGeoIPRepack - [ ] releaseWithJbigi - [ ] releaseWithJbigi200 - [ ] releaseWithJbigiRepack - [ ] repack200 - [ ] revisions - [ ] revisionsGit - [ ] revisionsMtn - [ ] scalatest.report - [ ] scalatest.test - [ ] set-lg2-en - [ ] setBuildTimestamp - [ ] settomcatprop - [ ] signed-updater200 - [ ] signed-updater200WithJavadoc - [ ] signed-updater200WithJavadocAndJetty - [ ] signed-updater200WithJetty - [ ] signed-updater200WithJettyAndGeoIP - [ ] slackpkg - [ ] sloccount.report - [ ] tarball - [ ] test - [ ] test.report - [ ] testCore - [ ] testMinistreaming - [ ] testRouter - [ ] testStreaming - [ ] testscripts - [ ] testscripts-all - [ ] testscripts-net - [ ] trimRev - [ ] truncatehistory - [ ] trusty - [ ] updateTest - [ ] updater - [ ] updater-torrent - [ ] updater200 - [ ] updater200WithJavadoc - [ ] updater200WithJavadocAndJetty - [ ] updater200WithJbigi - [ ] updater200WithJetty - [ ] updater200WithJettyAndGeoIP - [ ] updater200WithJettyAndJbigi - [ ] updater200WithJettyFixes - [ ] updater200WithJettyFixesAndJbigi - [ ] updaterRepack - [ ] updaterRouter - [ ] updaterSmall - [ ] updaterWithGeoIP - [ ] updaterWithJavadoc - [ ] updaterWithJavadocAndJetty - [ ] updaterWithJbigi - [ ] updaterWithJetty - [ ] updaterWithJettyAndGeoIP - [ ] updaterWithJettyAndGeoIPRepack - [ ] updaterWithJettyAndJbigi - [ ] updaterWithJettyAndJbigiRepack - [ ] updaterWithJettyFixes - [ ] updaterWithJettyFixesAndGeoIP - [ ] updaterWithJettyFixesAndJbigi - [ ] updaterWithJettyRepack - [ ] util-list-changes - [ ] verifyReleaseBuildNumbers - [ ] webappDistclean - [ ] wheezy - [ ] xenial - [ ] xenial-release-tarball - [ ] zipit - [ ] zipit200
Author
Owner

How are dependencies retrieved for debian builds?

How are dependencies retrieved for debian builds?
Author
Owner

To make it even more explicit: Debian policy prohibits downloads in the build process, period.

To make it even more explicit: Debian policy prohibits downloads in the build process, period.
Author
Owner
  • jsps are all precompiled after my recent changes
  • gettext is done after my recent changes, by calling out to the bundle shell scripts
  • yes you could do the gettext in pure gradle (str4d did it for bote), I peeked at what he did, and decided not to be cause it's GPLv3 and it's complex
  • most of the other exceptions listed by zab aren't important unless ant is going away, which is what OP assumes? BUT:

The title of the MR assumes that we have a goal to replace ant with gradle. We do not. Gradle was half-assed by str4d years ago for unknown reasons, then brought back to life by zab recently so his IDE would work. I did a number of fixups to get it closer.

See http://zzz.i2p/topics/3034 post 2 for some reasons why ant's not going away.

plus, gradle is terrible for anonymity since it's yanking everything over the internet.

- jsps are all precompiled after my recent changes - gettext is done after my recent changes, by calling out to the bundle shell scripts - yes you could do the gettext in pure gradle (str4d did it for bote), I peeked at what he did, and decided not to be cause it's GPLv3 and it's complex - most of the other exceptions listed by zab aren't important unless ant is going away, which is what OP assumes? BUT: The title of the MR assumes that we have a goal to replace ant with gradle. We do not. Gradle was half-assed by str4d years ago for unknown reasons, then brought back to life by zab recently so his IDE would work. I did a number of fixups to get it closer. See http://zzz.i2p/topics/3034 post 2 for some reasons why ant's not going away. plus, gradle is terrible for anonymity since it's yanking everything over the internet.
Author
Owner

Many of the ant targets in the list above are interim i.e. they will not have 1:1 mapping with Gradle targets or more accurately the built-in targets that Gradle provides take care of their functionality.

Currently, the Gradle build systems is complete to the degree that it compiles the code and allows it to be imported in an IDE (IntelliJ and Eclipse confirmed working). @zzz did some work after that to make sure the jars built by Gradle match the jars built by Ant.

Of the top of my head, the main remaining pieces of functionality are:

  • izPack installers for the various systems
  • pre-compiling JSPs
  • gettext
  • signing updaters
  • anything that has to do with Debian
  • standalone I2PSnark

There are complications related to each of those tasks:

IzPack: there is support for using IzPack 4 and 5. The jars for 4 are checked into the code, but jars for 5 are not. I have no idea if IzPack is available in MavenCentral or how best to integrate them into a standard Gradle pipeline

Pre-compiling JSPs: doable, see the MuWire webui subproject

Gettext: same as above. You may need to resort to calling the gettext executable from the Gradle script.

Signing updaters: that is doable but requires some trickery with the buildscript classpath. See the MuWire plug subproject for ideas.

Debian: never built it myself, the only thing I can say is that it is a reproducible build and that may complicate things. You will probably need to resort to using some Gradle plugin.

Standalone I2PSnark: nothing I can say here, but since this is a separate "product" it can stay on Ant I think.

Many of the ant targets in the list above are interim i.e. they will not have 1:1 mapping with Gradle targets or more accurately the built-in targets that Gradle provides take care of their functionality. Currently, the Gradle build systems is complete to the degree that it compiles the code and allows it to be imported in an IDE (IntelliJ and Eclipse confirmed working). @zzz did some work after that to make sure the jars built by Gradle match the jars built by Ant. Of the top of my head, the main remaining pieces of functionality are: * izPack installers for the various systems * pre-compiling JSPs * gettext * signing updaters * anything that has to do with Debian * standalone I2PSnark There are complications related to each of those tasks: IzPack: there is support for using IzPack 4 and 5. The jars for 4 are checked into the code, but jars for 5 are not. I have no idea if IzPack is available in MavenCentral or how best to integrate them into a standard Gradle pipeline Pre-compiling JSPs: doable, see the MuWire `webui` subproject Gettext: same as above. You may need to resort to calling the `gettext` executable from the Gradle script. Signing updaters: that is doable but requires some trickery with the `buildscript` classpath. See the MuWire `plug` subproject for ideas. Debian: never built it myself, the only thing I can say is that it is a reproducible build and that may complicate things. You will probably need to resort to using some Gradle plugin. Standalone I2PSnark: nothing I can say here, but since this is a separate "product" it can stay on Ant I think.
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: I2P_Developers/i2p.i2p#489
No description provided.