default.txt 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. apply plugin: 'android'
  2. android {
  3. compileSdkVersion 19
  4. buildToolsVersion "19.1"
  5. defaultConfig {
  6. minSdkVersion 15
  7. targetSdkVersion 19
  8. versionCode 5
  9. versionName "0.4.4"
  10. }
  11. compileOptions {
  12. sourceCompatibility JavaVersion.VERSION_1_7
  13. targetCompatibility JavaVersion.VERSION_1_7
  14. }
  15. signingConfigs {
  16. release
  17. }
  18. buildTypes {
  19. release {
  20. // runProguard true
  21. proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
  22. signingConfig signingConfigs.release
  23. }
  24. }
  25. }
  26. dependencies {
  27. compile fileTree(dir: 'libs', include: ['*.jar'])
  28. compile 'com.example:example-lib:1.0.0'
  29. }
  30. def propFile = file('../signing.properties')
  31. if( propFile.canRead() ) {
  32. def Properties p = new Properties()
  33. p.load(new FileInputStream(propFile))
  34. if( p!=null
  35. && p.containsKey("STORE_FILE")
  36. && p.containsKey('STORE_PASSWORD')
  37. && p.containsKey('KEY_ALIAS')
  38. && p.containsKey('KEY_PASSWORD')
  39. ) {
  40. println "RELEASE_BUILD: Signing..."
  41. android.signingConfigs.release.storeFile = file( p['STORE_FILE'] )
  42. android.signingConfigs.release.storePassword = p['STORE_PASSWORD']
  43. android.signingConfigs.release.keyAlias = p['KEY_ALIAS']
  44. android.signingConfigs.release.keyPassword = p['KEY_PASSWORD']
  45. } else {
  46. println "RELEASE_BUILD: Required properties in signing.properties are missing"
  47. android.buildTypes.release.signingConfig = null
  48. }
  49. } else {
  50. println "RELEASE_BUILD: signing.properties not found"
  51. android.buildTypes.release.signingProperties = null
  52. }