Skip to content

Commit

Permalink
update android settings
Browse files Browse the repository at this point in the history
  • Loading branch information
ronghui.zrh committed Mar 11, 2022
1 parent 8392a8e commit 5d99b0d
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/Android/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@
.externalNativeBuild
.cxx
local.properties
github.properties
40 changes: 38 additions & 2 deletions src/Android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
apply plugin: 'com.android.library'
apply plugin: 'maven-publish'

def githubProperties = new Properties()
githubProperties.load(new FileInputStream(rootProject.file("github.properties")))

def getVersionName = { ->
return "0.1.0"
}

def getArtificatId = { ->
return "gaia-motion-curve"
}

allprojects {
repositories {
Expand Down Expand Up @@ -26,7 +38,7 @@ android {
minSdk 21
targetSdk 32
versionCode 1
versionName "0.1"
versionName "0.1.0"

}

Expand All @@ -49,8 +61,32 @@ android {
libraryVariants.all { variant ->
variant.outputs.all { output ->
if (outputFile != null && outputFileName.endsWith('.aar')) {
outputFileName = "gaia-motion-curve-${android.defaultConfig.versionName}.aar"
outputFileName = "${getArtificatId()}-release.aar"
}
}
}
}

publishing {
publications {
bar(MavenPublication) {
groupId 'com.gaia.libraries'
artifactId getArtificatId()
version getVersionName()
artifact("$buildDir/outputs/aar/${getArtificatId()}-release.aar")
}
}

repositories {
maven {
name = "GitHubPackages"

url = uri("https://maven.pkg.github.com/alibaba/gaia-motion-curve")

credentials {
username = githubProperties['gpr.usr'] ?: System.getenv("GPR_USER")
password = githubProperties['gpr.key'] ?: System.getenv("GPR_API_KEY")
}
}
}
}

0 comments on commit 5d99b0d

Please sign in to comment.