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

Add user property to make it easier to generate local release builds #948

Merged
merged 1 commit into from
Feb 14, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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