diff options
Diffstat (limited to 'build.gradle')
-rw-r--r-- | build.gradle | 76 |
1 files changed, 40 insertions, 36 deletions
diff --git a/build.gradle b/build.gradle index 0e67ce83..ec26c104 100644 --- a/build.gradle +++ b/build.gradle @@ -31,10 +31,9 @@ buildscript { dependencies { classpath 'org.netbeans.tools:sigtest-maven-plugin:1.5' } } -plugins { id 'biz.aQute.bnd.builder' version '6.2.0' apply false } plugins { id 'com.github.sherter.google-java-format' version '0.9' apply false } -plugins { id 'me.champeau.jmh' version '0.6.6' apply false } -plugins { id 'org.sonarqube' version '3.3' apply false } +plugins { id 'me.champeau.jmh' version '0.6.8' apply false } +plugins { id 'org.sonarqube' version '3.5.0.2730' apply false } description = 'ASM, a very small and fast Java bytecode manipulation framework' @@ -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 @@ -96,8 +99,8 @@ project(':asm-commons') { project(':asm-test') { description = "Utilities for testing ${parent.description}" provides = ['org.objectweb.asm.test'] - depends = ['org.junit.jupiter:junit-jupiter-api:5.8.2', - 'org.junit.jupiter:junit-jupiter-params:5.8.2'] + depends = ['org.junit.jupiter:junit-jupiter-api:5.9.1', + 'org.junit.jupiter:junit-jupiter-params:5.9.1'] } project(':asm-tree') { @@ -110,7 +113,7 @@ project(':asm-util') { description = "Utilities for ${parent.description}" provides = ['org.objectweb.asm.util'] requires = [':asm', ':asm-tree', ':asm-analysis'] - dependencies { testImplementation 'org.codehaus.janino:janino:3.1.6' } + dependencies { testImplementation 'org.codehaus.janino:janino:3.1.9' } } // Use "gradle benchmarks:jmh [-PjmhInclude='<regex>']" to run the benchmarks. @@ -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 @@ -154,7 +157,7 @@ project(':benchmarks') { resultFormat = 'CSV' profilers = ['org.objectweb.asm.benchmarks.MemoryProfiler'] if (rootProject.hasProperty('jmhInclude')) { - include = [jmhInclude] + includes = [jmhInclude] } } } @@ -197,9 +200,9 @@ subprojects { dependencies { requires.each { projectName -> api project(projectName) } depends.each { artifactName -> api artifactName } - testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.2', - 'org.junit.jupiter:junit-jupiter-params:5.8.2' - testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.2' + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.1', + 'org.junit.jupiter:junit-jupiter-params:5.9.1' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.1' testImplementation project(':asm-test') } @@ -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. |