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

Reduce 'android-18' duplication by putting it in $ANDROID_TARGET env variable #11278

Merged
merged 1 commit into from May 24, 2016
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Reduce 'android-18' duplication, as originally done by wenderen

Use android.platform (and $ANDROID_PLATFORM) for configuration, apply 'android-18' default
  • Loading branch information
mitchhentges committed May 20, 2016
commit 619212abf3d62a83e97dfdb3d8d1a085bf2db792
@@ -178,6 +178,7 @@ def resolverelative(category, key):
self.config["android"].setdefault("sdk", "")
self.config["android"].setdefault("ndk", "")
self.config["android"].setdefault("toolchain", "")
self.config["android"].setdefault("platform", "android-18")
self.config["android"].setdefault("target", "arm-linux-androideabi")

self.config.setdefault("gonk", {})
@@ -318,6 +319,8 @@ def build_env(self, gonk=False, hosts_file_path=None, target=None):
env["ANDROID_NDK"] = self.config["android"]["ndk"]
if self.config["android"]["toolchain"]:
env["ANDROID_TOOLCHAIN"] = self.config["android"]["toolchain"]
if self.config["android"]["platform"]:
env["ANDROID_PLATFORM"] = self.config["android"]["platform"]

if gonk:
if self.config["gonk"]["b2g"]:
@@ -41,10 +41,11 @@ debug-mozjs = false

# Android information
[android]
# Defaults to the value of $ANDROID_SDK, $ANDROID_NDK, $ANDROID_TOOLCHAIN respectively
# Defaults to the value of $ANDROID_SDK, $ANDROID_NDK, $ANDROID_TOOLCHAIN, $ANDROID_PLATFORM respectively
#sdk = "/opt/android-sdk"
#ndk = "/opt/android-ndk"
#toolchain = "/opt/android-toolchain"
#platform = "android-18"

# Gonk information
# Please fill the ndk/toolchain for Android too
@@ -36,17 +36,9 @@
<condition property="sdk.dir" value="${env.ANDROID_HOME}">
<isset property="env.ANDROID_HOME" />
</condition>

<!-- The project.properties file is created and updated by the 'android'
tool, as well as ADT.
This contains project specific properties such as project target, and library
dependencies. Lower level build properties are stored in ant.properties
(or in .classpath for Eclipse projects).
This file is an integral part of the build system for your
application and should be checked into Version Control Systems. -->
<loadproperties srcFile="project.properties" />
<condition property="target" value="${env.ANDROID_PLATFORM}">
<isset property="env.ANDROID_PLATFORM" />
</condition>

<!-- quick check on sdk.dir -->
<fail
@@ -1,2 +1,2 @@
APP_ABI := armeabi
APP_PLATFORM := android-18
APP_PLATFORM := $(ANDROID_PLATFORM)

This file was deleted.

@@ -27,6 +27,11 @@ fn main() {
let ndk_path = env::var("NDK_HOME").ok().expect("Please set the NDK_HOME environment variable");
let ndk_path = Path::new(&ndk_path);

// Get the target android platform from ANDROID_PLATFORM env. Expecting "android-{version}"
let android_platform = env::var("ANDROID_PLATFORM")
.ok()
.expect("Please set the ANDROID_PLATFORM environment variable")

// Get the standalone NDK path from NDK_STANDALONE env.
// let standalone_path = env::var("NDK_STANDALONE").ok().unwrap_or("/opt/ndk_standalone".to_string());
// let standalone_path = Path::new(&standalone_path);
@@ -97,7 +102,7 @@ fn main() {
.arg("--name")
.arg("Servo")
.arg("--target")
.arg("android-18")
.arg(&android_platform)
.arg("--path")
.arg(".")
.stdout(Stdio::inherit())
@@ -36,7 +36,7 @@ _ANDROID_ARCH=arch-arm
# Android 5.0, there will likely be another platform added (android-22?).
# This value is always used.
# _ANDROID_API="android-14"
_ANDROID_API="android-18"
_ANDROID_API="$ANDROID_PLATFORM"
# _ANDROID_API="android-19"

#####################################################################
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.