Skip to content

Gradle init script improvements #121

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

Closed
wants to merge 8 commits into from
Closed

Conversation

bigdaz
Copy link
Member

@bigdaz bigdaz commented Jul 26, 2022

Various refactorings and improvements to the init-scripts used to instrument Gradle:

  • Combine 3 separate init-scripts that were configuring GE into a single script.
  • Improve error message when build-validation was run on a non-GE project (without -e).
  • Avoid duplicate plugin application when running on a GE-enabled project with -e.

As well as improving init-script behaviour, these increase the similarity between init-scripts in this project and the TC Build Scan plugin.

@bigdaz bigdaz requested a review from etiennestuder July 26, 2022 22:34
@bigdaz
Copy link
Member Author

bigdaz commented Jul 28, 2022

@etiennestuder I've made the init-scripts as close as I can to the "gold standard" without too many contortions. There are some fundamental differences that make it hard to get closer (ie the build-validation scripts always override the GE server config, but the TC scripts only do this when adding GE to a non-GE project).

I guess a next step could be to try to enable build-validation for projects using Gradle < 5. I haven't tested this because I don't currently have a GE server that allows anonymous publishing, and Gradle 4 doesn't support authentication.


clearWarnings()

// define a buildScanPublished listener that captures the build scan URL and sends it in a message to the server
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-1: Looks like an inaccurate comment.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. This was copied from the "Gold standard" script and should be modified as appropriate

@bigdaz bigdaz force-pushed the dd/init-script-cleanup branch from 9c12129 to 799c75f Compare July 29, 2022 14:17
@etiennestuder
Copy link
Member

I'll take a look over the week-end while in the air.

@bigdaz
Copy link
Member Author

bigdaz commented Aug 23, 2022

@etiennestuder Are you still interested in these changes? If so I can rebase and resolve and conflicts.

@etiennestuder
Copy link
Member

etiennestuder commented Aug 23, 2022

@bigdaz I'm very mnuch still interested. Just did not get to it, yet. Thanks for resolving the coflicts (I belive it's only chnaged versions of GE and CCUD plugin).

bigdaz added 8 commits August 23, 2022 07:05
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.
@bigdaz bigdaz force-pushed the dd/init-script-cleanup branch from 799c75f to 90b755a Compare August 23, 2022 13:52
@bigdaz
Copy link
Member Author

bigdaz commented Aug 23, 2022

@etiennestuder PR has been rebased on main with conflicts resolved.
Note that I remember seeing some further improvements that I'd like to make to the init-script, but these would require changes to the TC plugin as well to keep things in sync.

@erichaagdev
Copy link
Member

Closing this PR in favor of #264

@erichaagdev erichaagdev closed this Jan 9, 2023
@runningcode runningcode deleted the dd/init-script-cleanup branch February 6, 2023 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants