Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a workaround to resolve conflict from Gradle distribution and rem…
…oved testing option from TriremeNodeRunner.
- Loading branch information
Showing
4 changed files
with
59 additions
and
16 deletions.
There are no files selected for viewing
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,51 @@ | ||
import org.gradle.api.Project | ||
import org.gradle.api.file.FileTree | ||
import org.gradle.wrapper.Download | ||
import org.gradle.wrapper.Install | ||
import org.gradle.wrapper.Logger | ||
import org.gradle.wrapper.PathAssembler | ||
import org.gradle.wrapper.WrapperConfiguration | ||
|
||
/** | ||
* Based on a workaround reported by Abel Salgado Romero in https://issues.gradle.org/browse/GRADLE-1715 | ||
* and the codes in https://github.com/jruby-gradle/jruby-gradle-plugin. | ||
* | ||
* Include this in your project's buildSrc, then add a dependency to your project: | ||
* compile new GradleDist(project, '2.6').asFileTree | ||
* | ||
* Code courtesy of @ajoberstar | ||
*/ | ||
class GradleDist { | ||
private final Project project | ||
final String version | ||
|
||
GradleDist(Project project, String version) { | ||
this.project = project | ||
this.version = version | ||
} | ||
|
||
String getPath() { | ||
// We use 'all' distribution in this project, so we should specify not 'bin' but 'all'. | ||
return "https://services.gradle.org/distributions/gradle-${version}-all.zip" | ||
} | ||
|
||
File getAsFile() { | ||
return project.file(getPath()) | ||
} | ||
|
||
URI getAsURI() { | ||
return project.uri(getPath()) | ||
} | ||
|
||
FileTree getAsFileTree() { | ||
Logger logger = new Logger(true) | ||
Install install = new Install(logger, new Download(logger, 'gradle', ''), new PathAssembler(project.gradle.gradleUserHomeDir)) | ||
WrapperConfiguration config = new WrapperConfiguration() | ||
config.distribution = getAsURI() | ||
File file = install.createDist(config) | ||
// We just want JARs under 'lib' and 'lib/plugin', so replace 'file' for 'dir:' in the original source | ||
// with new File(file, 'lib'). | ||
// Also, we should add 'excludes' parameter to exclude conflicting dependency. | ||
project.fileTree(dir: new File(file, 'lib'), excludes: ['**/rhino-*.jar'], includes: ['**/*.jar']) | ||
} | ||
} |
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
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
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