Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Commit

Permalink
Add user property to make it easier to generate local release builds (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
MortimerGoro authored Feb 14, 2019
1 parent ed6049c commit 0005880
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 7 deletions.
15 changes: 12 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,22 @@ geckoViewLocalArm=/path/to/your/build/geckoview-nightly-armeabi-v7a-64.0.2018092
geckoViewLocalX86=/path/to/your/build/geckoview-nightly-x86-64.0.20180924100359.aar
```

## Install debug and release builds on device simultaneously
## Install dev and production builds on device simultaneously

You can enable a debug applicationID sufix to install both debug and release builds simultaneously. You just need to add this property to your `user.properties` file:
You can enable a dev applicationID sufix to install both dev and production builds simultaneously. You just need to add this property to your `user.properties` file:

```ini
simultaneousDebugRelease=true
simultaneousDevProduction=true
```
## Locally generate Android release builds

Local release builds can be useful to measure performance or debug issues only happening in release builds. Insead of dealing with release keys you can make the testing easier just adding this property to your `user.properties` file:

```ini
useDebugSigningOnRelease=true
```

Note: the release APKs generated with a debug keystore can't be used for production.

## Compress assets

Expand Down
27 changes: 23 additions & 4 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,20 @@ def getCrashRestartDisabled = { ->
return "false"
}

def getDebugApplicationIdSufix = { ->
if (gradle.hasProperty("simultaneousDebugRelease")) {
return gradle.simultaneousDebugRelease == "true" ? ".dev" : ""
def getDevApplicationIdSufix = { ->
if (gradle.hasProperty("simultaneousDevProduction")) {
return gradle.simultaneousDevProduction == "true" ? ".dev" : ""
}
return ""
}

def getUseDebugSigningOnRelease = { ->
if (gradle.hasProperty("useDebugSigningOnRelease")) {
return gradle.useDebugSigningOnRelease == "true"
}
return false
}

android {
compileSdkVersion build_versions.target_sdk
defaultConfig {
Expand Down Expand Up @@ -67,9 +74,10 @@ android {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
signingConfig getUseDebugSigningOnRelease() ? debug.signingConfig : release.signingConfig
}
debug {
applicationIdSuffix getDebugApplicationIdSufix()
applicationIdSuffix getDevApplicationIdSufix()
pseudoLocalesEnabled true
}
}
Expand Down Expand Up @@ -192,6 +200,12 @@ android {
]
}

release {
manifest.srcFile getUseDebugSigningOnRelease() ? "src/debug/AndroidManifest.xml"
: manifest.srcFile

}

googlevr {
java.srcDirs = [
'src/googlevr/java'
Expand All @@ -204,6 +218,11 @@ android {
]
}

oculusvrArmRelease {
manifest.srcFile getUseDebugSigningOnRelease() ? "src/oculusvrArmDebug/AndroidManifest.xml"
: manifest.srcFile
}

svr {
java.srcDirs = [
'src/svr/java'
Expand Down

0 comments on commit 0005880

Please sign in to comment.