Skip to content

Commit

Permalink
refactor(android): change jCenter to maven central
Browse files Browse the repository at this point in the history
  • Loading branch information
siguangli2018 authored and siguangli committed Apr 13, 2021
1 parent 63652d7 commit c4ee035
Show file tree
Hide file tree
Showing 9 changed files with 84 additions and 61 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ android/sdk/src/main/jni/.vs
android/sdk/maven-auth.properties
android/sdk/local.properties
android/sdk/.cxx/*
android/sdk/libs/armeabi-v7a/libhippybridge.so
android/sdk/libs/arm64-v8a/libhippybridge.so
android/sdk/libs/x86/libhippybridge.so
android/sdk/libs/x86_64/libhippybridge.so
examples/android-demo/example/src/main/assets/
examples/ios-demo/HippyDemo.xcodeproj/project.xcworkspace/xcuserdata/*
examples/ios-demo/HippyDemo.xcodeproj/xcuserdata/*
Expand Down
46 changes: 0 additions & 46 deletions android/sdk/bintrayUpload.gradle

This file was deleted.

5 changes: 2 additions & 3 deletions android/sdk/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apply plugin: 'com.android.library'
apply from: './bintrayUpload.gradle'
apply from: './mavencentral.gradle'
//apply from: './maven.gradle'

ext {
Expand All @@ -17,7 +17,6 @@ buildscript {
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.0+'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.+'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
Expand All @@ -29,7 +28,7 @@ allprojects {
MAVEN_PWD = System.getenv('maven_password')
MAVEN_URL = System.getenv('maven_url')

println("===============MAVEN_USER=" + MAVEN_USER + ", MAVEN_PWD=" + MAVEN_PWD)
println("MAVEN_USER=" + MAVEN_USER + ", MAVEN_PWD=" + MAVEN_PWD)
}

repositories {
Expand Down
18 changes: 8 additions & 10 deletions android/sdk/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ MIN_SDK_VERSION=14
TARGET_SDK_VERSION=29
ARCHIVES_BASE_NAME=android-sdk

#jCenter sdk version
VERSION_NAME=2.5.5
#maven central sdk version
#1.0.0-SNAPSHOT
VERSION_NAME=1.0.0
VERSION_CODE=1

#ABI
Expand All @@ -42,14 +43,11 @@ ENABLE_SO_DOWNLOAD=false
INCLUDE_SUPPORT_UI=true
INCLUDE_VIDEO_COMPONENT=true

#bintray publish params
#hippy-snapshot hippy-release
BINTRAY_ARTIFACT_ID=hippy-release
BINTRAY_GIT_URL=https://github.com/Tencent/Hippy
BINTRAY_GROUP_ID=com.tencent.hippy
BINTRAY_REPO=Hippy
BINTRAY_URSER_ORG=hippy
BINTRAY_VERSION_DESC=Hippy library for Android
#maven central publish params
PUBLISH_ARTIFACT_ID=hippy-common
PUBLISH_GROUP_ID=com.tencent.hippy
PUBLISH_GIT_URL=https://github.com/Tencent/Hippy
PUBLISH_VERSION_DESC=Hippy library for Android



Expand Down
Binary file removed android/sdk/libs/arm64-v8a/libhippybridge.so
Binary file not shown.
2 changes: 1 addition & 1 deletion android/sdk/maven.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ext {
MAVEN_URL = System.getenv('maven_thirdparty')

OUTPUT_JAR_PATH = "$buildDir/outputs/aar/hippy.jar"
println("===============MAVEN_URL=" + MAVEN_URL)
println("MAVEN_URL=" + MAVEN_URL)
}

publishing {
Expand Down
66 changes: 66 additions & 0 deletions android/sdk/mavencentral.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
apply plugin: 'maven-publish'
apply plugin: 'signing'

ext["signing.keyId"] = System.getenv('SIGNING_KEY_ID')
ext["signing.password"] = System.getenv('SIGNING_PASSWORD')
ext["signing.secretKeyRingFile"] = System.getenv('SIGNING_SECRET_KEY_RING_FILE')
ext["ossrhUsername"] = System.getenv('OSSRH_USERNAME')
ext["ossrhPassword"] = System.getenv('OSSRH_PASSWORD')

println("signing.keyId=" + ext["signing.keyId"])
println("signing.password=" + ext["signing.password"])
println("signing.secretKeyRingFile=" + ext["signing.secretKeyRingFile"])
println("ossrhUsername=" + ossrhUsername)
println("ossrhPassword=" + ossrhPassword)

publishing {
publications {
mavenAar(MavenPublication) {
artifact("$buildDir/outputs/aar/android-sdk-release.aar")
groupId PUBLISH_GROUP_ID
artifactId PUBLISH_ARTIFACT_ID
version VERSION_NAME
pom {
name = PUBLISH_ARTIFACT_ID
description = PUBLISH_VERSION_DESC
url = PUBLISH_GIT_URL
licenses {
license {
name = 'The Apache Software License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id = PUBLISH_ARTIFACT_ID
name = 'Tencent Hippy'
email = '[email protected]'
}
}
scm {
connection = "scm:[email protected]:Tencent/Hippy.git"
developerConnection = "scm:[email protected]:Tencent/Hippy.git"
url = PUBLISH_GIT_URL
}
}
}
}
repositories {
maven {
def releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2"
def snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots"
url = VERSION_NAME.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl

credentials {
username ossrhUsername
password ossrhPassword
}
}
}
}

signing {
sign publishing.publications.mavenAar
}


4 changes: 3 additions & 1 deletion examples/android-demo/example/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@ if (propFile.exists()) {

android {
compileSdkVersion 29
buildToolsVersion '30.0.3'
defaultConfig {
applicationId "com.tencent.mtt.hippy.example"
minSdkVersion 14
// noinspection ExpiredTargetSdkVersion
targetSdkVersion 29
ndk {
abiFilters 'arm64-v8a'
}
}

signingConfigs {
Expand Down
Binary file modified examples/android-demo/example/libs/android-sdk-release.aar
Binary file not shown.

0 comments on commit c4ee035

Please sign in to comment.