polygene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Merlin <paulmer...@apache.org>
Subject :tools:generator-polygene integrated into the Gradle build
Date Sun, 23 Apr 2017 16:07:14 GMT

I spent some time to integrate the project generator into the build 

./gradlew :tools:generator:check now runs ~40 permutations, 1m30s here

You can also target the test task only:

   ./gradlew :tools:generator:npmTest

A dedicated task can run all the permutations, but it takes a while:

   ./gradlew :tools:generator:npmTestAll

Both tasks automatically installs node, npm, node dependencies and reuse
the staged maven repository with the Polygene artifacts.
The generators tests then use a Gradle init script to add that local
staged maven repository to all builds invocations.

I changed the tests to only to ./gradlew classes instead of
./gradlew build, this makes the tests faster.

A JUnit compatible test report file is generated so Jenkins can take
that into account.

The only brittle thing is putting the Polygene version into the
package.json file, which is done in-place.
I couldn’t find a better way for now.

Another thing to note is that if you Ctrl-C the Gradle process then some 
node processes might be hanging holding file descriptors.
It's a know issue, see 
https://github.com/srs/gradle-node-plugin/issues/143, thumbs-it-up if 
you have a few seconds.
A `killall node` and you're good.

Direct npm command line usage still works:

   npm run test
   npm run test_all

but you’ll need to invoke a Gradle task first:

   ./gradle :tools:generator:generateStageMavenRepositoryInitScript

@Niclas: I think this is way better already despite some loose ends.
Please tell me if you think something should be done differently.
This should change a bit your workflow when working on the generator, 
but for the best I hope.
No more maven local thing etc... and our CI will exercise the tests!

(We'll get some minor failures from CI, I'm fixing theses, mostly 
related to Rat™ now that the project is included in the build system)



View raw message