Skip to content

Commit 62211f8

Browse files
committed
Upgrade to JarHC 3.0.0. Bump dependencies.
1 parent 7a7b14e commit 62211f8

File tree

10 files changed

+197
-223
lines changed

10 files changed

+197
-223
lines changed

README.md

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -76,16 +76,12 @@ tasks {
7676
// Sections to include in the report.
7777
// See https://github.com/smarkwal/jarhc/wiki/Usage for more details.
7878
// Default: empty list = include all sections
79-
sections.addAll("jf", "m", "cv", "jd", "d", "p", "dc", "bc", "bl")
79+
sections.addAll("jf", "d", "dc", "bc", "bl", "jm", "m", "ob" )
8080

8181
// Exclude sections without any issues from the report.
8282
// Default: false
8383
skipEmpty.set(true)
8484

85-
// Sort JAR files in reports by name.
86-
// Default: false
87-
sortRows.set(true)
88-
8985
// Java release (8, 9, 10, ...) to use for analysis of multi-release JAR files.
9086
// Default: version of Java used to run Gradle build
9187
release.set(11)
@@ -94,14 +90,6 @@ tasks {
9490
// Default: "ParentLast"
9591
strategy.set("ParentFirst")
9692

97-
// Remove version numbers from JAR file names in the report.
98-
// Default: false
99-
removeVersion.set(true)
100-
101-
// Recreate JAR file names based on Maven coordinates if possible.
102-
// Default: false
103-
useArtifactName.set(true)
104-
10593
// Ignore issues related to missing Java annotations.
10694
// Default: false
10795
ignoreMissingAnnotations.set(true)

build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@ plugins {
2020

2121
// Gradle Versions Plugin
2222
// https://github.com/ben-manes/gradle-versions-plugin
23-
id("com.github.ben-manes.versions") version "0.51.0"
23+
id("com.github.ben-manes.versions") version "0.52.0"
2424

2525
}
2626

2727
buildscript {
2828
dependencies {
2929
// fix CVE-2023-3635 in Okio < 3.4.0
30-
// (indirect dependency of Gradle Versions Plugin 0.51.0)
30+
// (indirect dependency of Gradle Versions Plugin 0.52.0)
3131
classpath("com.squareup.okio:okio:3.10.2")
3232
classpath("com.squareup.okio:okio-jvm:3.10.2")
3333
}

jarhc-gradle-plugin/build.gradle.kts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ plugins {
2222

2323
// Gradle Publish plugin
2424
// https://plugins.gradle.org/docs/publish-plugin
25-
id("com.gradle.plugin-publish") version "1.3.0"
25+
id("com.gradle.plugin-publish") version "1.3.1"
2626

2727
// Gradle Shadow plugin
2828
id("com.github.johnrengelman.shadow") version "8.1.1"
@@ -53,17 +53,17 @@ gradle.taskGraph.whenReady {
5353
dependencies {
5454

5555
// JarHC 2.2.2
56-
implementation("org.jarhc:jarhc:2.2.2")
56+
implementation("org.jarhc:jarhc:3.0.0")
5757

5858
// Gradle API
5959
// (this is required because the Gradle API dependency gets removed by the Shadow plugin)
6060
api(gradleApi())
6161
testImplementation(gradleApi())
6262

6363
// JUnit 5 and Mockito
64-
testImplementation("org.junit.jupiter:junit-jupiter:5.11.4")
64+
testImplementation("org.junit.jupiter:junit-jupiter:5.12.0")
6565
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
66-
testImplementation("org.mockito:mockito-junit-jupiter:5.15.2")
66+
testImplementation("org.mockito:mockito-junit-jupiter:5.16.0")
6767
}
6868

6969
gradlePlugin {

jarhc-gradle-plugin/src/functionalTest/resources/projects/default-config/expected-output.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
JarHC - JAR Health Check 2.2.2
1+
JarHC - JAR Health Check 3.0.0
22
==============================
33

44
Load JAR files ...

jarhc-gradle-plugin/src/functionalTest/resources/projects/default-config/expected-report.txt

Lines changed: 92 additions & 93 deletions
Large diffs are not rendered by default.

jarhc-gradle-plugin/src/functionalTest/resources/projects/full-config/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ tasks {
2121
jarhcReport {
2222
classpath.setFrom(configurations.runtimeClasspath)
2323
dataDir.set(file("${layout.buildDirectory.get()}/jarhc-data"))
24-
sections.addAll("jf", "m", "cv", "jd", "d", "p", "dc", "bc", "bl")
24+
sections.addAll("jf", "d", "dc", "bc", "bl", "jm", "m", "ob")
2525
skipEmpty.set(true)
2626
sortRows.set(true)
2727
release.set(11)

jarhc-gradle-plugin/src/functionalTest/resources/projects/full-config/expected-output.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
JarHC - JAR Health Check 2.2.2
1+
JarHC - JAR Health Check 3.0.0
22
==============================
33

44
Load JAR files ...

jarhc-gradle-plugin/src/functionalTest/resources/projects/full-config/expected-report.txt

Lines changed: 88 additions & 89 deletions
Large diffs are not rendered by default.

jarhc-gradle-plugin/src/main/java/org/jarhc/gradle/JarhcReportTask.java

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616

1717
package org.jarhc.gradle;
1818

19-
import static org.jarhc.artifacts.MavenRepository.MAVEN_CENTRAL_URL;
20-
2119
import java.io.File;
2220
import java.util.List;
2321
import org.gradle.api.DefaultTask;
@@ -159,10 +157,8 @@ Options createOptions(Project project, Logger logger) {
159157
options.setSkipEmpty(skipEmpty);
160158
}
161159

162-
if (getSortRows().isPresent()) {
163-
boolean sortRows = getSortRows().get();
164-
logger.info("Sort rows: {}", sortRows);
165-
options.setSortRows(sortRows);
160+
if (getSortRows() != null && getSortRows().isPresent()) {
161+
logger.warn("Option 'sortRows' has been deprecated and is ignored.");
166162
}
167163

168164
if (getRelease().isPresent() && getRelease().get() > 0) {
@@ -177,16 +173,12 @@ Options createOptions(Project project, Logger logger) {
177173
options.setClassLoaderStrategy(ClassLoaderStrategy.valueOf(strategy));
178174
}
179175

180-
if (getRemoveVersion().isPresent()) {
181-
boolean removeVersion = getRemoveVersion().get();
182-
logger.info("Remove version: {}", removeVersion);
183-
options.setRemoveVersion(removeVersion);
176+
if (getRemoveVersion() != null && getRemoveVersion().isPresent()) {
177+
logger.warn("Option 'removeVersion' has been deprecated and is ignored.");
184178
}
185179

186-
if (getUseArtifactName().isPresent()) {
187-
boolean useArtifactName = getUseArtifactName().get();
188-
logger.info("Use artifact name: {}", useArtifactName);
189-
options.setUseArtifactName(useArtifactName);
180+
if (getUseArtifactName() != null && getUseArtifactName().isPresent()) {
181+
logger.warn("Option 'useArtifactName' has been deprecated and is ignored.");
190182
}
191183

192184
if (getIgnoreMissingAnnotations().isPresent()) {
@@ -245,7 +237,7 @@ int runJarHC(Options options, Logger logger) {
245237
ArtifactFinder artifactFinder = new MavenArtifactFinder(cacheDir, logger);
246238

247239
int javaVersion = options.getRelease();
248-
Repository repository = new MavenRepository(javaVersion, MAVEN_CENTRAL_URL, dataPath, artifactFinder, logger);
240+
Repository repository = new MavenRepository(javaVersion, options, dataPath, artifactFinder, logger);
249241

250242
Application application = new Application(logger);
251243
application.setRepository(repository);

jarhc-gradle-plugin/src/test/java/org/jarhc/gradle/JarhcGradlePluginTest.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,6 @@ void createOptions_withDefaultConfig() {
237237
assertFalse(options.isSkipEmpty());
238238
assertEquals(11, options.getRelease());
239239
assertEquals(ClassLoaderStrategy.ParentLast, options.getClassLoaderStrategy());
240-
assertFalse(options.isRemoveVersion());
241-
assertFalse(options.isUseArtifactName());
242240
assertFalse(options.isIgnoreMissingAnnotations());
243241
assertFalse(options.isIgnoreExactCopy());
244242
assertEquals("/jarhc/data", options.getDataPath());
@@ -337,8 +335,6 @@ void createOptions_withFullConfig() {
337335
assertTrue(options.isSkipEmpty());
338336
assertEquals(17, options.getRelease());
339337
assertEquals(ClassLoaderStrategy.ParentFirst, options.getClassLoaderStrategy());
340-
assertTrue(options.isRemoveVersion());
341-
assertTrue(options.isUseArtifactName());
342338
assertTrue(options.isIgnoreMissingAnnotations());
343339
assertTrue(options.isIgnoreExactCopy());
344340
assertEquals("/jarhc/data", options.getDataPath());

0 commit comments

Comments
 (0)