bintray-release定义额外产品(四)

文章摘要:
1、配置与标准工件一起上传的额外工件


系列文章:
bintray-release使用指南(一)
bintray-release配置publish闭包(二)
bintray-release自定义Publication(三)
bintray-release定义额外产品(四)
bintray-release添加对Maven Central同步的支持(五)

与自定义工件类似,您可以定义将与标准artifacts一起发布的其他artifacts。

import com.novoda.gradle.release.*

def fooJarPublish(String publicationName, Project project) {
    project.task(publicationName + 'FooJar', type: Jar) {
        classifier = 'foo'
        from sourceSets.main.output
    }
}

publish {
    ...
    dryRun = true

    publishing {
        publications {
            fooPublication(MavenPublication) {
                groupId project.publish.groupId
                artifactId project.publish.artifactId
                publishVersion project.publish.publishVersion

                Artifacts artifacts = new JavaArtifacts()
                (artifacts.all(it.name, project) + fooJarPublish(it.name, project)).each {
                    delegate.artifact it
                }
                from artifacts.from(project)
            }
        }
    }

    publications = ['fooPublication']
}

你可能感兴趣的:(bintray-release定义额外产品(四))