-
-
Notifications
You must be signed in to change notification settings - Fork 808
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Another take at the Gradle build with Java 6/7 build-retention.
- Loading branch information
Showing
18 changed files
with
128 additions
and
112 deletions.
There are no files selected for viewing
File renamed without changes.
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
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,28 +1,58 @@ | ||
plugins { | ||
id 'java' | ||
id 'java-gradle-plugin' | ||
id 'com.gradle.plugin-publish' version '0.10.1' | ||
} | ||
|
||
def pom = new XmlSlurper().parse(file('./pom.xml')) | ||
def outerPom = new XmlSlurper().parse(file('../pom.xml')) | ||
apply from: './main.gradle' | ||
|
||
if (legacy) { | ||
throw new GradleException("Current JDK version only supports simple build (--build-file build.simple.gradle)"); | ||
} | ||
|
||
version = pom.parent.version.text().toString() | ||
|
||
dependencies { | ||
compile gradleApi() | ||
// At this point, it is not given that any artifact from the Maven build can be found in a repository. | ||
def location = new File(project.buildscript.sourceFile.getParentFile(), "../byte-buddy/target/byte-buddy-${version}.jar").canonicalFile | ||
logger.info("Relying on ${location.absolutePath} as Byte Buddy dependency") | ||
if (location.exists()) { | ||
compile files(location.absolutePath) | ||
} else { | ||
logger.warn("${location.absolutePath} does not exist, can clean but not build project") | ||
if (gradle.gradleVersion.startsWith("2.")) { // support legacy version | ||
dependencies { | ||
compile gradleApi() | ||
compile "net.bytebuddy:byte-buddy:${version}" | ||
testCompile gradleTestKit() | ||
testCompile group: 'junit', name: 'junit', version: outerPom.properties.'version.junit' | ||
testCompile(group: 'org.mockito', name: 'mockito-core', version: outerPom.properties.'version.mockito') { | ||
exclude group: 'net.bytebuddy' | ||
} | ||
} | ||
} else { | ||
dependencies { | ||
implementation gradleApi() | ||
implementation "net.bytebuddy:byte-buddy:${version}" | ||
testImplementation gradleTestKit() | ||
testImplementation group: 'junit', name: 'junit', version: outerPom.properties.'version.junit' | ||
testImplementation(group: 'org.mockito', name: 'mockito-core', version: outerPom.properties.'version.mockito') { | ||
exclude group: 'net.bytebuddy' | ||
} | ||
} | ||
testCompile gradleTestKit() | ||
testCompile group: 'junit', name: 'junit', version: outerPom.properties.'version.junit' | ||
testCompile(group: 'org.mockito', name: 'mockito-core', version: outerPom.properties.'version.mockito') { | ||
exclude group: 'net.bytebuddy' | ||
} | ||
|
||
configurations.all { | ||
resolutionStrategy.dependencySubstitution { | ||
substitute module("net.bytebuddy:byte-buddy:${version}") with project(":mavenBridge") | ||
} | ||
} | ||
|
||
apply from: './main.gradle' | ||
pluginBundle { | ||
website = 'https://bytebuddy.net' | ||
vcsUrl = 'https://github.com/raphw/byte-buddy' | ||
tags = ['Byte Buddy', 'bytecode', 'enhancement'] | ||
} | ||
|
||
gradlePlugin { | ||
plugins { | ||
byteBuddyPlugin { | ||
id = pom.parent.groupId.text().toString() + '.' + pom.artifactId.text().toString() | ||
displayName = pom.name.text().toString() | ||
description = pom.description.text().toString() | ||
implementationClass = 'net.bytebuddy.build.gradle.ByteBuddyPlugin' | ||
} | ||
} | ||
} |
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,42 @@ | ||
plugins { | ||
id 'java' | ||
id 'java-gradle-plugin' | ||
} | ||
|
||
apply from: './main.gradle' | ||
|
||
version = pom.parent.version.text().toString() | ||
|
||
// At this point, it is not given that any artifact from the Maven build can be found in a repository. | ||
def location = new File(project.buildscript.sourceFile.getParentFile(), "../byte-buddy/target/byte-buddy-${version}.jar").canonicalFile | ||
logger.info("Relying on ${location.absolutePath} as Byte Buddy dependency") | ||
|
||
if (gradle.gradleVersion.startsWith("2.")) { // support legacy version | ||
dependencies { | ||
compile gradleApi() | ||
if (location.exists()) { | ||
compile files(location.absolutePath) | ||
} else { | ||
logger.warn("${location.absolutePath} does not exist, can clean but not build project") | ||
} | ||
testCompile gradleTestKit() | ||
testCompile group: 'junit', name: 'junit', version: outerPom.properties.'version.junit' | ||
testCompile(group: 'org.mockito', name: 'mockito-core', version: outerPom.properties.'version.mockito') { | ||
exclude group: 'net.bytebuddy' | ||
} | ||
} | ||
} else { | ||
dependencies { | ||
implementation gradleApi() | ||
if (location.exists()) { | ||
implementation files(location.absolutePath) | ||
} else { | ||
logger.warn("${location.absolutePath} does not exist, can clean but not build project") | ||
} | ||
testImplementation gradleTestKit() | ||
testImplementation group: 'junit', name: 'junit', version: outerPom.properties.'version.junit' | ||
testImplementation(group: 'org.mockito', name: 'mockito-core', version: outerPom.properties.'version.mockito') { | ||
exclude group: 'net.bytebuddy' | ||
} | ||
} | ||
} |
Binary file renamed
BIN
+83.1 MB
...-plugin/gradle/5.4.1/gradle-5.4.1-bin.zip → ...-plugin/gradle/6.0.1/gradle-6.0.1-bin.zip
Binary file not shown.
File renamed without changes.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
version = pom.parent.version.toString() | ||
|
||
configurations { | ||
mavenBridge { | ||
canBeResolved = false | ||
canBeConsumed = true | ||
attributes { | ||
attribute(Usage.USAGE_ATTRIBUTE, objects.named(Usage, 'java-runtime')) | ||
} | ||
outgoing.artifact(objects.fileProperty().fileProvider(providers.provider { | ||
def file = rootProject.file("../byte-buddy/target/byte-buddy-${version}.jar") | ||
if (!file.exists()) { | ||
throw new GradleException("Cannot resolve ${version} of byte-buddy artifact what is required for a substitution") | ||
} | ||
file | ||
})) | ||
} | ||
} |
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 was deleted.
Oops, something went wrong.
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