-
Notifications
You must be signed in to change notification settings - Fork 218
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updated gradle to 6.9.3 and optimized build process #1636
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good, just one issue (which was already present in the build before)
ebed400
to
f107e95
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
hermes-management/build.gradle
Outdated
tasks.register('prepareIndexTemplate') { | ||
def srcDir = '../hermes-console/dist/static' | ||
def targetDir = consoleDir + '/static' | ||
from srcDir |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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=true
ingradle.properties
)HermesSenderTest
,ReactiveHermesSenderTest
,IntegrationTest
andZookeeperBaseTest
had 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.x
version)Benchmarks
The bencharks were performed on Apple M1 Max machine.
Original build
./gradlew clean assemble check
took about 3m 11s (build scan)./gradlew clean assemble check
took about 20s (build scan)Optimized build
./gradlew clean assemble check
took about 1m 14s (build scan)./gradlew clean assemble check
took 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):