Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
50 lines (45 sloc) 1.29 KB
apply plugin: 'com.android.application'
android {
signingConfigs {
sign
}
compileSdkVersion 23
buildToolsVersion "23.0.0"
defaultConfig {
applicationId "biz.mosil.sample.gradle.keystore"
minSdkVersion 10
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.sign
}
}
productFlavors {
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.0.0'
}
//rootProject.file(): 取得根目錄中的檔案
def ksFile = rootProject.file('keystore.properties')
def props = new Properties();
if (ksFile.canRead()) {
props.load(new FileInputStream(ksFile))
if (props != null) {
android.signingConfigs.sign.storeFile file(props['KEYSTORE_FILE'])
android.signingConfigs.sign.storePassword props['KEYSTORE_PASSWORD']
android.signingConfigs.sign.keyAlias props['KEYSTORE_ALIAS']
android.signingConfigs.sign.keyPassword props['KEYSTORE_ALIAS_PASSWORD']
} else {
println 'some entries in \'keystore.properties\' not found!'
}
} else {
println '\'keystore.properties\' not found!'
}