-
Notifications
You must be signed in to change notification settings - Fork 403
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "Move FileExtensions into PluginSpecification"
This reverts commit e87fd0c.
- Loading branch information
Showing
3 changed files
with
27 additions
and
26 deletions.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
src/funcTest/groovy/com/github/jengelman/gradle/plugins/shadow/util/FileExtensions.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package com.github.jengelman.gradle.plugins.shadow.util | ||
|
||
/** | ||
* 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. | ||
*/ | ||
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: " + file | ||
+ ". Diagnostics: exists=" + file.exists() + ", isFile=" + file.isFile() + ", isDirectory=" + file.isDirectory()) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/funcTest/resources/META-INF/services/org.codehaus.groovy.runtime.ExtensionModule
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
moduleName = groovy-extensions | ||
moduleVersion = ${moduleVersion} | ||
extensionClasses =com.github.jengelman.gradle.plugins.shadow.util.PluginSpecification.FileExtensions | ||
extensionClasses =com.github.jengelman.gradle.plugins.shadow.util.FileExtensions |