diff --git a/bnd.bnd b/bnd.bnd new file mode 100644 index 00000000..765f7477 --- /dev/null +++ b/bnd.bnd @@ -0,0 +1,3 @@ +Import-Package: !org.fusesource.jansi, * +Export-Package: picocli +-fixupmessages "^Classes found in the wrong directory: \\{META-INF/versions/9/module-info\\.class=module-info}$" diff --git a/build.gradle b/build.gradle index 509d724d..0553e74b 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,7 @@ import java.nio.file.Files import java.nio.file.Paths +import aQute.bnd.gradle.Bundle +import aQute.bnd.gradle.Baseline group 'info.picocli' description 'Java command line parser with both an annotations API and a programmatic API. Usage help with ANSI styles and colors. Autocomplete. Nested subcommands. Easily included as source to avoid adding a dependency.' @@ -12,6 +14,7 @@ buildscript { maven { url "https://plugins.gradle.org/m2/" } + mavenCentral() } dependencies { @@ -19,6 +22,7 @@ buildscript { classpath 'org.asciidoctor:asciidoctorj-pdf:1.5.0-alpha.15' classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:$gradleBintrayPluginVersion" classpath "gradle.plugin.org.beryx:badass-jar:1.1.3" + classpath 'biz.aQute.bnd:biz.aQute.bnd.gradle:4.2.0' } } @@ -27,6 +31,7 @@ apply plugin: 'distribution' apply plugin: 'maven-publish' apply plugin: 'com.jfrog.bintray' apply plugin: "org.beryx.jar" +apply plugin: 'biz.aQute.bnd.builder' allprojects { @@ -358,6 +363,28 @@ publishing { } } } +apply plugin: 'java' + +configurations { + bundleCompile + baseline +} +dependencies { + baseline('group': group, 'name': jar.baseName, 'version': "(,${jar.version}[") { + force = true + transitive = false + } +} + +sourceSets { + bundle +} +task bundle(type: Bundle) { + from sourceSets.bundle.output + bndfile = 'bnd.bnd' + sourceSet = sourceSets.bundle +} + /* Release procedure: 1. edit version numbers: remove -SNAPSHOT classifier