-
Notifications
You must be signed in to change notification settings - Fork 23
Gradle init script improvements #264
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
Conversation
The intent with the displayed command is to show the user a simple command they can use themselves when running Gradle directly to achieve a similar result. With that in mind, we don't print out the full command used so as not to distract or misslead the user. These initialization scripts have become sufficiently complex that I think many users would have difficulty interpreting them or understanding what they do. Which is fine, but it's a reason why we don't necessarily want to display their use in the command that we execute. |
components/scripts/gradle/gradle-init-scripts/configure-gradle-enterprise.gradle
Outdated
Show resolved
Hide resolved
components/scripts/gradle/gradle-init-scripts/configure-gradle-enterprise.gradle
Outdated
Show resolved
Hide resolved
A positive side effect of removing
If we run the above without these changes, the build will fail with the following error: As you can see, it is asking to accept the terms of service so that a Build Scan may be published to scans.gradle.com. This is risky when running the scripts for a project whose Build Scan should not be made publicly available. With these changes, the user will see the following instead: |
f3bab9a
to
c912797
Compare
Loading the GE plugin into the initscript classpath is not required.
Removes the separate 'capture-published-build-scan.gradle' init script, merging the functionality into 'configure-gradle-enterprise.gradle'. This reduces duplication and simplifies the overall scripts.
Borrowing the logic from the TC Build Scan plugin, the init-script now checks if the GE / CCUD plugins are already applied.
This reduces duplication and increases similarity with TC Build Scan plugin.
This causes build classpath issues with Gradle 5.x
These clutter the console
Co-authored-by: Jim Hurne <jhurne@gradle.com>
ae59a4b
to
7e0594d
Compare
❄️ Winter Update PR Navigator ❄️
-x
for Gradle experiment 1 #262⛄ = you are here
Summary
This PR is a rebased version of #121 from @bigdaz. I decided to create a new branch and PR in order to preserve his branch as it. That way I could easily switch between the two as I verified these changes. Once this PR is merged #121 can be closed.
-e
bothcom.gradle.build-scan
andcom.gradle.enterprise
are applied. This can be seen in this Build Scan. It seems this scenario causes an error when applying CCUD.I was able to resolve this by removing
--scan
as a parameter to the build validation scripts' Gradle invocation. Since the initialization scripts take care of configuring and setting up Gradle Enterprise I don't think the--scan
parameter is required.However,
--scan
is still displayed in the printed Gradle invocation command. This is somewhat misleading now. In my opinion, it was also misleading before since the displayed command does not include the initialization scripts that perform additional configuration transparent to the user.The only other change from #121 is that I removed all
logger
calls in the initialization scripts since they created unnecessary noise in the validation scripts output that was not present before.Testing
In order to test this I ran the following experiments and verified a successful outcome.
The following parameter combinations were tested with Gradle
5.x
,6.x
, and7.x
:-x
)-e
)-x
), enable GE (-e
)