8000 Remove biz aqute bnd gradle plugin · scala/scala-asm@cca53ae · GitHub
[go: up one dir, main page]

Skip to content

Commit cca53ae

Browse files
committed
Remove biz aqute bnd gradle plugin
1 parent 2ff73af commit cca53ae

File tree

1 file changed

+31
-27
lines changed

1 file changed

+31
-27
lines changed

build.gradle

Lines changed: 31 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ buildscript {
3131
dependencies { classpath 'org.netbeans.tools:sigtest-maven-plugin:1.5' }
3232
}
3333

34-
plugins { id 'biz.aQute.bnd.builder' version '6.4.0' apply false }
3534
plugins { id 'com.github.sherter.google-java-format' version '0.9' apply false }
3635
plugins { id 'me.champeau.jmh' version '0.6.8' apply false }
3736
plugins { id 'org.sonarqube' version '3.5.0.2730' apply false }
@@ -61,8 +60,12 @@ subprojects {
6160
ext.provides = [] // The provided java packages, e.g. ['org.objectweb.asm']
6261
ext.requires = [] // The required Gradle projects, e.g. [':asm-test']
6362
ext.transitiveRequires = { ->
64-
return requires.collect{p ->
65-
project(p).transitiveRequires().plus(project(p).provides[0])}.flatten()
63+
return requires.collect{project(it)}
64+
.collect{it.transitiveRequires().plus(it.provides[0])}.flatten() as Set
65+
}
66+
ext.transitiveImports = { ->
67+
return requires.collect{project(it)}
68+
.collect{it.transitiveImports().plus(it.provides)}.flatten() as Set
6669
}
6770
ext.depends = [] // The external dependencies, e.g. ['junit:junit:4.12']
6871
// Some external dependencies (such as Jacoco) depend transitively on ASM, and
@@ -136,7 +139,7 @@ project(':benchmarks') {
136139
dependencies.add("asm${version}", "org.ow2.asm:asm:${version}@jar")
137140
dependencies.add("asm${version}", "org.ow2.asm:asm-tree:${version}@jar")
138141
task "asm${version}"(type: Copy) {
139-
from configurations."asm${version}".collect { zipTree(it) }
142+
from configurations."asm${version}".collect{zipTree(it)}
140143
into "${buildDir}/asm${version}"
141144
duplicatesStrategy = DuplicatesStrategy.INCLUDE // module-info.class
142145
}
@@ -145,7 +148,7 @@ project(':benchmarks') {
145148
configurations.create('input-classes-java8')
146149
dependencies.add('input-classes-java8', 'io.vavr:vavr:0.10.0@jar')
147150
task copyInputClasses(type: Copy) {
148-
from configurations.'input-classes-java8'.collect { zipTree(it) }
151+
from configurations.'input-classes-java8'.collect{zipTree(it)}
149152
into "${buildDir}/input-classes-java8"
150153
}
151154
classes.dependsOn copyInputClasses
@@ -215,7 +218,7 @@ subprojects {
215218
// Configure the projects with a non-empty 'provides' property. They must be
216219
// checked for code coverage and backward compatibility, retrofited to Java 1.5,
217220
// and packaged with generated module-info classes.
218-
configure(subprojects.findAll { it.provides }) {
221+
configure(subprojects.findAll{it.provides}) {
219222
// Code coverage configuration.
220223
jacoco.toolVersion = '0.8.8'
221224
jacocoTestReport {
@@ -238,8 +241,9 @@ configure(subprojects.findAll { it.provides }) {
238241
def retrofitter =
239242
loader.loadClass('org.objectweb.asm.tools.Retrofitter').newInstance()
240243
def classes = sourceSets.main.output.classesDirs.singleFile
244+
def requires = transitiveRequires() as List
241245
retrofitter.retrofit(classes, "${version}")
242-
retrofitter.verify(classes, "${version}", provides, transitiveRequires())
246+
retrofitter.verify(classes, "${version}", provides, requires)
243247
}
244248
}
245249

@@ -281,31 +285,31 @@ configure(subprojects.findAll { it.provides }) {
281285
}
282286
}
283287

284-
// Apply the biz.aQute.bnd plugin to package the project as an OSGi bundle.
285-
// Exclude the asm-test project (the DefaultPackage class prevents it from
286-
// being a proper bundle).
288+
jar.manifest.attributes(
289+
'Implementation-Title': project.description,
290+
'Implementation-Version': "${version}")
291+
// Package the project as an OSGi bundle. Exclude the asm-test project (the
292+
// DefaultPackage class prevents it from being a proper bundle).
287293
if (name != 'asm-test') {
288-
apply plugin: 'biz.aQute.bnd.builder'
294+
def imports = transitiveImports()
289295
jar.manifest.attributes(
290-
'-classpath': sourceSets.main.output.classesDirs.asPath,
291-
'-removeheaders': 'Bnd-LastModified,Build-By,Created-By,Include-Resource,\
292-
Require-Capability,Tool',
293-
'Bundle-License': 'BSD-3-Clause;link=https://asm.ow2.io/LICENSE.txt',
294296
'Bundle-DocURL': 'http://asm.ow2.org',
297+
'Bundle-License': 'BSD-3-Clause;link=https://asm.ow2.io/LICENSE.txt',
298+
'Bundle-ManifestVersion': 2,
299+
'Bundle-Name': provides[0],
295300
'Bundle-RequiredExecutionEnvironment': 'J2SE-1.5',
296301
'Bundle-SymbolicName': provides[0],
297-
'Export-Package': provides.collect{"${it};version=${version}"}.join(','),
298-
'Implementation-Title': project.description,
299-
'Implementation-Version': "${version}",
300-
'Module-Requires':
301-
requires
302-
.collect{"${project(it).provides[0]};transitive=true"}
303-
.join(',')
304-
)
305-
} else {
306-
jar.manifest.attributes(
307-
'Implementation-Title': project.description,
308-
'Implementation-Version': "${version}")
302+
'Bundle-Version': "${version}",
303+
'Export-Package':
304+
provides.collect{"${it};version=\"${version}\""}.join(',') +
305+
(imports ? ";uses:=\"${imports.join(',')}\"" : ""))
306+
if (imports) {
307+
jar.manifest.attributes(
308+
'Import-Package':
309+
imports.collect{"${it};version=\"${version}\""}.join(','),
310+
'Module-Requires':
311+
transitiveRequires().collect{"${it};transitive=true"}.join(','))
312+
}
309313
}
310314

311315
// Apply the SonarQube plugin to monitor the code quality of the project.

0 commit comments

Comments
 (0)
0