Skip to content

Commit

Permalink
Refine plugin sign and upload
Browse files Browse the repository at this point in the history
  • Loading branch information
madeye committed Feb 21, 2019
1 parent d775978 commit 0a24802
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 137 deletions.
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ buildscript {
}

dependencies {
classpath 'com.vanniktech:gradle-maven-publish-plugin:0.8.0'
classpath 'com.android.tools.build:gradle:3.3.1'
classpath 'com.github.ben-manes:gradle-versions-plugin:0.20.0'
classpath 'com.google.gms:google-services:4.2.0'
Expand Down
28 changes: 24 additions & 4 deletions plugin/build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'com.vanniktech.maven.publish'

apply from: 'gradle-mvn-push.gradle'
@SuppressWarnings("GroovyUnusedDeclaration")
def getRepositoryUsername() {
return hasProperty('NEXUS_USERNAME') ? NEXUS_USERNAME : ""
}

@SuppressWarnings("GroovyUnusedDeclaration")
def getRepositoryPassword() {
return hasProperty('NEXUS_PASSWORD') ? NEXUS_PASSWORD : ""
}

android {
buildToolsVersion rootProject.buildToolsVersion
Expand All @@ -11,10 +20,10 @@ android {
defaultConfig {
minSdkVersion rootProject.minSdkVersion
targetSdkVersion rootProject.sdkVersion
versionCode 9
versionName "1.2.0"
versionCode Integer.parseInt(VERSION_CODE)
versionName VERSION_NAME

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
testInstrumentationRunner "androidx.testgetRepositoryPassword().runner.AndroidJUnitRunner"
}

buildTypes {
Expand All @@ -28,6 +37,17 @@ androidExtensions {
experimental = true
}

mavenPublish {
targets {
uploadArchives {
releaseRepositoryUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
snapshotRepositoryUrl = "https://oss.sonatype.org/content/repositories/snapshots/"
repositoryUsername = getRepositoryUsername()
repositoryPassword = getRepositoryPassword()
}
}
}

dependencies {
api "androidx.core:core-ktx:1.0.1"
api "com.google.android.material:material:1.1.0-alpha03"
Expand Down
133 changes: 0 additions & 133 deletions plugin/gradle-mvn-push.gradle

This file was deleted.

22 changes: 22 additions & 0 deletions plugin/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
GROUP=com.github.shadowsocks
VERSION_NAME=1.2.0
VERSION_CODE=9

POM_ARTIFACT_ID=plugin
POM_NAME=Shadowsocks Plugin
POM_PACKAGING=aar

POM_DESCRIPTION=SIP003 plugin for Shadowsocks
POM_INCEPTION_YEAR=2018

POM_URL=https://github.com/shadowsocks/shadowsocks-android
POM_SCM_URL=https://github.com/shadowsocks/shadowsocks-android
POM_SCM_CONNECTION=scm:git:git://github.com/shadowsocks/shadowsocks-android.git
POM_SCM_DEV_CONNECTION=scm:git:ssh://git@github.com/shadowsocks/shadowsocks-android.git

POM_LICENCE_NAME=The GNU General Public License v3.0
POM_LICENCE_URL=https://www.gnu.org/licenses/gpl-3.0.html
POM_LICENCE_DIST=repo

POM_DEVELOPER_ID=Mygod
POM_DEVELOPER_NAME=Mygod Studio

2 comments on commit 0a24802

@DearTanker
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

universal-4.7.1.apk
这个包大小比上个版本小了一倍多。

@pexcn
Copy link
Contributor

@pexcn pexcn commented on 0a24802 Feb 21, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

可能是因为替换掉了 overtrue 吧

Please sign in to comment.