Skip to content

Commit b2db2aa

Browse files
committed
Build debug build automatically with a debug key.
No need to comment out that signing code!!
1 parent 36a14ab commit b2db2aa

File tree

2 files changed

+16
-46
lines changed

2 files changed

+16
-46
lines changed

CONTRIBUTING.md

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -41,43 +41,5 @@ To update the wiki, simply navigate to the [wiki tab](https://github.com/octoshr
4141
6. Submit a pull request with your change.
4242
**We have a build action on each pull request, if this build fails, please edit the pull request in order to make the build succeed.**
4343
## Helpful Tips
44-
### [build.gradle](https://github.com/octoshrimpy/quik/blob/master/presentation/build.gradle) configuration for building locally
45-
```
46-
47-
/*
48-
signingConfigs {
49-
release {
50-
def keystoreProps = new Properties()
51-
def keystorePropsFile = rootProject.file('./.gradle/.gradlerc')
52-
storeFile file('./my-release-key.keystore')
53-
keyAlias 'quik_release'
54-
if (keystorePropsFile.exists()) {
55-
keystoreProps.load(new FileInputStream(keystorePropsFile))
56-
} else if (System.getenv("CI") == "true") {
57-
// do nothing
58-
} else {
59-
throw new GradleException("Keystore properties file not found.")
60-
}
61-
storePassword keystoreProps['storePassword']
62-
keyPassword keystoreProps['keyPassword']
63-
}
64-
}
65-
*/
66-
buildTypes {
67-
release {
68-
minifyEnabled true
69-
shrinkResources true
70-
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
71-
// signingConfig signingConfigs.release
72-
}
73-
}
74-
75-
productFlavors {
76-
withAnalytics { dimension "analytics" }
77-
noAnalytics {
78-
// signingConfig signingConfigs.release
79-
}
80-
}
81-
```
8244
### Set Java Version
8345
When building QUIK, make sure to download JDK 17 and specify an installation path for it. In Android Studio, you can do that in Settings > Build, Execution, Deployment > Build Tools > Gradle.

presentation/build.gradle

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,23 +40,21 @@ android {
4040
}
4141

4242
signingConfigs {
43+
debug // Uses the default debug keystore.
4344
release {
4445
def keystoreProps = new Properties()
4546
def keystorePropsFile = rootProject.file('./.gradle/.gradlerc')
4647
storeFile file('./my-release-key.keystore')
4748
keyAlias 'quik_release'
4849
if (keystorePropsFile.exists()) {
4950
keystoreProps.load(new FileInputStream(keystorePropsFile))
50-
} else if (System.getenv("CI") == "true") {
51-
// do nothing
52-
} else {
53-
throw new GradleException("Keystore properties file not found.")
54-
}
51+
} else
52+
// do nothing
5553
storePassword keystoreProps['storePassword']
5654
keyPassword keystoreProps['keyPassword']
5755
}
5856
}
59-
57+
6058
dependenciesInfo {
6159
// Disables dependency metadata when building APKs.
6260
includeInApk = false
@@ -75,6 +73,7 @@ android {
7573
applicationIdSuffix ".debug"
7674
versionNameSuffix "-debug"
7775
resValue("string", "app_name", "QUIK-Debug")
76+
signingConfig signingConfigs.debug
7877
}
7978
}
8079

@@ -87,13 +86,12 @@ android {
8786
jvmTarget = "1.8"
8887
}
8988

90-
9189
productFlavors {
9290
withAnalytics { dimension "analytics" }
9391
noAnalytics {
94-
signingConfig signingConfigs.release
9592
}
9693
}
94+
9795
lint {
9896
abortOnError false
9997
}
@@ -233,3 +231,13 @@ if (getGradle().getStartParameter().getTaskRequests().toString().contains("WithA
233231
apply plugin: 'com.google.gms.google-services'
234232
apply plugin: 'com.google.firebase.crashlytics'
235233
}
234+
235+
// Check to make sure that the keystore file is present when building a release
236+
gradle.taskGraph.whenReady { taskGraph ->
237+
if ((taskGraph.hasTask(':assembleRelease') ||
238+
taskGraph.allTasks.any { it.name == 'assembleRelease' }) &&
239+
!file('./.gradle/.gradlerc').exists() &&
240+
System.getenv("CI") != "true") {
241+
throw new GradleException("Keystore properties file not found")
242+
}
243+
}

0 commit comments

Comments
 (0)