1 Star 0 Fork 0

yanmingsheng/script

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
publish-script.gradle 1.81 KB
一键复制 编辑 原始数据 按行查看 历史
shengyanming 提交于 2021-12-06 15:44 . first commit
apply plugin: 'maven-publish'
def getArtifactFilePath() {
return "$buildDir/outputs/aar/$maven_artifactId-$maven_version-${maven_build_type}.aar";
}
def getPublicationName() {
return maven_build_type;
}
publishing {
publications {
"${getPublicationName()}"(MavenPublication) {
groupId maven_groupId
artifactId maven_artifactId
version maven_version + "-" + maven_build_type + (maven_is_snapshot ? "-SNAPSHOT" : "")
artifact getArtifactFilePath()
// To include project dependencies
pom.withXml {
def dependencies = asNode().appendNode('dependencies')
configurations.getByName("${getPublicationName()}CompileClasspath").getResolvedConfiguration().getFirstLevelModuleDependencies().each {
def dependency = dependencies.appendNode('dependency')
dependency.appendNode('groupId', it.moduleGroup)
dependency.appendNode('artifactId', it.moduleName)
dependency.appendNode('version', it.moduleVersion)
}
asNode().appendNode("description", maven_description)
}
}
}
repositories {
maven {
if ("release".equals(maven_build_type)) {
url maven_releases_url
} else {
url maven_snapshots_url
}
credentials(HttpHeaderCredentials) {
name = "Private-Token"
if ("release".equals(maven_build_type)) {
value = maven_releases_gitLabAccessToken
} else {
value = maven_snapshots_gitLabAccessToken
}
}
authentication {
header(HttpHeaderAuthentication)
}
}
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/aa_25/script.git
git@gitee.com:aa_25/script.git
aa_25
script
script
master

搜索帮助