Skip to content

Commit

Permalink
feat(android): add bintray jcenter upload support
Browse files Browse the repository at this point in the history
  • Loading branch information
siguangli2018 authored and xuqingkuang committed Mar 18, 2020
1 parent 24a047f commit cd5c64e
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 22 deletions.
50 changes: 37 additions & 13 deletions android/sdk/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
apply plugin: 'com.android.library'
apply plugin: 'com.novoda.bintray-release'

ext {
def flag = System.getenv('CI')
Expand Down Expand Up @@ -81,7 +82,6 @@ task copyCore(dependsOn: deleteCore, type: Copy) {
}

task compileCmake(dependsOn: copyCore, type: Exec) {

def cMakeWorkDir = file(project.buildDir.absolutePath + "/cmakeoutput")
cMakeWorkDir.deleteDir()
cMakeWorkDir.mkdirs()
Expand Down Expand Up @@ -260,7 +260,7 @@ task buildNdkLibs(dependsOn: (ISCI.toBoolean() ? dealNdkLibSymbols : stripSO)) {

android {
compileSdkVersion 28
buildToolsVersion '26.0.2'
buildToolsVersion '28.0.3'
defaultConfig {
minSdkVersion 14
targetSdkVersion 28
Expand All @@ -285,6 +285,10 @@ android {
jniLibs.srcDirs = ["$buildDir/jnilibs", 'libs']
}

tasks.withType(Javadoc).all {
enabled false
}

tasks.withType(JavaCompile) {
compileTask -> compileTask.dependsOn buildNdkLibs
}
Expand All @@ -296,8 +300,8 @@ android {
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
provided project(path:':support_ui')
api fileTree(dir: 'libs', include: ['*.jar'])
compileOnly project(path:':support_ui')
}

afterEvaluate {
Expand Down Expand Up @@ -325,15 +329,15 @@ def dealAfterBuild(variant) {
}
}

project.tasks['bundleRelease'].finalizedBy task("dealAfterBuild${variant.name.capitalize()}") {
doLast {
unZipAar(aarFile)
buildQBAar(aarFile)
if (ISCI.toBoolean()) {
copyMappingToBin(FLAVOR, BUILD_TYPE)
}
}
}
// project.tasks['bundleRelease'].finalizedBy task("dealAfterBuild${variant.name.capitalize()}") {
// doLast {
// unZipAar(aarFile)
// buildQBAar(aarFile)
// if (ISCI.toBoolean()) {
// copyMappingToBin(FLAVOR, BUILD_TYPE)
// }
// }
// }
}
}

Expand Down Expand Up @@ -492,3 +496,23 @@ def copyAarToBin(variant) {
}
}
}

Properties properties = new Properties()
InputStream inputStream = project.rootProject.file('local.properties').newDataInputStream()
properties.load( inputStream )

def user = properties.getProperty('bintrayUser')
def key = properties.getProperty('bintrayKey')
println("bintrayUpload: bintrayUser=" + user + ", bintrayKey=" + key)
publish {
bintrayUser = user
bintrayKey = key
userOrg = 'hippy'
repoName = 'Hippy'
groupId = 'com.tencent.hippy'
artifactId = 'hippy-snapshot'
publishVersion = '0.0.1'
dryRun = false
desc = 'Hippy library for Android'
website = 'https://github.com/Tencent/Hippy'
}
2 changes: 1 addition & 1 deletion android/support_ui/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apply plugin: 'com.android.library'
android {
compileSdkVersion 26
buildToolsVersion '26.0.2'
buildToolsVersion '28.0.3'
defaultConfig {
minSdkVersion 14
targetSdkVersion 21
Expand Down
6 changes: 3 additions & 3 deletions examples/android-demo/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'

classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.novoda:bintray-release:0.9.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
Expand Down Expand Up @@ -38,4 +38,4 @@ project.afterEvaluate {
from "res"
into "example/src/main/assets"
}
}
}
10 changes: 5 additions & 5 deletions examples/android-demo/example/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apply plugin: 'com.android.application'

android {
compileSdkVersion 26
buildToolsVersion '26.0.2'
buildToolsVersion '28.0.3'
defaultConfig {
applicationId "com.tencent.mtt.hippy.example"
minSdkVersion 14
Expand Down Expand Up @@ -41,8 +41,8 @@ android {
}

dependencies {
compile project(path:':android-sdk')
compile project(path:':support_ui')
compile 'com.github.bumptech.glide:glide:3.6.1'
compile 'com.android.support:support-v4:26.1.0'
api project(path:':android-sdk')
api project(path:':support_ui')
api 'com.github.bumptech.glide:glide:3.6.1'
api 'com.android.support:support-v4:26.1.0'
}

0 comments on commit cd5c64e

Please sign in to comment.