Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make build more portable #751

Closed
remkop opened this issue Jun 26, 2019 · 0 comments
Closed

Make build more portable #751

remkop opened this issue Jun 26, 2019 · 0 comments

Comments

@remkop
Copy link
Owner

remkop commented Jun 26, 2019

Allow build to run even when biz.aQute.bnd.builder plugin is not available.

if (System.getenv('BINTRAY_USER')) {
    apply plugin: 'biz.aQute.bnd.builder'
} else {
    try { // only apply if available
        Class.forName('aQute.bnd.gradle.BndPlugin');
        Class.forName('aQute.bnd.build.Project');
        apply plugin: 'biz.aQute.bnd.builder'
    } catch (Throwable ignored) {}
}
pluginManager.withPlugin('biz.aQute.bnd.builder') {
    apply plugin: 'biz.aQute.bnd.builder'
    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
    }
}
@remkop remkop added this to the 4.0 milestone Jun 26, 2019
@remkop remkop closed this as completed in 783061f Jun 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant