RUM-14050: Improve Gradle usage in Gitlab#3583
Conversation
33f5a09 to
96a96dd
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #3583 +/- ##
===========================================
- Coverage 72.78% 72.78% -0.00%
===========================================
Files 974 974
Lines 35225 35232 +7
Branches 5968 5966 -2
===========================================
+ Hits 25636 25641 +5
+ Misses 7919 7915 -4
- Partials 1670 1676 +6 🚀 New features to boost your workflow:
|
7613bcc to
0654a53
Compare
1a67f98 to
649e5c3
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 649e5c3efd
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
1e82be8 to
841bcde
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 841bcde19b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
841bcde to
6929cda
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6929cdad1b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
hamorillo
left a comment
There was a problem hiding this comment.
Nice changes!
We are dropping DD_ANDROID_SECRET__GRADLE_PROPERTIES and moving almost all the config to the repo files, which looks good to me. Just a couple of questions:
❓ Should we remove DD_ANDROID_SECRET__GRADLE_PROPERTIES when the PR is merged? Maybe it is still used in other places, though.
❓ What about kotlin.incremental=true and kotlin.compiler.execution.strategy=in-process? They were in the previous gradle.properties, but we are not mentioning anything about them in the PR.
@hamorillo I think we can safely delete it we should probably keep it till we publish a release and make sure we don't need to revert
The default is daemon so I guess we should bring this one back
This looks to be the default of true since 1.1.1 so I think its safe to remove it 😄 |
7e234ea to
6867456
Compare
hamorillo
left a comment
There was a problem hiding this comment.
we should probably keep it till we publish a release and make sure we don't need to revert
Sounds good!
| # Assemble is required to get generated classes type resolution | ||
| echo "------ Assemble Libraries & Build Detekt custom rules" | ||
| ./gradlew assembleLibrariesDebug printSdkDebugRuntimeClasspath :tools:detekt:jar | ||
| ./gradlew assembleLibrariesDebug printSdkDebugRuntimeClasspath :tools:detekt:jar --no-parallel |
There was a problem hiding this comment.
Why do we need --no-parallel here?
There was a problem hiding this comment.
Ok, I got it now, it is needed for printSdkDebugRuntimeClasspath. But we should be able to run assembleLibrariesDebug in parallel I think.
There was a problem hiding this comment.
You are correct. I'll need to split the gradllew into two invokes but that is probably fine
There was a problem hiding this comment.
| - !reference [.snippets, set-publishing-credentials] | ||
| - ./gradlew publishToSonatype closeSonatypeStagingRepository --stacktrace --no-daemon | ||
| - !reference [.snippets, setup-gradle] | ||
| - ./gradlew publishToSonatype closeSonatypeStagingRepository |
There was a problem hiding this comment.
very very nit:
Just to be extra careful I would probably add --no-build-cache to this gradle command so that cache is 100% not used in the build of our release.
Yes, I understand that it will not be used because we don't attach the cache artifacts to this job, but still.
| # Assemble is required to get generated classes type resolution | ||
| echo "------ Assemble Libraries & Build Detekt custom rules" | ||
| ./gradlew assembleLibrariesDebug printSdkDebugRuntimeClasspath :tools:detekt:jar | ||
| ./gradlew assembleLibrariesDebug printSdkDebugRuntimeClasspath :tools:detekt:jar --no-parallel |
There was a problem hiding this comment.
Ok, I got it now, it is needed for printSdkDebugRuntimeClasspath. But we should be able to run assembleLibrariesDebug in parallel I think.
- Add setup-gradle snippet that centralizes all Gradle config by appending to gradle.properties at job setup time, replacing per-job GRADLE_OPTS boilerplate across all jobs - Unify JVM memory to -Xmx4096m for all jobs (was inconsistently 3072m or 4096m per-job) - Remove get_secret gradle.properties injection from publishing/sample jobs - Remove --build-cache flags (redundant with org.gradle.caching=true in gradle.properties) - Remove rm -rf ~/.gradle/daemon/ from all jobs since jobs get a new container and we don't cache it - Fix cache cleanup to only run on test:kover (the only cache-push job) via GRADLE_CACHE_CLEANUP variable, disabled on all pull-only jobs - Fix unzipAarForDetekt task to declare its dependency on bundleReleaseAar using provider-based wiring instead of a hardcoded output path - Drop `kotlin.incremental=true` due to it is already the default - Enable parallel mode, disable it for jobs that invoke tasks that can't run in parallel mode
6867456 to
5b9b127
Compare
What does this PR do?
kotlin.incremental=truedue to it is already the defaultMotivation
Standardize the Gradle usage a bit