1 Star 0 Fork 5

爱古策月/WMRouter

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
gradle_mvn_push.gradle 2.65 KB
一键复制 编辑 原始数据 按行查看 历史
zjiecode 提交于 2021-06-07 20:09 . 添加签名
apply plugin: 'maven'
apply plugin: 'signing'
version = VERSION_NAME
group = GROUP
def getPropertyFromLocalProperties(key) {
File file = project.rootProject.file('local.properties');
//兼容WmPlugin的发布
if(!file.exists()){
file = project.rootProject.file('../local.properties');
}
if (file.exists()) {
Properties properties = new Properties()
properties.load(file.newDataInputStream())
return properties.getProperty(key)
}
}
uploadArchives {
repositories {
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
def user = getPropertyFromLocalProperties("NEXUS_USERNAME")
def password = getPropertyFromLocalProperties("NEXUS_PASSWORD")
repository(url: "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/") {
authentication(userName: user, password: password)
}
snapshotRepository(url: "https://s01.oss.sonatype.org/content/repositories/snapshots/") {
authentication(userName: user, password: password)
}
pom.project {
name POM_NAME
packaging POM_PACKAGING
description POM_DESCRIPTION
url POM_URL
scm {
connection POM_SCM_URL
developerConnection POM_SCM_CONNECTION
url POM_URL
}
licenses {
license {
name POM_LICENCE_NAME
url POM_LICENCE_URL
distribution POM_LICENCE_DIST
}
}
developers {
developer {
id POM_DEVELOPER_ID
name POM_DEVELOPER_NAME
}
}
}
}
}
}
afterEvaluate { project ->
if (project.getPlugins().hasPlugin('com.android.application') ||
project.getPlugins().hasPlugin('com.android.library')) {
task androidSourcesJar(type: Jar) {
classifier = 'sources'
from android.sourceSets.main.java.source
}
artifacts {
archives androidSourcesJar
}
} else {
task javadocJar(type: Jar) {
classifier = 'javadoc'
from javadoc
}
task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allSource
}
artifacts {
archives javadocJar, sourcesJar
}
}
}
signing {
sign configurations.archives
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/iguce-month/WMRouter.git
git@gitee.com:iguce-month/WMRouter.git
iguce-month
WMRouter
WMRouter
master

搜索帮助

23e8dbc6 1850385 7e0993f3 1850385