Commit f0f55437 by konghaorui

修改组件版本定义方式

parent e713208c
IS_PUBLISH=true
VERSION_NAME=0.0.11
\ No newline at end of file
...@@ -88,7 +88,7 @@ dependencies { ...@@ -88,7 +88,7 @@ dependencies {
}else { }else {
//发布时使用 //发布时使用
api rootProject.ext.dependencies["ydl-media"] api rootProject.ext.dependencies["ydl-media"]
api(rootProject.ext.dependencies["ydl-audioim"]){ api(rootProject.ext.dependencies["m-audioim"]){
transitive = true transitive = true
} }
api(rootProject.ext.dependencies["ydl-platform"]) { api(rootProject.ext.dependencies["ydl-platform"]) {
......
...@@ -8,7 +8,7 @@ modular { ...@@ -8,7 +8,7 @@ modular {
groupId = "com.ydl" groupId = "com.ydl"
artifactId = "m-confide-module-xlzx" artifactId = "m-confide-module-xlzx"
// 上报的业务模块 aar 包的版本号 // 上报的业务模块 aar 包的版本号
version = "0.0.12" version = rootProject.ext.ydlPublishVersion[childProject.getName()]
} }
ydl{ ydl{
...@@ -16,7 +16,7 @@ modular { ...@@ -16,7 +16,7 @@ modular {
groupId = "com.ydl" groupId = "com.ydl"
artifactId = "m-confide-module-ydl" artifactId = "m-confide-module-ydl"
// 上报的业务模块 aar 包的版本号 // 上报的业务模块 aar 包的版本号
version = "0.0.12" version = rootProject.ext.ydlPublishVersion[childProject.getName()]
} }
} }
...@@ -24,7 +24,7 @@ modular { ...@@ -24,7 +24,7 @@ modular {
//发布信息 module/api 通用 //发布信息 module/api 通用
groupId = "com.ydl" groupId = "com.ydl"
artifactId = "m-confide-api" artifactId = "m-confide-api"
// version = "0.0.1" version = rootProject.ext.ydlPublishVersion["${childProject.getName()}-api"]
// API 层打包时需要引入的依赖 // API 层打包时需要引入的依赖
apiDependencies { apiDependencies {
implementation "com.google.code.gson:gson:2.8.2" implementation "com.google.code.gson:gson:2.8.2"
......
...@@ -8,14 +8,14 @@ modular { ...@@ -8,14 +8,14 @@ modular {
groupId = "com.ydl" groupId = "com.ydl"
artifactId = "m-consultant-module-xlzx" artifactId = "m-consultant-module-xlzx"
// 上报的 心理咨询 业务模块 aar 包的版本号 // 上报的 心理咨询 业务模块 aar 包的版本号
version = "0.0.15" version = rootProject.ext.ydlPublishVersion[childProject.getName()]
} }
ydl{ ydl{
groupId = "com.ydl" groupId = "com.ydl"
artifactId = "m-consultant-module-ydl" artifactId = "m-consultant-module-ydl"
// 上报的 壹点灵 业务模块 aar 包的版本号 // 上报的 壹点灵 业务模块 aar 包的版本号
version = "0.0.19" version = rootProject.ext.ydlPublishVersion[childProject.getName()]
} }
} }
...@@ -24,7 +24,7 @@ modular { ...@@ -24,7 +24,7 @@ modular {
groupId = "com.ydl" groupId = "com.ydl"
artifactId = "m-consultant-api" artifactId = "m-consultant-api"
//开发时注释掉版本号,发布api时打开 //开发时注释掉版本号,发布api时打开
version = "0.0.3" version = rootProject.ext.ydlPublishVersion[childProject.getName()+"-api"]
// API 层打包时需要引入的依赖 // API 层打包时需要引入的依赖
apiDependencies { apiDependencies {
implementation "com.google.code.gson:gson:2.8.2" implementation "com.google.code.gson:gson:2.8.2"
......
...@@ -8,14 +8,14 @@ modular { ...@@ -8,14 +8,14 @@ modular {
groupId = "com.ydl" groupId = "com.ydl"
artifactId = "m-course-module-xlzx" artifactId = "m-course-module-xlzx"
// 上报的 心理咨询 业务模块 aar 包的版本号 // 上报的 心理咨询 业务模块 aar 包的版本号
version = "0.0.1" version = rootProject.ext.ydlPublishVersion[childProject.getName()]
} }
ydl{ ydl{
groupId = "com.ydl" groupId = "com.ydl"
artifactId = "m-course-module-ydl" artifactId = "m-course-module-ydl"
// 上报的 壹点灵 业务模块 aar 包的版本号 // 上报的 壹点灵 业务模块 aar 包的版本号
version = "0.0.1" version = rootProject.ext.ydlPublishVersion[childProject.getName()]
} }
} }
...@@ -24,7 +24,7 @@ modular { ...@@ -24,7 +24,7 @@ modular {
groupId = "com.ydl" groupId = "com.ydl"
artifactId = "m-course-api" artifactId = "m-course-api"
//开发时注释掉版本号,发布api时打开 //开发时注释掉版本号,发布api时打开
version = "0.0.1" version = rootProject.ext.ydlPublishVersion[childProject.getName()+"-api"]
// API 层打包时需要引入的依赖 // API 层打包时需要引入的依赖
apiDependencies { apiDependencies {
implementation "com.google.code.gson:gson:2.8.2" implementation "com.google.code.gson:gson:2.8.2"
......
...@@ -8,14 +8,14 @@ modular { ...@@ -8,14 +8,14 @@ modular {
groupId = "com.ydl" groupId = "com.ydl"
artifactId = "m-fm-module-xlzx" artifactId = "m-fm-module-xlzx"
// 上报的 心理咨询 业务模块 aar 包的版本号 // 上报的 心理咨询 业务模块 aar 包的版本号
version = "0.0.8" version = rootProject.ext.ydlPublishVersion[childProject.getName()]
} }
ydl{ ydl{
groupId = "com.ydl" groupId = "com.ydl"
artifactId = "m-fm-module-ydl" artifactId = "m-fm-module-ydl"
// 上报的 壹点灵 业务模块 aar 包的版本号 // 上报的 壹点灵 业务模块 aar 包的版本号
version = "0.0.8" version = rootProject.ext.ydlPublishVersion[childProject.getName()]
} }
} }
...@@ -24,7 +24,7 @@ modular { ...@@ -24,7 +24,7 @@ modular {
groupId = "com.ydl" groupId = "com.ydl"
artifactId = "m-fm-api" artifactId = "m-fm-api"
//开发时注释掉版本号,发布api时打开 //开发时注释掉版本号,发布api时打开
version = "0.0.2" version = rootProject.ext.ydlPublishVersion[childProject.getName()+"-api"]
// API 层打包时需要引入的依赖 // API 层打包时需要引入的依赖
apiDependencies { apiDependencies {
implementation "com.google.code.gson:gson:2.8.2" implementation "com.google.code.gson:gson:2.8.2"
......
...@@ -8,14 +8,14 @@ modular { ...@@ -8,14 +8,14 @@ modular {
groupId = "com.ydl" groupId = "com.ydl"
artifactId = "m-muse-module-xlzx" artifactId = "m-muse-module-xlzx"
// 上报的 心理咨询 业务模块 aar 包的版本号 // 上报的 心理咨询 业务模块 aar 包的版本号
version = "0.0.5" version = rootProject.ext.ydlPublishVersion[childProject.getName()]
} }
ydl{ ydl{
groupId = "com.ydl" groupId = "com.ydl"
artifactId = "m-muse-module-ydl" artifactId = "m-muse-module-ydl"
// 上报的 壹点灵 业务模块 aar 包的版本号 // 上报的 壹点灵 业务模块 aar 包的版本号
version = "0.0.5" version = rootProject.ext.ydlPublishVersion[childProject.getName()]
} }
} }
...@@ -24,7 +24,7 @@ modular { ...@@ -24,7 +24,7 @@ modular {
groupId = "com.ydl" groupId = "com.ydl"
artifactId = "m-muse-api" artifactId = "m-muse-api"
//开发时注释掉版本号,发布api时打开 //开发时注释掉版本号,发布api时打开
//version = "0.0.1" //version = rootProject.ext.ydlPublishVersion[childProject.getName()+"-api"]
// API 层打包时需要引入的依赖 // API 层打包时需要引入的依赖
apiDependencies { apiDependencies {
implementation "com.google.code.gson:gson:2.8.2" implementation "com.google.code.gson:gson:2.8.2"
......
...@@ -8,14 +8,14 @@ modular { ...@@ -8,14 +8,14 @@ modular {
groupId = "com.ydl" groupId = "com.ydl"
artifactId = "m-tests-module-xlzx" artifactId = "m-tests-module-xlzx"
// 上报的 心理咨询 业务模块 aar 包的版本号 // 上报的 心理咨询 业务模块 aar 包的版本号
version = "0.0.2" version = rootProject.ext.ydlPublishVersion[childProject.getName()]
} }
ydl{ ydl{
groupId = "com.ydl" groupId = "com.ydl"
artifactId = "m-tests-module-ydl" artifactId = "m-tests-module-ydl"
// 上报的 壹点灵 业务模块 aar 包的版本号 // 上报的 壹点灵 业务模块 aar 包的版本号
version = "0.0.2" version = rootProject.ext.ydlPublishVersion[childProject.getName()]
} }
} }
...@@ -24,7 +24,7 @@ modular { ...@@ -24,7 +24,7 @@ modular {
groupId = "com.ydl" groupId = "com.ydl"
artifactId = "m-tests-api" artifactId = "m-tests-api"
//开发时注释掉版本号,发布api时打开 //开发时注释掉版本号,发布api时打开
version = "0.0.1" version = rootProject.ext.ydlPublishVersion[childProject.getName()+"-api"]
// API 层打包时需要引入的依赖 // API 层打包时需要引入的依赖
apiDependencies { apiDependencies {
implementation "com.google.code.gson:gson:2.8.2" implementation "com.google.code.gson:gson:2.8.2"
......
...@@ -8,14 +8,14 @@ modular { ...@@ -8,14 +8,14 @@ modular {
groupId = "com.ydl" groupId = "com.ydl"
artifactId = "m-user-module-xlzx" artifactId = "m-user-module-xlzx"
// 上报的 心理咨询 业务模块 aar 包的版本号 // 上报的 心理咨询 业务模块 aar 包的版本号
version = "0.0.22" version = rootProject.ext.ydlPublishVersion[childProject.getName()]
} }
ydl{ ydl{
groupId = "com.ydl" groupId = "com.ydl"
artifactId = "m-user-module-ydl" artifactId = "m-user-module-ydl"
// 上报的 壹点灵 业务模块 aar 包的版本号 // 上报的 壹点灵 业务模块 aar 包的版本号
version = "0.0.22" version = rootProject.ext.ydlPublishVersion[childProject.getName()]
} }
} }
...@@ -24,7 +24,7 @@ modular { ...@@ -24,7 +24,7 @@ modular {
groupId = "com.ydl" groupId = "com.ydl"
artifactId = "m-user-api" artifactId = "m-user-api"
//开发时注释掉版本号,发布api时打开 //开发时注释掉版本号,发布api时打开
// version = "0.0.5" version = rootProject.ext.ydlPublishVersion[childProject.getName()+"-api"]
// API 层打包时需要引入的依赖 // API 层打包时需要引入的依赖
apiDependencies { apiDependencies {
implementation "com.google.code.gson:gson:2.8.2" implementation "com.google.code.gson:gson:2.8.2"
......
apply plugin: 'maven' apply plugin: 'maven'
def mavenRepositoryUrl def mavenRepositoryUrl = "http://nexus.yidianling.com/repository/AndroidReleases/"
if (isReleaseBuild()) { def getVersionName() {
println 'RELEASE BUILD' return hasProperty('VERSION_NAME') ? VERSION_NAME : rootProject.ext.ydlPublishVersion[project.getName()]
mavenRepositoryUrl = "http://nexus.yidianling.com/repository/AndroidReleases/"
} else {
println 'SNAPSHOTS BUILD'
mavenRepositoryUrl = "http://nexus.yidianling.com/repository/AndroidSnapshots/"
}
def getRepositoryUsername() {
return hasProperty('NEXUS_USERNAME') ? NEXUS_USERNAME : "admin"
}
def getRepositoryPassword() {
return hasProperty('NEXUS_PASSWORD') ? NEXUS_PASSWORD : "fjoi#1+#@"
}
def isReleaseBuild() {
return IS_PUBLISH.toBoolean();
} }
afterEvaluate { project -> afterEvaluate { project ->
...@@ -28,9 +12,9 @@ afterEvaluate { project -> ...@@ -28,9 +12,9 @@ afterEvaluate { project ->
mavenDeployer { mavenDeployer {
pom.artifactId = project.getName().replace('_', "-") pom.artifactId = project.getName().replace('_', "-")
pom.groupId = "com.ydl" pom.groupId = "com.ydl"
pom.version = isReleaseBuild() ? VERSION_NAME : VERSION_NAME + "-SNAPSHOT" pom.version = getVersionName()
repository(url: mavenRepositoryUrl) { repository(url: mavenRepositoryUrl) {
authentication(userName: getRepositoryUsername(), password: getRepositoryPassword()) authentication(userName: "admin", password: "fjoi#1+#@")
} }
} }
} }
...@@ -40,9 +24,9 @@ afterEvaluate { project -> ...@@ -40,9 +24,9 @@ afterEvaluate { project ->
// log // log
println String.format(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n>>>>> [%s] 正在将[%s]版本的[%s]包上传到Maven的[%s]仓库 >>>>>\n>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" println String.format(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n>>>>> [%s] 正在将[%s]版本的[%s]包上传到Maven的[%s]仓库 >>>>>\n>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
, project.getName() , project.getName()
, VERSION_NAME , getVersionName()
, "aar" , "aar"
, IS_PUBLISH.toBoolean() ? "release" : "snapshot" , "release"
) )
} }
} }
\ No newline at end of file
IS_PUBLISH=true
VERSION_NAME=0.0.2
\ No newline at end of file
IS_PUBLISH=true
VERSION_NAME=0.0.8
\ No newline at end of file
IS_PUBLISH=true
VERSION_NAME=0.0.1
\ No newline at end of file
IS_PUBLISH=true
VERSION_NAME=0.0.3
\ No newline at end of file
IS_PUBLISH=true
VERSION_NAME=0.0.19
\ No newline at end of file
IS_PUBLISH=true
VERSION_NAME=0.0.2
\ No newline at end of file
IS_PUBLISH=true
VERSION_NAME=0.0.19
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment