Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated Android build process (2019-12-18) #36199

Merged
merged 1 commit into from
Dec 17, 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
12 changes: 8 additions & 4 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ def abi64 = getProperty("abi64").toBoolean()
def deps = getProperty("deps")
def override_version = getProperty("override_version")
def version_header_path = getProperty("version_header_path")
def override_compileSdkVersion = getProperty("override_compileSdkVersion")
def override_minSdkVersion = getProperty("override_minSdkVersion")
def override_targetSdkVersion = getProperty("override_targetSdkVersion")
def override_ndkBuildAppPlatform = getProperty("override_ndkBuildAppPlatform")

if (!abi32 && !abi64) {
throw new GradleException("Both `abi32` and `abi64` properties are set to false")
Expand Down Expand Up @@ -94,7 +98,7 @@ unzipDeps.dependsOn makeLocalization
preBuild.dependsOn unzipDeps

android {
compileSdkVersion 28
compileSdkVersion override_compileSdkVersion

if (override_version.isEmpty()) {
println("Generating version number to $version_header_path")
Expand Down Expand Up @@ -127,8 +131,8 @@ android {
}

defaultConfig {
minSdkVersion 14
targetSdkVersion 28
minSdkVersion override_minSdkVersion
targetSdkVersion overrid_targetSdkVersion
versionCode Integer.valueOf(System.env.UPSTREAM_BUILD_NUMBER ?: 1)
versionName new File("$version_header_path").text.split('\"')[1]
if (buildAsApplication) {
Expand Down Expand Up @@ -158,7 +162,7 @@ android {

externalNativeBuild {
ndkBuild {
arguments "APP_PLATFORM=android-16", "-j$njobs"
arguments "APP_PLATFORM=$override_ndkBuildAppPlatform", "-j$njobs"
}
}
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
Expand Down
16 changes: 16 additions & 0 deletions android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,19 @@ override_version=
# This property controls path where overriden version number header should be generated
# You can override this from the command line by passing "-Pversion_header_path=#"
version_header_path=app/jni/src/version.h

# This property controls which compileSdkVersion should be used
# You can override this from the command line by passing "-Poverride_compileSdkVersion=#"
override_compileSdkVersion=28

# This property controls which minSdkVersion should be used
# You can override this from the command line by passing "-Poverride_minSdkVersion=#"
override_minSdkVersion=14

# This property controls which targetSdkVersion should be used
# You can override this from the command line by passing "-Poverride_targetSdkVersion=#"
override_targetSdkVersion=28

# This property controls which ndkBuildAppPlatform should be used
# You can override this from the command line by passing "-Poverride_ndkBuildAppPlatform=#"
override_ndkBuildAppPlatform=android-16