|
1 | 1 | plugins { |
2 | 2 | id("com.android.library") |
3 | | - id("com.vanniktech.maven.publish") |
| 3 | + id("maven-publish") |
4 | 4 | kotlin("android") |
5 | 5 | id("kotlin-parcelize") |
| 6 | + signing |
6 | 7 | } |
7 | 8 |
|
8 | 9 | setupCommon() |
9 | 10 |
|
10 | 11 | android { |
11 | 12 | defaultConfig { |
12 | | - versionCode = findProperty("VERSION_CODE").toString().toInt() |
13 | | - versionName = findProperty("VERSION_NAME").toString() |
| 13 | + versionCode = 10 |
| 14 | + versionName = "2.0.1" |
14 | 15 | } |
15 | 16 |
|
16 | 17 | lintOptions.informational("GradleDependency") |
17 | 18 | } |
18 | 19 |
|
19 | | -mavenPublish.targets.getByName("uploadArchives") { |
20 | | - releaseRepositoryUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/" |
21 | | - snapshotRepositoryUrl = "https://oss.sonatype.org/content/repositories/snapshots/" |
22 | | - repositoryUsername = findProperty("NEXUS_USERNAME").toString() |
23 | | - repositoryPassword = findProperty("NEXUS_PASSWORD").toString() |
| 20 | +afterEvaluate { |
| 21 | + publishing { |
| 22 | + publications { |
| 23 | + create<MavenPublication>("release") { |
| 24 | + from(components["release"]) |
| 25 | + |
| 26 | + groupId = "com.github.shadowsocks" |
| 27 | + artifactId = "plugin" |
| 28 | + version = android.defaultConfig.versionName |
| 29 | + |
| 30 | + pom { |
| 31 | + name.set("Shadowsocks Plugin") |
| 32 | + description.set("SIP003 plugin for Shadowsocks") |
| 33 | + url.set("http://www.example.com/library") |
| 34 | + licenses { |
| 35 | + license { |
| 36 | + name.set("The GNU General Public License v3.0") |
| 37 | + url.set("https://www.gnu.org/licenses/gpl-3.0.html") |
| 38 | + } |
| 39 | + } |
| 40 | + developers { |
| 41 | + developer { |
| 42 | + id.set("Mygod") |
| 43 | + name.set("Mygod Studio") |
| 44 | + |
| 45 | + } |
| 46 | + } |
| 47 | + scm { |
| 48 | + connection.set("scm:git:git://github.com/shadowsocks/shadowsocks-android.git") |
| 49 | + developerConnection.set("scm:git:git://github.com/shadowsocks/shadowsocks-android.git") |
| 50 | + url.set("https://github.com/shadowsocks/shadowsocks-android") |
| 51 | + } |
| 52 | + } |
| 53 | + } |
| 54 | + } |
| 55 | + repositories { |
| 56 | + maven { |
| 57 | + val releaseRepositoryUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/" |
| 58 | + val snapshotRepositoryUrl = "https://oss.sonatype.org/content/repositories/snapshots/" |
| 59 | + credentials { |
| 60 | + username = findProperty("NEXUS_USERNAME").toString() |
| 61 | + password = findProperty("NEXUS_PASSWORD").toString() |
| 62 | + } |
| 63 | + url = uri(if (version.toString().endsWith("SNAPSHOT")) snapshotRepositoryUrl else releaseRepositoryUrl) |
| 64 | + } |
| 65 | + } |
| 66 | + } |
| 67 | + signing { |
| 68 | + sign(publishing.publications["release"]) |
| 69 | + } |
24 | 70 | } |
25 | 71 |
|
26 | 72 | dependencies { |
|
0 commit comments