From 020a4760a0f97e189347f9438ac22fe7822773c3 Mon Sep 17 00:00:00 2001 From: Goooler Date: Tue, 3 Dec 2024 15:54:59 +0800 Subject: [PATCH] Replace File with Path in MavenPathRepository --- .../gradle/plugins/shadow/util/PluginSpecification.groovy | 2 +- .../shadow/util/repo/maven/MavenPathRepository.groovy | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/funcTest/groovy/com/github/jengelman/gradle/plugins/shadow/util/PluginSpecification.groovy b/src/funcTest/groovy/com/github/jengelman/gradle/plugins/shadow/util/PluginSpecification.groovy index d6f2ae802..ac408ee9d 100644 --- a/src/funcTest/groovy/com/github/jengelman/gradle/plugins/shadow/util/PluginSpecification.groovy +++ b/src/funcTest/groovy/com/github/jengelman/gradle/plugins/shadow/util/PluginSpecification.groovy @@ -121,7 +121,7 @@ abstract class PluginSpecification extends Specification { } AppendableMavenPathRepository repo(String path = 'maven-repo') { - new AppendableMavenPathRepository(dir.resolve(path).toFile()) + new AppendableMavenPathRepository(dir.resolve(path)) } void assertJarFileContentsEqual(File f, String path, String contents) { diff --git a/src/funcTest/groovy/com/github/jengelman/gradle/plugins/shadow/util/repo/maven/MavenPathRepository.groovy b/src/funcTest/groovy/com/github/jengelman/gradle/plugins/shadow/util/repo/maven/MavenPathRepository.groovy index 7de383ac1..e3a1a5980 100644 --- a/src/funcTest/groovy/com/github/jengelman/gradle/plugins/shadow/util/repo/maven/MavenPathRepository.groovy +++ b/src/funcTest/groovy/com/github/jengelman/gradle/plugins/shadow/util/repo/maven/MavenPathRepository.groovy @@ -1,19 +1,21 @@ package com.github.jengelman.gradle.plugins.shadow.util.repo.maven +import java.nio.file.Path + /** * A fixture for dealing with file Maven repositories. */ class MavenPathRepository implements MavenRepository { - final File rootDir + final Path rootDir - MavenPathRepository(File rootDir) { + MavenPathRepository(Path rootDir) { this.rootDir = rootDir } @Override URI getUri() { - return rootDir.toURI() + return rootDir.toFile().toURI() } @Override