Permalink
Browse files

more flexible signing

if you want to build samples with custom signing keys, add a samples/gradle.properties like this:

storeFile=/path/to/keystore/file
storePassword=xxx
keyAlias=yyy
keyPassword=zzz

if you don't want to build samples with signing keys, simply remove samples/gradle.properties.
  • Loading branch information...
1 parent 2744660 commit b703945c4ed42cbe0ad9ef3b5d08639646bf3dc9 @huahang huahang committed Aug 27, 2013
Showing with 45 additions and 25 deletions.
  1. +4 −0 .gitignore
  2. +21 −1 build.gradle
  3. +0 −8 library/build.gradle
  4. +20 −16 samples/build.gradle
View
@@ -31,3 +31,7 @@ proguard.cfg
#gradle
.gradle
+
+#keystore
+keystore
+gradle.properties
View
@@ -1 +1,21 @@
-// Top-level build file where you can add configuration options common to all sub-projects/modules.
+buildscript {
+ repositories {
+ mavenCentral()
+ }
+ dependencies {
+ classpath 'com.android.tools.build:gradle:0.5.+'
+ }
+}
+
+allprojects {
+ group = 'me.imid.swipebacklayout'
+ version = '1.0.0-SNAPSHOT'
+
+ repositories {
+ mavenCentral()
+ }
+
+ tasks.withType(Compile) {
+ options.encoding = "UTF-8"
+ }
+}
@@ -1,11 +1,3 @@
-buildscript {
- repositories {
- mavenCentral()
- }
- dependencies {
- classpath 'com.android.tools.build:gradle:0.5.+'
- }
-}
apply plugin: 'android-library'
repositories {
View
@@ -1,11 +1,3 @@
-buildscript {
- repositories {
- mavenCentral()
- }
- dependencies {
- classpath 'com.android.tools.build:gradle:0.5.+'
- }
-}
apply plugin: 'android'
repositories {
@@ -26,19 +18,31 @@ android {
targetSdkVersion 14
}
-
signingConfigs {
- swipebackdemo {
- storeFile file("/Users/Issac/Dropbox/Develop/RefacTech.keystore")
- storePassword "RefacTech"
- keyAlias "SwipeBackDemo"
- keyPassword "SwipeBackDemo"
- }
+ signing
}
buildTypes {
release {
- signingConfig signingConfigs.swipebackdemo
+ if (project.hasProperty('storeFile')) {
+ signingConfig signingConfigs.signing
+ }
}
}
}
+
+if (project.hasProperty('storeFile')) {
+ android.signingConfigs.signing.storeFile = file(storeFile)
+}
+
+if (project.hasProperty('storePassword')) {
+ android.signingConfigs.signing.storePassword = storePassword
+}
+
+if (project.hasProperty('keyAlias')) {
+ android.signingConfigs.signing.keyAlias = keyAlias
+}
+
+if (project.hasProperty('keyPassword')) {
+ android.signingConfigs.signing.keyPassword = keyPassword
+}

0 comments on commit b703945

Please sign in to comment.