如何使用Gradle Workspace插件重命名bundle



好吧,我想重命名我的构建生成的捆绑包以指定其名称的版本,但是我所做的一切似乎都被忽略了,捆绑包每次都以项目文件夹名称为单位。

build.gradle文件

apply plugin: 'java'
repositories {
    mavenCentral()
}
dependencies {
    // https://mvnrepository.com/artifact/org.osgi/org.osgi.core
    compile group: 'org.osgi', name: 'org.osgi.core', version: '6.0.0'
}
task copyJar(type: Copy) {
    from('generated')
    include('*.jar')
    into("$rootDir/build/lib/bundles")
}
build.finalizedBy(copyJar)

gradle.properties

bundle_name=helloworld
bundle_version=5.1.2

据我了解,JAR任务使用Basename和版本属性,以及其他属性,如果没有指定任何指定带有项目文件夹名称的罐子文件

jar.baseName = "$bundle_name"
jar.version = "$bundle_version"

也使用BND Workspace插件,我认为它的覆盖方式超出了JAR任务的工作方式,但我不确定

这是父项目build.gradle

    //Applying the Gradle BND Plugin for Workspace Builds
    //https://github.com/bndtools/bnd/blob/master/biz.aQute.bnd.gradle/README.md
buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath "biz.aQute.bnd:biz.aQute.bnd.gradle:${bnd_version}"
    }
}
apply plugin: 'biz.aQute.bnd.workspace'
apply plugin: 'java'
    // Repositorios, aguante Maven Central.
/*
repositories {
    mavenCentral()
}
*/
clean {
    delete ("$rootDir/build/libs/bundles")
}

感谢您阅读

如果您使用的是BND Workspace插件,则必须通过项目的BND.BND文件控制BND。请参阅-outputmask指令以控制输出名称。

最新更新