1 Star 0 Fork 10

邢飞/OhosExtension

forked from Ryan Zhu/OhosExtension 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
upload.gradle 1.51 KB
一键复制 编辑 原始数据 按行查看 历史
Ryan Zhu 提交于 2021-06-28 09:34 . 更新注释
apply plugin: 'maven'
apply plugin: 'maven-publish'
Properties properties = new Properties()
properties.load(project.rootProject.file('local.properties').newDataInputStream())
def REMOTE_MAVEN_RELEASE = properties.getProperty('REMOTE_MAVEN_RELEASE')
def REMOTE_MAVEN_SNAPSHOT = properties.getProperty('REMOTE_MAVEN_SNAPSHOT')
def MAVEN_USERNAME = properties.getProperty('MAVEN_USERNAME')
def MAVEN_PASSWORD = properties.getProperty('MAVEN_PASSWORD')
static def which(components, customArtifact) {
if (customArtifact.length() > 0) return null
if (components.findByName('release')) {
return components.release
} else {
return components.java
}
}
afterEvaluate { project ->
def customArtifact = rootProject.ext.CUSTOM_ARTIFACT
publishing {
publications {
mavenJava(MavenPublication) {
from which(components, customArtifact)
group = rootProject.ext.DEFAULT_GROUP_ID
artifactId = rootProject.ext.DEFAULT_ARTIFACT_ID
version = rootProject.ext.DEFAULT_VERSION
if (customArtifact.length() > 0) {
artifact customArtifact
}
}
}
repositories {
maven {
url = rootProject.ext.DEFAULT_VERSION.endsWith('SNAPSHOT') ? REMOTE_MAVEN_SNAPSHOT : REMOTE_MAVEN_RELEASE
credentials {
username MAVEN_USERNAME
password MAVEN_PASSWORD
}
}
}
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/xf695977/ohos-extension.git
git@gitee.com:xf695977/ohos-extension.git
xf695977
ohos-extension
OhosExtension
master

搜索帮助