chiark / gitweb /
Take "$VALUE" settings from environment variables
authorDaniel Martí <mvdan@mvdan.cc>
Fri, 6 Dec 2013 11:37:53 +0000 (12:37 +0100)
committerDaniel Martí <mvdan@mvdan.cc>
Fri, 6 Dec 2013 11:37:53 +0000 (12:37 +0100)
Set sdk_path and ndk_path defaults to $ANDROID_HOME and $ANDROID_NDK

config.sample.py
fdroidserver/common.py

index cb0265804b47e22be2328beebc9bffa8c2c4dc48..85c17d507970cd54a8c7bf3124b364523a47e2d1 100644 (file)
@@ -1,21 +1,22 @@
-
 # Copy this file to config.py, then amend the settings below according to
 # your system configuration.
 
-# Path to the Android SDK ($ANDROID_HOME)
-sdk_path = "/path/to/android-sdk-linux_86"
+# Path to the Android SDK, $ANDROID_HOME already set on most systems
+#sdk_path = "/path/to/android-sdk"
+sdk_path = "$ANDROID_HOME"
 
-# Path to the Android NDK ($ANDROID_NDK)
+# Path to the Android NDK, $ANDROID_NDK already set on most systems
 # Legacy toolchains are only needed by some apps
-ndk_path = "/path/to/android-ndk-r9"
+#ndk_path = "/path/to/android-ndk"
+ndk_path = "$ANDROID_NDK"
 
 # Build tools version to be used
 build_tools = "18.1.1"
 
-# Command for running maven 3 (could be mvn, mvn3, or a full path)
+# Command for running maven 3 (command or full path)
 mvn3 = "mvn3"
 
-# Command for running Gradle
+# Command for running Gradle (command or full path)
 gradle = "gradle"
 
 # Android gradle plugin version
@@ -105,8 +106,6 @@ stats_to_carbon = False
 carbon_host = '0.0.0.0'
 carbon_port = 2003
 
-
 #Set this to true to always use a build server. This saves specifying the
 #--server option on dedicated secure build server hosts.
 build_server_always = False
-
index da39e2ce05e9d790945a36e290b2068b0e8faaa4..629d6d6fca81ee813bd29b76bec1e26f0c4cc5a1 100644 (file)
@@ -67,6 +67,11 @@ def read_config(opts, config_file='config.py'):
     if options.verbose:
         print "Reading %s..." % config_file
     execfile(config_file, config)
+    for k, v in config.items():
+        if type(v) != str:
+            continue
+        if v[0] == '$':
+            config[k] = os.environ[v[1:]]
     return config
 
 def getapkname(app, build):