Skip to content

Commit 857ced1

Browse files
committed
[tinker] Update publish script for supporting MavenCentral.
1 parent f390c30 commit 857ced1

File tree

21 files changed

+627
-440
lines changed

21 files changed

+627
-440
lines changed

build.gradle

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ buildscript {
99
dependencies {
1010
classpath 'com.android.tools.build:gradle:3.2.1'
1111
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.6'
12-
classpath "com.github.dcendents:android-maven-gradle-plugin:2.1"
1312
classpath "com.github.jengelman.gradle.plugins:shadow:4.0.4"
1413
}
1514
}
@@ -37,25 +36,18 @@ ext {
3736
javaVersion = JavaVersion.VERSION_1_7
3837

3938
GROUP = 'com.tencent.tinker'
40-
VERSION_NAME = "${VERSION_NAME_PREFIX}${VERSION_NAME_SUFFIX}"
39+
VERSION_NAME = '1.9.14.15'
4140

42-
POM_PACKAGING = "pom"
43-
POM_DESCRIPTION= "tinker"
41+
POM_DESCRIPTION = 'Tinker is a hot-fix solution library for Android, it supports dex, library and resources update without reinstalling apk.'
42+
POM_URL = 'https://github.com/Tencent/tinker'
43+
POM_SCM_URL = 'https://github.com/Tencent/tinker.git'
4444

45-
POM_URL = "https://github.com/Tencent/tinker"
46-
POM_SCM_URL = "https://github.com/Tencent/tinker.git"
47-
POM_ISSUE_URL = 'https://github.com/Tencent/tinker/issues'
48-
49-
POM_LICENCE_NAME = "BSD License"
50-
POM_LICENCE_URL = "https://opensource.org/licenses/BSD-3-Clause"
51-
POM_LICENCE_DIST = "repo"
52-
53-
POM_DEVELOPER_ID="Tencent Wechat"
54-
POM_DEVELOPER_NAME="Tencent Wechat, Inc."
55-
56-
BINTRAY_LICENCE= ['BSD 3-Clause']
57-
BINTRAY_ORGANIZATION = "tinker"
45+
POM_LICENCE_NAME = 'BSD License'
46+
POM_LICENCE_URL = 'https://opensource.org/licenses/BSD-3-Clause'
47+
POM_LICENCE_DIST = 'repo'
5848

49+
POM_DEVELOPER_ID = 'Tencent Wechat'
50+
POM_DEVELOPER_NAME = 'Tencent Wechat, Inc.'
5951
}
6052

6153
apply from: rootProject.file('gradle/check.gradle')

gradle.properties

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,5 @@
1616
# This option should only be used with decoupled projects. More details, visit
1717
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
1818
# org.gradle.parallel=true
19-
VERSION_NAME_PREFIX=1.9.14.15
20-
VERSION_NAME_SUFFIX=
2119

2220
android.useAndroidX=true

gradle/PublishArtifact.gradle

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
apply from: rootProject.file('gradle/WechatPublish.gradle')
2+
3+
def checkAndGetOption(name) {
4+
if (!project.hasProperty(name)) {
5+
throw new GradleException("Please specify '$name' option in gradle project properties.")
6+
}
7+
return project[name]
8+
}
9+
10+
wechatPublish {
11+
pom {
12+
name = checkAndGetOption('POM_NAME')
13+
description = checkAndGetOption('POM_DESCRIPTION')
14+
url = checkAndGetOption('POM_URL')
15+
16+
scm {
17+
url = checkAndGetOption('POM_SCM_URL')
18+
}
19+
20+
licenses {
21+
license {
22+
name = checkAndGetOption('POM_LICENCE_NAME')
23+
url = checkAndGetOption('POM_LICENCE_URL')
24+
}
25+
}
26+
27+
developers {
28+
developer {
29+
id = checkAndGetOption('POM_DEVELOPER_ID')
30+
name = checkAndGetOption('POM_DEVELOPER_NAME')
31+
}
32+
}
33+
}
34+
}

0 commit comments

Comments
 (0)