TomDmitriev / gradle-bundle-plugin

Apache License 2.0
47 stars 24 forks source link

Support for gradle-2.0 build #18

Closed gamerson closed 10 years ago

gamerson commented 10 years ago

With gradle 2.0 there were several changes necessary.

  1. Add a unit test for assertion that the jar task should only have one action, namely the BundleGenerator, so you can see that here: https://github.com/gamerson/gradle-bundle-plugin/commit/a4650f6d562a0ad65e5c89be53280855a5d4d50e

If you merge just this one and then re-run the integration tests with gradle-1.x it should pass.

  1. Needed to make spock dependency conditional on the gradle version
  2. For gradle-2.0 the old way of setting up the actions will not work (not for sure why, maybe actions property is immutable?), but I found a new API that works in both gradle-1.x and 2.0, see here: https://github.com/gamerson/gradle-bundle-plugin/commit/18b4a7d814f1a3b180abb93d7240918819d0d73c
  3. When I was trying to test this I was having trouble with getting the integTests to run and that is because the output of the gradle install task (in both 1.2 and 2.0) is the following coordinates org.dm.gradle:gradle-bundle-plugin but the build.test integTest build file points to org.dm.gradle:bundle which is not produced by the build locally.

This point there seems to be some confusion because the existing published artifacts use the ord.dm.gradle:bundle coordinates, but gradle install sets the artifact name at gradle-bundle-plugin. So I'm not sure which way you would rather do it, that is up to you, but IMHO gradle-bundle-plugin is more standard.

Thanks!