Skip to content
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

support gradle plugins in a build profile #9437

Conversation

renanfranca
Copy link
Contributor

Fix #8627

}

private void addDependencyToBuildGradle(JavaDependency dependency, Optional<BuildProfileId> buildProfile) {
private void addDependencyToBuildGradle(JavaDependency dependency, Path buildGradleFile, boolean forBuildProfile) {
Copy link
Contributor Author

@renanfranca renanfranca Apr 3, 2024

Choose a reason for hiding this comment

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

@murdos : I still do not like this many parameters but I couldn't think of a better way (I was struggling here)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@murdos : maybe because this profile plugin implementation is counterintuitive, I couldn't think of an elegant way to make the method buildGradleFile handle the PLUGIN_BUILD_GRADLE_FILE = "buildSrc/build.gradle.kts";

  private Path buildGradleFile(Optional<BuildProfileId> buildProfile) {
    return buildProfile
      .map(buildProfileId -> {
        File scriptPlugin = scriptPluginForProfile(buildProfileId);
        if (!scriptPlugin.exists()) {
          throw new MissingGradleProfileException(buildProfileId);
        }
        return scriptPlugin.toPath();
      })
      .orElse(projectFolder.filePath(BUILD_GRADLE_FILE));
  }

Copy link

codecov bot commented Apr 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (097372a) to head (fdcfd0c).
Report is 11 commits behind head on main.

❗ Current head fdcfd0c differs from pull request most recent head fdb5e69. Consider uploading reports for the commit fdb5e69 to get more accurate results

Additional details and impacted files
@@             Coverage Diff             @@
##                main     #9437   +/-   ##
===========================================
  Coverage     100.00%   100.00%           
- Complexity      2959      2982   +23     
===========================================
  Files            737       740    +3     
  Lines          12819     12909   +90     
  Branches         259       259           
===========================================
+ Hits           12819     12909   +90     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@renanfranca renanfranca requested a review from murdos April 3, 2024 17:13
Copy link
Contributor

@murdos murdos left a comment

Choose a reason for hiding this comment

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

I did a first partial review, focused on API design.
I've not yet reviewed GradleCommandHandler, it'll wait until design is settled.

@renanfranca renanfranca force-pushed the 8627-support-gradle-plugins-in-a-build-profile branch 2 times, most recently from 696c911 to f94ec3a Compare April 5, 2024 13:49
@renanfranca renanfranca requested a review from murdos April 5, 2024 16:13
@renanfranca renanfranca force-pushed the 8627-support-gradle-plugins-in-a-build-profile branch from fdcfd0c to f95a37f Compare April 8, 2024 11:30
@renanfranca renanfranca enabled auto-merge April 8, 2024 11:30
@renanfranca
Copy link
Contributor Author

Hello,
I keep receiving the following error at codecov pipeline job. Would someone be able to help me? Is it wait and try again later?
image
https://github.com/jhipster/jhipster-lite/actions/runs/8599285157/job/23564724606

@murdos
Copy link
Contributor

murdos commented Apr 8, 2024

@renanfranca : it's not specific to your branch, this is a generalized issue with the codecov action: codecov/codecov-action#1359

@renanfranca
Copy link
Contributor Author

codecov action: codecov/codecov-action#1359

Thanks!

@renanfranca
Copy link
Contributor Author

@murdos : please, take a look at this:

I'll just update to v4 ... which should work as we're using fedora based images for the coverage reports (IIRC v4 had issues on older ubuntu based images).

He fixed like you did and it seems to working as you can see at the latest actions

@renanfranca
Copy link
Contributor Author

Another possibility of fix (pybop-team/PyBOP#276 (comment)):

The root problem with this bug was a typo in the secret. This cause the token to not be used by the uploaded, defaulting to non-token uploading. This has now fixed.

@renanfranca renanfranca force-pushed the 8627-support-gradle-plugins-in-a-build-profile branch from f95a37f to fdb5e69 Compare April 9, 2024 10:57
@renanfranca renanfranca merged commit c3baa94 into jhipster:main Apr 9, 2024
35 checks passed
@renanfranca renanfranca deleted the 8627-support-gradle-plugins-in-a-build-profile branch April 9, 2024 11:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support java build profile in gradle
2 participants