chiark / gitweb /
More config changes
authorDaniel Martí <mvdan@mvdan.cc>
Sun, 26 Jan 2014 20:39:30 +0000 (21:39 +0100)
committerDaniel Martí <mvdan@mvdan.cc>
Sun, 26 Jan 2014 20:40:31 +0000 (21:40 +0100)
* Add the remaining defaults
* Don't always check that dirs exist
* Better sample config

config.buildserver.py
fdroidserver/common.py
sampleconfigs/config.sample.py

index 152a46e887c6596dec0d7162ce47fe4870117758..4de4aecaaf24c45692e6f0204f7bf59046583dfe 100644 (file)
@@ -1,5 +1,6 @@
 sdk_path = "/home/vagrant/android-sdk"
 ndk_path = "/home/vagrant/android-ndk"
 build_tools = "19.0.1"
+ant = "ant"
 mvn3 = "mvn"
 gradle = "gradle"
index e6997e38dfff1d2d16e8548dc0a166e1835df227..4e4322c03295f9846cbde4fea79ba3f170c4ccdf 100644 (file)
@@ -51,14 +51,17 @@ def read_config(opts, config_file='config.py'):
         options.verbose = False
 
     defconfig = {
-        'build_server_always': False,
+        'sdk_path': "$ANDROID_HOME",
+        'ndk_path': "$ANDROID_NDK",
+        'build_tools': "19.0.1",
+        'ant': "ant",
         'mvn3': "mvn",
         'gradle': 'gradle',
         'archive_older': 0,
         'update_stats': False,
-        'archive_older': 0,
         'stats_to_carbon': False,
         'repo_maxage': 0,
+        'build_server_always': False,
         'char_limits': {
             'Summary' : 50,
             'Description' : 1500
@@ -75,6 +78,10 @@ def read_config(opts, config_file='config.py'):
         if st.st_mode & stat.S_IRWXG or st.st_mode & stat.S_IRWXO:
             print "WARNING: unsafe permissions on {0} (should be 0600)!".format(config_file)
 
+    for k, v in defconfig.items():
+        if k not in config:
+            config[k] = v
+
     # Expand environment variables
     for k, v in config.items():
         if type(v) != str:
@@ -82,24 +89,6 @@ def read_config(opts, config_file='config.py'):
         v = os.path.expanduser(v)
         config[k] = os.path.expandvars(v)
 
-    # Check that directories exist
-    for key in ('sdk_path', 'ndk_path', 'build_tools'):
-        if key not in config:
-            continue
-        val = config[key]
-        if key == 'build_tools':
-            if 'sdk_path' not in config:
-                print "ERROR: sdk_path needs to be set for build_tools"
-                sys.exit(3)
-            val = os.path.join(config['sdk_path'], 'build-tools', val)
-        if not os.path.isdir(val):
-            print "ERROR: No such directory found for %s: %s" % (key, val)
-            sys.exit(3)
-
-    for k, v in defconfig.items():
-        if k not in config:
-            config[k] = v
-
     return config
 
 # Given the arguments in the form of multiple appid:[vc] strings, this returns
index d352fa024bf06904f6ed4c7fa5b282d10765e2b9..af6114468c5db4d0ff6a026cf843e3a6d0506ba5 100644 (file)
@@ -15,10 +15,16 @@ ndk_path = "$ANDROID_NDK"
 # Build tools version to be used
 build_tools = "19.0.1"
 
-# Command for running maven 3 (command or full path)
-mvn3 = "mvn3"
+# Command for running Ant
+#ant = "/path/to/ant"
+ant = "ant"
 
-# Command for running Gradle (command or full path)
+# Command for running maven 3
+#mvn3 = "/path/to/mvn"
+mvn3 = "mvn"
+
+# Command for running Gradle
+#gradle = "/path/to/gradle"
 gradle = "gradle"
 
 # Set the maximum age (in days) of an index that a client should accept from