Skip to content

Commit 1ca155f

Browse files
committed
Generate key.properties for travis
1 parent 95cc908 commit 1ca155f

2 files changed

Lines changed: 7 additions & 15 deletions

File tree

.travis.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ addons:
2525
- ia32-libs-multiarch
2626

2727
script:
28+
- printf 'GooglePlayLicenseKey="GooglePlayLicenseKey"\nIapProductKey="IapProductKey"' > app/keys.properties
2829
- MALLOC_ARENA_MAX=1
2930
- chmod a+x gradlew
30-
- ./gradlew clean assembleTravisRelease --stacktrace
31+
- ./gradlew clean assembleFreeRelease --stacktrace

app/build.gradle

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,12 @@ repositories {
1414
maven { url 'https://maven.fabric.io/public' }
1515
}
1616

17+
def props = new Properties()
18+
props.load(new FileInputStream('app/keys.properties'))
1719

20+
props.each { key, val ->
21+
project.set(key, val)
22+
}
1823

1924
def versionMajor = 2
2025
def versionMinor = 0
@@ -40,25 +45,11 @@ android {
4045
productFlavors {
4146
free {
4247

43-
def props = new Properties()
44-
props.load(new FileInputStream('app/keys.properties'))
45-
46-
props.each { key, val ->
47-
project.set(key, val)
48-
}
49-
5048
resValue "string", "app_name", "Show Java"
5149
buildConfigField "String" , "GOOGLE_PLAY_LICENSE_KEY" , GooglePlayLicenseKey
5250
buildConfigField "String" , "IAP_PRODUCT_ID" , IapProductKey
5351
}
5452

55-
travis {
56-
def GooglePlayLicenseKey = '"GOOGLE_PLAY_LICENSE_KEY"'
57-
def IapProductKey = '"IAP_PRODUCT_ID"'
58-
resValue "string", "app_name", "Show Java"
59-
buildConfigField "String" , "GOOGLE_PLAY_LICENSE_KEY" , GooglePlayLicenseKey
60-
buildConfigField "String" , "IAP_PRODUCT_ID" , IapProductKey
61-
}
6253
}
6354
compileOptions {
6455
sourceCompatibility JavaVersion.VERSION_1_7

0 commit comments

Comments
 (0)