-
-
Notifications
You must be signed in to change notification settings - Fork 811
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #790 from raphw/gradle-build-2
Use coordinate of current Byte Buddy build
- Loading branch information
Showing
24 changed files
with
198 additions
and
104 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
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 |
---|---|---|
@@ -1,6 +1,54 @@ | ||
plugins { | ||
id 'java' | ||
id 'java-gradle-plugin' | ||
id 'com.gradle.plugin-publish' version '0.10.1' | ||
} | ||
|
||
apply from: './main.gradle' | ||
apply from: './main.gradle' | ||
|
||
version = pom.parent.version.text().toString() | ||
|
||
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' | ||
} | ||
} | ||
} | ||
|
||
configurations.all { | ||
resolutionStrategy.dependencySubstitution { | ||
substitute module("net.bytebuddy:byte-buddy:${version}") with project(":mavenBridge") | ||
} | ||
} | ||
|
||
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 | ||
})) | ||
} | ||
} |
Oops, something went wrong.