SONARRUBY-125 Upgrade gradle wrapper to 9.3.1#105
Conversation
2a6e376 to
bc384fd
Compare
dorian-burihabwa-sonarsource
left a comment
There was a problem hiding this comment.
In addition to adding comments explaining the code that we added to replace the JRuby Gradle plugin, we need to split the work in this PR into 2 commits:
- The replacement of the JRuby Gradle plugin with custom code
- The actual upgrade to Gradle 9.3.1
| URL initParserScriptUrl = RubyConverter.class.getResource(fromRoot(SETUP_SCRIPT_PATH)); | ||
|
|
||
| Ruby rubyRuntime = JavaEmbedUtils.initialize(Arrays.asList(raccRubygem.toString(), astRubygem.toString(), parserRubygem.toString())); | ||
| if (raccRubygem == null || astRubygem == null || parserRubygem == null || initParserScriptUrl == null) { |
There was a problem hiding this comment.
Why are any of these elements nullable, now?
sonar-ruby-plugin/build.gradle
Outdated
|
|
||
| plugins { | ||
| id 'com.github.johnrengelman.shadow' version '7.1.0' | ||
| id 'com.github.jruby-gradle.base' version '2.0.2' |
There was a problem hiding this comment.
Getting rid of the jruby plugin is a significant effort that deserves its own commit, if not ticket, that should not be squashed on its own in the end
| tasks.register("unpackDependencyGems") { | ||
| def outputDir = layout.buildDirectory.dir("dependency_gems/gems").get().asFile | ||
| def extractionDir = layout.buildDirectory.dir("tmp/unpackDependencyGems").get().asFile | ||
| outputs.dir(outputDir) | ||
| inputs.files(configurations.gems) | ||
|
|
||
| doLast { | ||
| delete(outputDir, extractionDir) | ||
| outputDir.mkdirs() | ||
| extractionDir.mkdirs() | ||
|
|
||
| configurations.gems.files.each { gemFile -> | ||
| def gemExtractionDir = new File(extractionDir, gemFile.name) | ||
| copy { | ||
| from tarTree(gemFile) | ||
| include "data.tar.gz" | ||
| into gemExtractionDir | ||
| } | ||
| } | ||
|
|
||
| fileTree(extractionDir).matching { include "**/data.tar.gz" }.files.each { dataTarGz -> | ||
| def gemDirectoryName = dataTarGz.parentFile.name.replaceFirst(/\.gem$/, "") | ||
| copy { | ||
| from tarTree(resources.gzip(dataTarGz)) | ||
| into new File(outputDir, gemDirectoryName) | ||
| } | ||
| } | ||
| } |
There was a problem hiding this comment.
We will need some comment explaining clearly what the intent is so that we don't introduce regressions by mistake
07e410b to
d5a7e00
Compare
d5a7e00 to
428eaa8
Compare
428eaa8 to
873da1f
Compare
dorian-burihabwa-sonarsource
left a comment
There was a problem hiding this comment.
LGTM 👍🏿 I would still add a comment about the shadowing configuration
| } | ||
|
|
||
| shadowJar { | ||
| duplicatesStrategy = DuplicatesStrategy.EXCLUDE |
There was a problem hiding this comment.
I think it would help to add a comment about why we add this parameter. We discussed about this in other repos, but it would help not having to jump around to find the why
There was a problem hiding this comment.
I added the comment explaining why this duplicateStrategy was added
|





No description provided.