Skip to content

Commit

Permalink
* [Android] Update gradle for jCenter publish. (apache#1905)
Browse files Browse the repository at this point in the history
Use the following command to publish to jCenter

    ./gradlew install -PbintrayUser=xxxx -PbintrayApiKey=yyyyy bintray

xxxx and yyyyy are the user name and key
  • Loading branch information
YorkShen authored Dec 13, 2018
1 parent 3c05ace commit 491cc95
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 12 deletions.
4 changes: 1 addition & 3 deletions android/commons/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ apply plugin: 'com.android.library'

android {

publishNonDefault true
compileSdkVersion project.compileSdkVersion
buildToolsVersion project.buildToolsVersion
resourcePrefix "weexcomm"
Expand Down Expand Up @@ -43,11 +42,10 @@ android {

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile project(':weex_sdk')
compile "com.android.support:support-v4:${project.supportLibVersion}"
compile "com.android.support:appcompat-v7:${project.supportLibVersion}"
// compile project(':weex_sdk')
debugCompile project(path: ':weex_sdk', configuration: 'debug')
releaseCompile project(path: ':weex_sdk', configuration: 'release')
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.facebook.fresco:fresco:0.10.0'
compile 'com.taobao.android.weex_inspection:protocol:1.1.4.1'
Expand Down
8 changes: 2 additions & 6 deletions android/playground/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,8 @@ dependencies {
androidTestCompile 'com.android.support.test.uiautomator:uiautomator-v18:2.1.2'
/*source dependency*/

debugCompile project(path: ':commons', configuration: 'debug')
releaseCompile project(path: ':commons', configuration: 'release')

debugCompile project(path: ':weex_sdk', configuration: 'debug')
releaseCompile project(path: ':weex_sdk', configuration: 'release')

compile project(':commons')
compile project(':weex_sdk')
//https://github.com/weexteam/weex-analyzer-android
//Weex-Analyzer provides several convenient tools such as Memory Monitor
// to optimize your application. It's not available by default,you can
Expand Down
68 changes: 65 additions & 3 deletions android/sdk/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,10 @@ checkstyle {
}


version = "0.20.0"
version = "0.20.0.1"

android {

publishNonDefault true
compileSdkVersion project.compileSdkVersion
buildToolsVersion project.buildToolsVersion
resourcePrefix "weex"
Expand Down Expand Up @@ -129,7 +128,7 @@ android {
multiDexEnabled true

versionCode 1
versionName "1.0"
versionName project.version
ndk {
abiFilters "armeabi-v7a","armeabi","x86"
}
Expand Down Expand Up @@ -283,3 +282,66 @@ task checkNdkVersion() {
}

preBuild.dependsOn checkNdkVersion

apply plugin: 'com.jfrog.bintray'
apply plugin: 'com.github.dcendents.android-maven'
def siteUrl = 'http://weex.incubator.apache.org'
def gitUrl = 'https://github.com/apache/incubator-weex.git'
group = "com.taobao.android"
install {
repositories.mavenInstaller {
// This generates POM.xml with proper parameters
pom {
project {
packaging 'aar'
name 'weex_sdk'
url siteUrl
licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id 'weex alibaba'
name 'weex alibaba'
email '[email protected]'
}
}
scm {
connection gitUrl
developerConnection gitUrl
url siteUrl
}
}
}
}
}

task sourcesJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
classifier = 'sources'
}

artifacts {
archives sourcesJar
}

bintray {
configurations = ['archives']
user = project.hasProperty('bintrayUser') ? project.property('bintrayUser') : System.getenv('BINTRAY_USER')
key = project.hasProperty('bintrayApiKey') ? project.property('bintrayApiKey') : System.getenv('BINTRAY_API_KEY')
pkg {
repo = "maven"
name = "weex_sdk"
websiteUrl = siteUrl
vcsUrl = gitUrl
licenses = ["Apache-2.0"]
publish = true
version {
//这里填写需要发布的版本号
name = project.version
}
}
}

0 comments on commit 491cc95

Please sign in to comment.