summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Bruneton <ebruneton@free.fr>2023-01-14 10:23:21 +0000
committerEric Bruneton <ebruneton@free.fr>2023-01-14 10:23:21 +0000
commitcca53aebe8f599f99cf940bfa92853ae482e78e0 (patch)
treefb36186e16714f86a287e46cb3fcb6811a9552dd
parent2ff73afb93655c757fc768f2ed7fda8c9fcc83e7 (diff)
downloadow2-asm-cca53aebe8f599f99cf940bfa92853ae482e78e0.tar.gz
Remove biz aqute bnd gradle plugin
-rw-r--r--build.gradle58
1 files changed, 31 insertions, 27 deletions
diff --git a/build.gradle b/build.gradle
index d76742bb..ec26c104 100644
--- a/build.gradle
+++ b/build.gradle
@@ -31,7 +31,6 @@ buildscript {
dependencies { classpath 'org.netbeans.tools:sigtest-maven-plugin:1.5' }
}
-plugins { id 'biz.aQute.bnd.builder' version '6.4.0' apply false }
plugins { id 'com.github.sherter.google-java-format' version '0.9' apply false }
plugins { id 'me.champeau.jmh' version '0.6.8' apply false }
plugins { id 'org.sonarqube' version '3.5.0.2730' apply false }
@@ -61,8 +60,12 @@ subprojects {
ext.provides = [] // The provided java packages, e.g. ['org.objectweb.asm']
ext.requires = [] // The required Gradle projects, e.g. [':asm-test']
ext.transitiveRequires = { ->
- return requires.collect{p ->
- project(p).transitiveRequires().plus(project(p).provides[0])}.flatten()
+ return requires.collect{project(it)}
+ .collect{it.transitiveRequires().plus(it.provides[0])}.flatten() as Set
+ }
+ ext.transitiveImports = { ->
+ return requires.collect{project(it)}
+ .collect{it.transitiveImports().plus(it.provides)}.flatten() as Set
}
ext.depends = [] // The external dependencies, e.g. ['junit:junit:4.12']
// Some external dependencies (such as Jacoco) depend transitively on ASM, and
@@ -136,7 +139,7 @@ project(':benchmarks') {
dependencies.add("asm${version}", "org.ow2.asm:asm:${version}@jar")
dependencies.add("asm${version}", "org.ow2.asm:asm-tree:${version}@jar")
task "asm${version}"(type: Copy) {
- from configurations."asm${version}".collect { zipTree(it) }
+ from configurations."asm${version}".collect{zipTree(it)}
into "${buildDir}/asm${version}"
duplicatesStrategy = DuplicatesStrategy.INCLUDE // module-info.class
}
@@ -145,7 +148,7 @@ project(':benchmarks') {
configurations.create('input-classes-java8')
dependencies.add('input-classes-java8', 'io.vavr:vavr:0.10.0@jar')
task copyInputClasses(type: Copy) {
- from configurations.'input-classes-java8'.collect { zipTree(it) }
+ from configurations.'input-classes-java8'.collect{zipTree(it)}
into "${buildDir}/input-classes-java8"
}
classes.dependsOn copyInputClasses
@@ -215,7 +218,7 @@ subprojects {
// Configure the projects with a non-empty 'provides' property. They must be
// checked for code coverage and backward compatibility, retrofited to Java 1.5,
// and packaged with generated module-info classes.
-configure(subprojects.findAll { it.provides }) {
+configure(subprojects.findAll{it.provides}) {
// Code coverage configuration.
jacoco.toolVersion = '0.8.8'
jacocoTestReport {
@@ -238,8 +241,9 @@ configure(subprojects.findAll { it.provides }) {
def retrofitter =
loader.loadClass('org.objectweb.asm.tools.Retrofitter').newInstance()
def classes = sourceSets.main.output.classesDirs.singleFile
+ def requires = transitiveRequires() as List
retrofitter.retrofit(classes, "${version}")
- retrofitter.verify(classes, "${version}", provides, transitiveRequires())
+ retrofitter.verify(classes, "${version}", provides, requires)
}
}
@@ -281,31 +285,31 @@ configure(subprojects.findAll { it.provides }) {
}
}
- // Apply the biz.aQute.bnd plugin to package the project as an OSGi bundle.
- // Exclude the asm-test project (the DefaultPackage class prevents it from
- // being a proper bundle).
+ jar.manifest.attributes(
+ 'Implementation-Title': project.description,
+ 'Implementation-Version': "${version}")
+ // Package the project as an OSGi bundle. Exclude the asm-test project (the
+ // DefaultPackage class prevents it from being a proper bundle).
if (name != 'asm-test') {
- apply plugin: 'biz.aQute.bnd.builder'
+ def imports = transitiveImports()
jar.manifest.attributes(
- '-classpath': sourceSets.main.output.classesDirs.asPath,
- '-removeheaders': 'Bnd-LastModified,Build-By,Created-By,Include-Resource,\
- Require-Capability,Tool',
- 'Bundle-License': 'BSD-3-Clause;link=https://asm.ow2.io/LICENSE.txt',
'Bundle-DocURL': 'http://asm.ow2.org',
+ 'Bundle-License': 'BSD-3-Clause;link=https://asm.ow2.io/LICENSE.txt',
+ 'Bundle-ManifestVersion': 2,
+ 'Bundle-Name': provides[0],
'Bundle-RequiredExecutionEnvironment': 'J2SE-1.5',
'Bundle-SymbolicName': provides[0],
- 'Export-Package': provides.collect{"${it};version=${version}"}.join(','),
- 'Implementation-Title': project.description,
- 'Implementation-Version': "${version}",
- 'Module-Requires':
- requires
- .collect{"${project(it).provides[0]};transitive=true"}
- .join(',')
- )
- } else {
- jar.manifest.attributes(
- 'Implementation-Title': project.description,
- 'Implementation-Version': "${version}")
+ 'Bundle-Version': "${version}",
+ 'Export-Package':
+ provides.collect{"${it};version=\"${version}\""}.join(',') +
+ (imports ? ";uses:=\"${imports.join(',')}\"" : ""))
+ if (imports) {
+ jar.manifest.attributes(
+ 'Import-Package':
+ imports.collect{"${it};version=\"${version}\""}.join(','),
+ 'Module-Requires':
+ transitiveRequires().collect{"${it};transitive=true"}.join(','))
+ }
}
// Apply the SonarQube plugin to monitor the code quality of the project.