Skip to content

Commit de7fd14

Browse files
authored
Update dependency versions
* Bump plugin versions - Shadow plugin to 8.1.1 - plugin-publish to 1.2.1 * Bump test dependencies - junit-jupiter to 2.10.1 - groovy-json to 3.0.19 - google-gson to 2.10.1 - json-schema-validator to 1.0.87 - jetbrains-annotations to 24.0.1 * Remove some unused code and implicit dependencies * Remove unused httpclient dependency * Bump commons-io to 2.13.0
1 parent 3254b08 commit de7fd14

File tree

9 files changed

+17
-620
lines changed

9 files changed

+17
-620
lines changed

gradle/libs.versions.toml

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[versions]
2-
spock = "2.0-groovy-3.0"
2+
spock = "2.3-groovy-3.0"
33
kotlin = "1.8.10"
44

55
[libraries]
@@ -8,22 +8,23 @@ jackson-databind = { group = "com.fasterxml.jackson.core", name = "jackson-datab
88
jackson-parameter-names = { group = "com.fasterxml.jackson.module", name = "jackson-module-parameter-names" }
99
jackson-kotlin = { group = "com.fasterxml.jackson.module", name = "jackson-module-kotlin" }
1010

11-
apache-httpclient = { group = "org.apache.httpcomponents.client5", name = "httpclient5", version = "5.1.2" }
12-
apache-commons-io = { group = "commons-io", name = "commons-io", version = "2.11.0" }
11+
apache-commons-io = { group = "commons-io", name = "commons-io", version = "2.13.0" }
1312

1413
github-packageurl = { group = "com.github.package-url", name = "packageurl-java", version = "1.4.1" }
1514

15+
### Test dependencies
16+
1617
spock-core = { group = "org.spockframework", name = "spock-core", version.ref = "spock" }
1718
spock-junit4 = { group = "org.spockframework", name = "spock-junit4", version.ref = "spock" }
1819
junit-junit4 = { group = "junit", name = "junit", version = "4.13.2" }
20+
junit-jupiter = { group = "org.junit.jupiter", name = "junit-jupiter", version = "5.10.0" }
1921

20-
21-
junit-jupiter = { group = "org.junit.jupiter", name = "junit-jupiter", version = "5.8.2" }
22-
23-
groovy-json = { group = "org.codehaus.groovy", name = "groovy-json", version = "3.0.9" }
24-
json-schema-validator = { group = "com.networknt", name = "json-schema-validator", version = "1.0.64" }
25-
jetbrains-annotations = { group = "org.jetbrains", name = "annotations", version = "22.0.0" }
26-
google-gson = { group = "com.google.code.gson", name = "gson", version = "2.8.9" }
22+
groovy-json = { group = "org.codehaus.groovy", name = "groovy-json", version = "3.0.19" }
23+
json-schema-validator = { group = "com.networknt", name = "json-schema-validator", version = "1.0.87" }
24+
jetbrains-annotations = { group = "org.jetbrains", name = "annotations", version = "24.0.1" }
25+
google-gson = { group = "com.google.code.gson", name = "gson", version = "2.10.1" }
2726

2827
[plugins]
29-
shadow-jar = { id = "com.github.johnrengelman.shadow", version = "8.1.0"}
28+
shadow-jar = { id = "com.github.johnrengelman.shadow", version = "8.1.1"}
29+
plugin-publish = { id = "com.gradle.plugin-publish", version = "1.2.1" }
30+
github-release = { id = "com.github.breadmoirai.github-release", version = "2.4.1"}

plugin-test/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ dependencies {
2323

2424
testFixturesImplementation(gradleApi())
2525
testFixturesImplementation(libs.google.gson)
26+
testFixturesImplementation(libs.apache.commons.io)
2627
}
2728

2829
val writeTestConfig by tasks.registering(WriteConfigTask::class) {

plugin-test/src/testFixtures/groovy/org/gradle/test/fixtures/AbstractModule.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ package org.gradle.test.fixtures
1919
import org.gradle.internal.IoActions
2020
import org.gradle.internal.hash.HashFunction
2121
import org.gradle.internal.hash.Hashing
22-
import org.gradle.internal.impldep.org.apache.commons.io.FilenameUtils
22+
import org.apache.commons.io.FilenameUtils
2323
import org.gradle.test.fixtures.file.TestFile
2424
import org.gradle.util.internal.TextUtil
2525

plugin-test/src/testFixtures/groovy/org/gradle/test/fixtures/file/TestFile.java

Lines changed: 1 addition & 230 deletions
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,18 @@
1616

1717
package org.gradle.test.fixtures.file;
1818

19-
import org.apache.tools.ant.Project;
20-
import org.apache.tools.ant.taskdefs.Zip;
2119
import org.codehaus.groovy.runtime.ResourceGroovyMethods;
2220
import org.gradle.api.UncheckedIOException;
2321
import org.gradle.internal.hash.HashCode;
2422
import org.gradle.internal.hash.Hashing;
25-
import org.gradle.internal.impldep.com.google.common.collect.Lists;
26-
import org.gradle.internal.impldep.org.apache.commons.io.FileUtils;
23+
import org.apache.commons.io.FileUtils;
2724
import org.hamcrest.Matcher;
2825
import org.intellij.lang.annotations.Language;
2926
import org.junit.Assert;
3027

3128
import java.io.BufferedReader;
3229
import java.io.File;
3330
import java.io.FileInputStream;
34-
import java.io.FileOutputStream;
3531
import java.io.FileReader;
3632
import java.io.IOException;
3733
import java.io.ObjectStreamException;
@@ -58,9 +54,7 @@
5854

5955
import static org.hamcrest.MatcherAssert.assertThat;
6056
import static org.junit.Assert.assertEquals;
61-
import static org.junit.Assert.assertNotEquals;
6257
import static org.junit.Assert.assertTrue;
63-
import static org.junit.Assume.assumeTrue;
6458

6559
public class TestFile extends File {
6660
private final File relativeBase;
@@ -542,73 +536,7 @@ private void clearCanonCaches() {
542536
// return new TestFileHelper(this).getMode();
543537
// }
544538

545-
/**
546-
* Asserts that this is a directory and contains exactly the given set of descendant files and child directories. Ignores directories that are not empty.
547-
*/
548-
public TestFile assertHasDescendants(String... descendants) {
549-
return assertHasDescendants(Arrays.asList(descendants));
550-
}
551-
552-
/**
553-
* Asserts that this is a directory and contains exactly the given set of descendant files and child directories. Ignores directories that are not empty.
554-
*/
555-
public TestFile assertHasDescendants(Iterable<String> descendants) {
556-
return assertHasDescendants(descendants, false);
557-
}
558-
559-
public TestFile assertHasDescendants(Iterable<String> descendants, boolean ignoreDirs) {
560-
Set<String> actual = new TreeSet<String>();
561-
assertIsDir();
562-
visit(actual, "", this, ignoreDirs);
563-
Set<String> expected = new TreeSet<>(Lists.newArrayList(descendants));
564-
565-
Set<String> extras = new TreeSet<>(actual);
566-
extras.removeAll(expected);
567-
Set<String> missing = new TreeSet<>(expected);
568-
missing.removeAll(actual);
569-
570-
assertEquals(String.format("For dir: %s\n extra files: %s, missing files: %s, expected: %s", this, extras, missing, expected), expected, actual);
571-
572-
return this;
573-
}
574-
575-
/**
576-
* Asserts that this is a directory and contains the given set of descendant files and child directories (and possibly other files). Ignores directories that are not empty.
577-
*/
578-
public TestFile assertContainsDescendants(Iterable<String> descendants) {
579-
assertIsDir();
580-
Set<String> actual = new TreeSet<String>();
581-
visit(actual, "", this, false);
582-
583-
Set<String> expected = new TreeSet<String>(Lists.newArrayList(descendants));
584-
585-
Set<String> missing = new TreeSet<String>(expected);
586-
missing.removeAll(actual);
587-
588-
assertTrue(String.format("For dir: %s\n missing files: %s, expected: %s, actual: %s", this, missing, expected, actual), missing.isEmpty());
589-
590-
return this;
591-
}
592539

593-
/**
594-
* Asserts that this is a directory and contains the given set of descendant files (and possibly other files). Ignores directories that are not empty.
595-
*/
596-
public TestFile assertContainsDescendants(String... descendants) {
597-
return assertContainsDescendants(Arrays.asList(descendants));
598-
}
599-
600-
public TestFile assertIsEmptyDir() {
601-
assertHasDescendants();
602-
return this;
603-
}
604-
605-
public Set<String> allDescendants() {
606-
Set<String> names = new TreeSet<String>();
607-
if (isDirectory()) {
608-
visit(names, "", this, false);
609-
}
610-
return names;
611-
}
612540

613541
private void visit(Set<String> names, String prefix, File file, boolean ignoreDirs) {
614542
for (File child : file.listFiles()) {
@@ -620,13 +548,6 @@ private void visit(Set<String> names, String prefix, File file, boolean ignoreDi
620548
}
621549
}
622550

623-
public boolean isSelfOrDescendent(File file) {
624-
if (file.getAbsolutePath().equals(getAbsolutePath())) {
625-
return true;
626-
}
627-
return file.getAbsolutePath().startsWith(getAbsolutePath() + File.separatorChar);
628-
}
629-
630551
public TestFile createDir() {
631552
if (mkdirs()) {
632553
return this;
@@ -638,29 +559,6 @@ public TestFile createDir() {
638559
+ ". Diagnostics: exists=" + this.exists() + ", isFile=" + this.isFile() + ", isDirectory=" + this.isDirectory());
639560
}
640561

641-
public TestFile createDir(Object path) {
642-
return new TestFile(this, path).createDir();
643-
}
644-
645-
// public TestFile deleteDir() {
646-
// new TestFileHelper(this).delete(useNativeTools);
647-
// return this;
648-
// }
649-
650-
// /**
651-
// * Attempts to delete this directory, ignoring failures to do so.
652-
// *
653-
// * @return this
654-
// */
655-
// public TestFile maybeDeleteDir() {
656-
// try {
657-
// deleteDir();
658-
// } catch (RuntimeException e) {
659-
// // Ignore
660-
// }
661-
// return this;
662-
// }
663-
664562
/**
665563
* Recursively delete this directory, reporting all failed paths.
666564
*/
@@ -725,74 +623,6 @@ public TestFile makeUnreadable() {
725623
return this;
726624
}
727625

728-
public TestFile makeReadable() {
729-
setReadable(true, false);
730-
assert Files.isReadable(toPath());
731-
return this;
732-
}
733-
734-
public TestFile createFile(Object path) {
735-
return file(path).createFile();
736-
}
737-
738-
public TestFile createZip(Object path) {
739-
Zip zip = new Zip();
740-
zip.setWhenempty((Zip.WhenEmpty) Zip.WhenEmpty.getInstance(Zip.WhenEmpty.class, "create"));
741-
TestFile zipFile = file(path);
742-
zip.setDestFile(zipFile);
743-
zip.setBasedir(this);
744-
zip.setExcludes("**");
745-
zip.setProject(new Project());
746-
zip.execute();
747-
return zipFile;
748-
}
749-
750-
// public TestFile zipTo(TestFile zipFile) {
751-
// return zipTo(zipFile, false);
752-
// }
753-
//
754-
// public TestFile zipTo(TestFile zipFile, boolean readOnly) {
755-
// new TestFileHelper(this).zipTo(zipFile, useNativeTools, readOnly);
756-
// return this;
757-
// }
758-
//
759-
// public TestFile tarTo(TestFile tarFile) {
760-
// return tarTo(tarFile, false);
761-
// }
762-
//
763-
// public TestFile tarTo(TestFile tarFile, boolean readOnly) {
764-
// new TestFileHelper(this).tarTo(tarFile, useNativeTools, readOnly);
765-
// return this;
766-
// }
767-
//
768-
// public TestFile tgzTo(TestFile tarFile) {
769-
// return tgzTo(tarFile, false);
770-
// }
771-
//
772-
// public TestFile tgzTo(TestFile tarFile, boolean readOnly) {
773-
// new TestFileHelper(this).tgzTo(tarFile, readOnly);
774-
// return this;
775-
// }
776-
//
777-
// public TestFile tbzTo(TestFile tarFile) {
778-
// return tbzTo(tarFile, false);
779-
// }
780-
//
781-
// public TestFile tbzTo(TestFile tarFile, boolean readOnly) {
782-
// new TestFileHelper(this).tbzTo(tarFile, readOnly);
783-
// return this;
784-
// }
785-
//
786-
// public TestFile bzip2To(TestFile compressedFile) {
787-
// new TestFileHelper(this).bzip2To(compressedFile);
788-
// return this;
789-
// }
790-
//
791-
// public TestFile gzipTo(TestFile compressedFile) {
792-
// new TestFileHelper(this).gzipTo(compressedFile);
793-
// return this;
794-
// }
795-
796626
public Snapshot snapshot() {
797627
assertIsFile();
798628
return new Snapshot(lastModified(), md5(this));
@@ -803,72 +633,13 @@ public void assertHasChangedSince(Snapshot snapshot) {
803633
assertTrue(String.format("contents or modification time of %s have not changed", this), now.modTime != snapshot.modTime || !now.hash.equals(snapshot.hash));
804634
}
805635

806-
public void assertContentsHaveChangedSince(Snapshot snapshot) {
807-
Snapshot now = snapshot();
808-
assertNotEquals(String.format("contents of %s have not changed", this), snapshot.hash, now.hash);
809-
}
810-
811-
public void assertContentsHaveNotChangedSince(Snapshot snapshot) {
812-
Snapshot now = snapshot();
813-
assertEquals(String.format("contents of %s has changed", this), snapshot.hash, now.hash);
814-
}
815-
816-
public void assertHasNotChangedSince(Snapshot snapshot) {
817-
Snapshot now = snapshot();
818-
assertEquals(String.format("last modified time of %s has changed", this), snapshot.modTime, now.modTime);
819-
assertEquals(String.format("contents of %s has changed", this), snapshot.hash, now.hash);
820-
}
821-
822-
public void writeProperties(Map<?, ?> properties) {
823-
Properties props = new Properties();
824-
props.putAll(properties);
825-
try {
826-
FileOutputStream stream = new FileOutputStream(this);
827-
try {
828-
props.store(stream, "comment");
829-
} finally {
830-
stream.close();
831-
}
832-
} catch (IOException e) {
833-
throw new RuntimeException(e);
834-
}
835-
}
836-
837-
public void assumeExists() {
838-
assumeTrue(this.exists());
839-
}
840-
841-
// public ExecOutput exec(Object... args) {
842-
// return new TestFileHelper(this).executeSuccess(Arrays.asList(args), null);
843-
// }
844-
//
845-
// public ExecOutput execWithFailure(List<?> args, List<?> env) {
846-
// return new TestFileHelper(this).executeFailure(args, env);
847-
// }
848-
//
849-
// public ExecOutput execute(List<?> args, List<?> env) {
850-
// return new TestFileHelper(this).executeSuccess(args, env);
851-
// }
852-
853636
/**
854637
* Relativizes the URI of this file according to the base directory.
855638
*/
856639
public URI relativizeFrom(TestFile baseDir) {
857640
return baseDir.toURI().relativize(toURI());
858641
}
859642

860-
/**
861-
* Returns a human-readable relative path to this file from the base directory passed to create this TestFile.
862-
*
863-
* Fails if this TestFile was created in a way that did not provide a relative base.
864-
*
865-
* @see #relativizeFrom(TestFile)
866-
* @see Path#relativize(Path)
867-
*/
868-
public String getRelativePathFromBase() {
869-
Assert.assertTrue("relativeBase must have been set during construction", !relativeBase.toPath().equals(this.toPath()));
870-
return relativeBase.toPath().relativize(this.toPath()).toString();
871-
}
872643

873644
public static class Snapshot {
874645
private final long modTime;

0 commit comments

Comments
 (0)