chiark / gitweb /
Make maven executable path accessible in prebuild/init
authorCiaran Gultnieks <ciaran@ciarang.com>
Mon, 1 Oct 2012 12:19:00 +0000 (13:19 +0100)
committerCiaran Gultnieks <ciaran@ciarang.com>
Mon, 1 Oct 2012 12:19:00 +0000 (13:19 +0100)
docs/fdroid.texi
fdroidserver/build.py
fdroidserver/common.py
fdroidserver/scanner.py

index 664fa649e5464283092614c6a94fea61d0421d94..020bf3116028a0da57017550972f2a9903036099 100644 (file)
@@ -772,15 +772,15 @@ particular, literal backslashes should not be escaped.
 You can use $$name$$ to substitute the path to a referenced srclib - see
 the @code{srclib} directory for details of this.
 
-You can use $$SDK$$ and $$NDK$$ to substitute the paths to the android
-SDK and NDK directories respectively.
+You can use $$SDK$$, $$NDK$$ and $$MVN3$$ to substitute the paths to the
+android SDK and NDK directories, and maven 3 executable respectively.
 
 @item init=xxxx
 As for 'prebuild', but runs on the source code BEFORE any other processing
 takes place.
 
-You can use $$SDK$$ and $$NDK$$ to substitute the paths to the android
-SDK and NDK directories respectively.
+You can use $$SDK$$, $$NDK$$ and $$MVN3$$ to substitute the paths to the
+android SDK and NDK directories, and maven 3 executable respectively.
 
 @item novcheck=yes 
 Don't check that the version name and code in the resulting apk are
index 70a27ee14a502cbdf8c4b7f089a52b4f67de2f9b..0a95e55cdda4b6be063fc874ac90ba3a3d111618 100644 (file)
@@ -259,7 +259,7 @@ def build_local(app, thisbuild, vcs, build_dir, output_dir, extlib_dir, tmp_dir,
     # Prepare the source code...
     root_dir = common.prepare_source(vcs, app, thisbuild,
             build_dir, extlib_dir, sdk_path, ndk_path,
-            javacc_path, verbose)
+            javacc_path, mvn3, verbose)
 
     # Scan before building...
     buildprobs = common.scan_source(build_dir, root_dir, thisbuild)
@@ -505,9 +505,8 @@ def main():
 
     global options
     # Read configuration...
-    global build_server_always, mvn3
-    build_server_always = False
-    mvn3 = "mvn3"
+    globals()['build_server_always'] = False
+    globals()['mvn3'] = "mvn3"
     execfile('config.py', globals())
     options, args = parse_commandline()
     if build_server_always:
index 0e27ad4979dce7363e14e252bd7bdbaeff1c7818..5eb5adb064bba4f889c310ce30ec84820a6541e8 100644 (file)
@@ -867,6 +867,7 @@ class MetaDataException(Exception):
 # TODO: These are currently just hard-coded in this method. It will be a
 # metadata-driven system eventually, but not yet.
 def getsrclib(spec, extlib_dir, sdk_path, basepath=False):
+
     name, ref = spec.split('@')
 
     if name == 'GreenDroid':
@@ -1016,8 +1017,6 @@ def getsrclib(spec, extlib_dir, sdk_path, basepath=False):
         vcs = getvcs('git',
                 'https://code.google.com/r/andreasschildbach-bitcoinj/', sdir, sdk_path)
         vcs.gotorevision(ref)
-        if subprocess.call([mvn3, 'install'], cwd=sdir) != 0:
-            raise BuildException("Maven build failed for BitcoinJWallet srclib")
         return sdir
 
     if name == 'Color-Picker':
@@ -1112,10 +1111,11 @@ def getsrclib(spec, extlib_dir, sdk_path, basepath=False):
 #  'sdk_path'    - the path to the Android SDK
 #  'ndk_path'    - the path to the Android NDK
 #  'javacc_path' - the path to javacc
+#  'mvn3'        - the path to the maven 3 executable
 #  'verbose'     - optional: verbose or not (default=False)
 # Returns the root directory, which may be the same as 'build_dir' or may
 # be a subdirectory of it.
-def prepare_source(vcs, app, build, build_dir, extlib_dir, sdk_path, ndk_path, javacc_path, verbose=False):
+def prepare_source(vcs, app, build, build_dir, extlib_dir, sdk_path, ndk_path, javacc_path, mvn3, verbose=False):
 
     # Optionally, the actual app source can be in a subdirectory...
     if build.has_key('subdir'):
@@ -1142,6 +1142,7 @@ def prepare_source(vcs, app, build, build_dir, extlib_dir, sdk_path, ndk_path, j
         init = build['init']
         init = init.replace('$$SDK$$', sdk_path)
         init = init.replace('$$NDK$$', ndk_path)
+        init = init.replace('$$MVN$$', mvn3)
         if verbose: print "Doing init: exec '%s' in '%s'"%(init,root_dir)
         if subprocess.call(init, cwd=root_dir, shell=True) != 0:
             raise BuildException("Error running init command")
@@ -1321,6 +1322,7 @@ def prepare_source(vcs, app, build, build_dir, extlib_dir, sdk_path, ndk_path, j
             prebuild = prebuild.replace('$$' + name + '$$', libpath)
         prebuild = prebuild.replace('$$SDK$$', sdk_path)
         prebuild = prebuild.replace('$$NDK$$', ndk_path)
+        prebuild = prebuild.replace('$$MVN3$$', mvn3)
         p = subprocess.Popen(prebuild, cwd=root_dir, shell=True,
                 stdout=subprocess.PIPE, stderr=subprocess.PIPE)
         out, err = p.communicate()
index 6d3967da457d4ffcd51dc85a606db10019d9fb2d..2d307a328242efaca5234fec6195687a66f42fd2 100644 (file)
@@ -35,8 +35,8 @@ def main():
 
     # Read configuration...
     global build_server_always, mvn3
-    build_server_always = False
-    mvn3 = "mvn3"
+    globals()['build_server_always'] = False
+    globals()['mvn3'] = "mvn3"
     execfile('config.py', globals())
 
 
@@ -99,7 +99,7 @@ def main():
 
                         # Prepare the source code...
                         root_dir = common.prepare_source(vcs, app, thisbuild,
-                                build_dir, extlib_dir, sdk_path, ndk_path, javacc_path, options.verbose)
+                                build_dir, extlib_dir, sdk_path, ndk_path, javacc_path, mvn3, options.verbose)
 
                         # Do the scan...
                         buildprobs = common.scan_source(build_dir, root_dir, thisbuild)