diff --git a/src/funcTest/groovy/com/github/jengelman/gradle/plugins/shadow/util/FileExtensions.groovy b/src/funcTest/groovy/com/github/jengelman/gradle/plugins/shadow/util/FileExtensions.groovy deleted file mode 100644 index 377a05ec4..000000000 --- a/src/funcTest/groovy/com/github/jengelman/gradle/plugins/shadow/util/FileExtensions.groovy +++ /dev/null @@ -1,22 +0,0 @@ -package com.github.jengelman.gradle.plugins.shadow.util - -final class FileExtensions { - static File resolve(File file, String relativePath) { - try { - return new File(file, relativePath) - } catch (RuntimeException e) { - throw new RuntimeException(String.format("Could not locate file '%s' relative to '%s'.", Arrays.toString(relativePath), file), e) - } - } - - static File createDir(File file) { - if (file.mkdirs()) { - return file - } - if (file.isDirectory()) { - return file - } - throw new AssertionError("Problems creating dir: " + this - + ". Diagnostics: exists=" + this.exists() + ", isFile=" + this.isFile() + ", isDirectory=" + this.isDirectory()) - } -} 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 ac408ee9d..8c98488db 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 @@ -186,4 +186,29 @@ abstract class PluginSpecification extends Specification { } return new File(gradleUserHome, "testkit") } + + /** + * TODO: this is used as extensions for Groovy, could be replaced after migrated to Kotlin. + * Registered in resources/META-INF/services/org.codehaus.groovy.runtime.ExtensionModule. + */ + static final class FileExtensions { + static final File resolve(File file, String relativePath) { + try { + return new File(file, relativePath) + } catch (RuntimeException e) { + throw new RuntimeException(String.format("Could not locate file '%s' relative to '%s'.", Arrays.toString(relativePath), file), e) + } + } + + static final File createDir(File file) { + if (file.mkdirs()) { + return file + } + if (file.isDirectory()) { + return file + } + throw new AssertionError("Problems creating dir: " + this + + ". Diagnostics: exists=" + file.exists() + ", isFile=" + file.isFile() + ", isDirectory=" + file.isDirectory()) + } + } } diff --git a/src/funcTest/resources/META-INF/services/org.codehaus.groovy.runtime.ExtensionModule b/src/funcTest/resources/META-INF/services/org.codehaus.groovy.runtime.ExtensionModule index bb7d5044f..cb99b3712 100644 --- a/src/funcTest/resources/META-INF/services/org.codehaus.groovy.runtime.ExtensionModule +++ b/src/funcTest/resources/META-INF/services/org.codehaus.groovy.runtime.ExtensionModule @@ -1,3 +1,3 @@ moduleName = groovy-extensions moduleVersion = ${moduleVersion} -extensionClasses =com.github.jengelman.gradle.plugins.shadow.util.FileExtensions +extensionClasses =com.github.jengelman.gradle.plugins.shadow.util.PluginSpecification.FileExtensions