-
-
Notifications
You must be signed in to change notification settings - Fork 11.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
54 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,72 @@ | ||
plugins { | ||
id("com.android.library") | ||
id("com.vanniktech.maven.publish") | ||
id("maven-publish") | ||
kotlin("android") | ||
id("kotlin-parcelize") | ||
signing | ||
} | ||
|
||
setupCommon() | ||
|
||
android { | ||
defaultConfig { | ||
versionCode = findProperty("VERSION_CODE").toString().toInt() | ||
versionName = findProperty("VERSION_NAME").toString() | ||
versionCode = 10 | ||
versionName = "2.0.1" | ||
} | ||
|
||
lintOptions.informational("GradleDependency") | ||
} | ||
|
||
mavenPublish.targets.getByName("uploadArchives") { | ||
releaseRepositoryUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/" | ||
snapshotRepositoryUrl = "https://oss.sonatype.org/content/repositories/snapshots/" | ||
repositoryUsername = findProperty("NEXUS_USERNAME").toString() | ||
repositoryPassword = findProperty("NEXUS_PASSWORD").toString() | ||
afterEvaluate { | ||
publishing { | ||
publications { | ||
create<MavenPublication>("release") { | ||
from(components["release"]) | ||
|
||
groupId = "com.github.shadowsocks" | ||
artifactId = "plugin" | ||
version = android.defaultConfig.versionName | ||
|
||
pom { | ||
name.set("Shadowsocks Plugin") | ||
description.set("SIP003 plugin for Shadowsocks") | ||
url.set("http://www.example.com/library") | ||
licenses { | ||
license { | ||
name.set("The GNU General Public License v3.0") | ||
url.set("https://www.gnu.org/licenses/gpl-3.0.html") | ||
} | ||
} | ||
developers { | ||
developer { | ||
id.set("Mygod") | ||
name.set("Mygod Studio") | ||
email.set("[email protected]") | ||
} | ||
} | ||
scm { | ||
connection.set("scm:git:git://github.com/shadowsocks/shadowsocks-android.git") | ||
developerConnection.set("scm:git:git://github.com/shadowsocks/shadowsocks-android.git") | ||
url.set("https://github.com/shadowsocks/shadowsocks-android") | ||
} | ||
} | ||
} | ||
} | ||
repositories { | ||
maven { | ||
val releaseRepositoryUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/" | ||
val snapshotRepositoryUrl = "https://oss.sonatype.org/content/repositories/snapshots/" | ||
credentials { | ||
username = findProperty("NEXUS_USERNAME").toString() | ||
password = findProperty("NEXUS_PASSWORD").toString() | ||
} | ||
url = uri(if (version.toString().endsWith("SNAPSHOT")) snapshotRepositoryUrl else releaseRepositoryUrl) | ||
} | ||
} | ||
} | ||
signing { | ||
sign(publishing.publications["release"]) | ||
} | ||
} | ||
|
||
dependencies { | ||
|
This file was deleted.
Oops, something went wrong.