mirror of
https://github.com/TwidereProject/Twidere-Android
synced 2025-01-11 07:43:46 +01:00
updated build script
This commit is contained in:
parent
17dc454541
commit
6cc854ab3c
@ -23,3 +23,9 @@ android:
|
|||||||
# - sys-img-x86-android-17
|
# - sys-img-x86-android-17
|
||||||
|
|
||||||
script: ./gradlew build
|
script: ./gradlew build
|
||||||
|
|
||||||
|
before_install:
|
||||||
|
- sudo apt-get update -qq
|
||||||
|
- sudo apt-get install -y python2.7
|
||||||
|
|
||||||
|
after_success: ./scripts/travis_upload_release_to_github.py
|
@ -26,10 +26,15 @@ android {
|
|||||||
if (signingPropFile.exists()) {
|
if (signingPropFile.exists()) {
|
||||||
Properties signingProp = new Properties()
|
Properties signingProp = new Properties()
|
||||||
signingProp.load(signingPropFile.newDataInputStream())
|
signingProp.load(signingPropFile.newDataInputStream())
|
||||||
storeFile file(signingProp.get("twidere.debug.storeFile"))
|
storeFile file(signingProp.get("debug.storeFile"))
|
||||||
storePassword signingProp.get("twidere.debug.storePassword")
|
storePassword signingProp.get("debug.storePassword")
|
||||||
keyAlias signingProp.get("twidere.debug.keyAlias")
|
keyAlias signingProp.get("debug.keyAlias")
|
||||||
keyPassword signingProp.get("twidere.debug.keyPassword")
|
keyPassword signingProp.get("debug.keyPassword")
|
||||||
|
} else if (System.getenv('DEBUG_KEYSTORE_BASE64') != null) {
|
||||||
|
storeFile decodeKeyStoreFileFromBase64Env('DEBUG_KEYSTORE_BASE64')
|
||||||
|
storePassword System.getenv('DEBUG_KEYSTORE_PASSWORD')
|
||||||
|
keyAlias System.getenv('DEBUG_KEYSTORE_KEY_ALIAS')
|
||||||
|
keyPassword System.getenv('DEBUG_KEYSTORE_KEY_PASSWORD')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
release {
|
release {
|
||||||
@ -37,26 +42,42 @@ android {
|
|||||||
if (signingPropFile.exists()) {
|
if (signingPropFile.exists()) {
|
||||||
Properties signingProp = new Properties()
|
Properties signingProp = new Properties()
|
||||||
signingProp.load(signingPropFile.newDataInputStream())
|
signingProp.load(signingPropFile.newDataInputStream())
|
||||||
storeFile file(signingProp.get("twidere.release.storeFile"))
|
storeFile file(signingProp.get("release.storeFile"))
|
||||||
storePassword signingProp.get("twidere.release.storePassword")
|
storePassword signingProp.get("release.storePassword")
|
||||||
keyAlias signingProp.get("twidere.release.keyAlias")
|
keyAlias signingProp.get("release.keyAlias")
|
||||||
keyPassword signingProp.get("twidere.release.keyPassword")
|
keyPassword signingProp.get("release.keyPassword")
|
||||||
|
} else if (System.getenv('RELEASE_KEYSTORE_BASE64') != null) {
|
||||||
|
storeFile decodeKeyStoreFileFromBase64Env('RELEASE_KEYSTORE_BASE64')
|
||||||
|
storePassword System.getenv('RELEASE_KEYSTORE_PASSWORD')
|
||||||
|
keyAlias System.getenv('RELEASE_KEYSTORE_KEY_ALIAS')
|
||||||
|
keyPassword System.getenv('RELEASE_KEYSTORE_KEY_PASSWORD')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
buildTypes {
|
buildTypes {
|
||||||
debug {
|
debug {
|
||||||
File signingPropFile = rootProject.file('signing.properties')
|
signingConfig signingConfigs.debug
|
||||||
if (signingPropFile.exists()) {
|
|
||||||
signingConfig signingConfigs.debug
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
release {
|
release {
|
||||||
File signingPropFile = rootProject.file('signing.properties')
|
signingConfig signingConfigs.release
|
||||||
if (signingPropFile.exists()) {
|
|
||||||
signingConfig signingConfigs.release
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def decodeKeyStoreFileFromBase64Env(String name) {
|
||||||
|
String keyStoreBase64 = System.getenv(name)
|
||||||
|
if (keyStoreBase64 == null) return null
|
||||||
|
File tempKeyStoreFile = File.createTempFile("tmp_ks_", ".jks", File.createTempDir())
|
||||||
|
FileOutputStream fos = null
|
||||||
|
try {
|
||||||
|
fos = new FileOutputStream(tempKeyStoreFile)
|
||||||
|
fos.write(keyStoreBase64.decodeBase64())
|
||||||
|
fos.flush()
|
||||||
|
} finally {
|
||||||
|
if (fos != null) {
|
||||||
|
fos.close()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return tempKeyStoreFile
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user