Updated gradle to 6.9.3 and optimized build process - #1636
Conversation
runningcode
left a comment
There was a problem hiding this comment.
looks good, just one issue (which was already present in the build before)
ebed400 to
f107e95
Compare
runningcode
left a comment
There was a problem hiding this comment.
just some nits, but feel free to open the PR
| jar.dependsOn(attachHermesConsole, 'prepareIndexTemplate') | ||
| sourceSets { | ||
| main { | ||
| resources.srcDir consoleDir |
There was a problem hiding this comment.
you can add the task provider here to automatically wire the task dependencies to ensure they are executed in the correct order
| resources.srcDir consoleDir | |
| resources.srcDir tasks.named('attachHermesConsole') |
There was a problem hiding this comment.
I think this will break the current behaviour of the build as the static files are not attached to the distZip package. This change would add a dependency that will cause static files to be included in the output.
There was a problem hiding this comment.
ah, i see. i suggested this with the assumption that all the outputs would be added.
Do we still would need to make sure that the ProcessResources task dependsOn attachHermesConsole?
There was a problem hiding this comment.
I think not - attachHermesConsole is an auxilliary task that copies static files from other subproject. It's intended to be run manually when needed.
f107e95 to
f4e645c
Compare
| tasks.register('prepareIndexTemplate') { | ||
| def srcDir = '../hermes-console/dist/static' | ||
| def targetDir = consoleDir + '/static' | ||
| from srcDir |
There was a problem hiding this comment.
Small improvement, you should be able to replace this by from tasks.named('buildHermesConsole') and you can remove the dependsOn: 'buildHermesConsole'
There was a problem hiding this comment.
done. I also had to rework this task a little bit to have dist as a source (and static part included when copying)
d50f559 to
1bb413b
Compare
1bb413b to
948649d
Compare
948649d to
4c5a23d
Compare
|
Hi @ajordanow, is this PR still relevant? |
@szczygiel-m - Should be (once the merge conflicts are resolved). But the checks were never green for this PR because at the time of the PR submission they constantly failed on |
|
Since then we have improved the stability of the tests, would you be willing to update this PR? |
Build Optimisations
This PR provides set of optimisations that lead to faster build times and more robust local builds:
hermes-consumers/build.gradle,hermes-management/build.gradle)org.gradle.parallel=trueingradle.properties)HermesSenderTest,ReactiveHermesSenderTest,IntegrationTestandZookeeperBaseTesthad to be modified to use random ports - as reusing the same port numbers prevented the tests to be successful when running in parallel mode)6.9.3(latest6.xversion)Benchmarks
The bencharks were performed on Apple M1 Max machine.
Original build
./gradlew clean assemble checktook about 3m 11s (build scan)./gradlew clean assemble checktook about 20s (build scan)Optimized build
./gradlew clean assemble checktook about 1m 14s (build scan)./gradlew clean assemble checktook about 1s (build scan)Build cache
The build cache was not enabled in the build scripts, but the builds can already benefit from it (e.g. when building locally):