chiark / gitweb /
Merge compilesdk= into target=, better documentation about target=
authorDaniel Martí <mvdan@mvdan.cc>
Tue, 28 Jan 2014 13:01:32 +0000 (14:01 +0100)
committerDaniel Martí <mvdan@mvdan.cc>
Tue, 28 Jan 2014 13:01:32 +0000 (14:01 +0100)
docs/fdroid.texi
fdroidserver/build.py
fdroidserver/common.py
fdroidserver/metadata.py

index 56ec8c1958a206a0abdfa3b328766b81a4bcf23a..29e94d084ef9543d5a0a6647939f7649ce2f15c3 100644 (file)
@@ -836,22 +836,17 @@ is sdk-location. Typically, if you get a message along the lines of:
 try enabling this option.
 
 @item target=<target>
-Specifies a particular SDK target for compilation, overriding the
-project.properties of the app and possibly sub-projects. Note that this does
-not change the target SDK in the AndroidManifest.xml — the level of features
-that can be included in the build. This is likely to cause the whole build.xml
-to be rewritten, which is fine if it's a 'standard' android file or doesn't
-already exist, but not a good idea if it's heavily customised. If you get an
-error about invalid target, first try @code{init=rm -rf bin/}; otherwise this
-parameter should do the trick.
-
-Please note that gradle builds should be using compilesdk=.
-
-@item compilesdk=<level>
-Practically accomplishes the same that target= does when used in ant and maven
-projects. compilesdk= is used rather than target= so as to not cause any more
-confusion. It only takes effect on gradle builds in the build.gradle file,
-thus using it in any other case is not wise.
+Specifies a particular SDK target for compilation, overriding the value
+defined in the code by upstream.  This has different effects depending on what
+build system used — this flag currently affects ant, maven and gradle projects
+only. Note that this does not change the target SDK in the
+AndroidManifest.xml, which determines the level of features that can be
+included in the build.
+
+In the case of an ant project, it modifies project.properties of the app and
+possibly sub-projects. This is likely to cause the whole build.xml to be
+rewritten, which is fine if it's a 'standard' android file or doesn't already
+exist, but not a good idea if it's heavily customised.
 
 @item update=xxx
 By default, 'android update project' is used to generate or update the
index c2581f9ad6641e45d0895b38982237f3bc44fd64..170c2c05b43951feecc3266a567d9b6e2648f497 100644 (file)
@@ -595,17 +595,6 @@ def build_local(app, thisbuild, vcs, build_dir, output_dir, srclib_dir, extlib_d
             flavours = thisbuild['gradle'].split(',')
             gradle_dir = root_dir
 
-
-        if 'compilesdk' in thisbuild:
-            level = thisbuild["compilesdk"].split('-')[1]
-            subprocess.call(['sed', '-i',
-                    's@compileSdkVersion[ ]*[0-9]*@compileSdkVersion '+level+'@g',
-                    'build.gradle'], cwd=root_dir)
-            if '@' in thisbuild['gradle']:
-                subprocess.call(['sed', '-i',
-                        's@compileSdkVersion[ ]*[0-9]*@compileSdkVersion '+level+'@g',
-                        'build.gradle'], cwd=gradle_dir)
-
         if len(flavours) == 1 and flavours[0] in ['main', 'yes', '']:
             flavours[0] = ''
 
index 954a67f669bf7afbbdde9ee0b234679cb89ba8b9..718e66e818e03ec90816a40489e867a1eb9fbaec 100644 (file)
@@ -937,7 +937,7 @@ def prepare_source(vcs, app, build, build_dir, srclib_dir, extlib_dir, onserver=
 
 
     # Generate (or update) the ant build file, build.xml...
-    if (updatemode != 'no' and build['type'] == 'ant'):
+    if updatemode != 'no' and build['type'] == 'ant':
         parms = [os.path.join(config['sdk_path'], 'tools', 'android'),
                 'update', 'project']
         if 'target' in build and build['target']:
@@ -1013,6 +1013,16 @@ def prepare_source(vcs, app, build, build_dir, srclib_dir, extlib_dir, onserver=
         if flavour in ['main', 'yes', '']:
             flavour = None
 
+        if 'target' in thisbuild:
+            n = thisbuild["target"].split('-')[1]
+            subprocess.call(['sed', '-i',
+                's@compileSdkVersion[ ]*[0-9]*@compileSdkVersion '+n+'@g',
+                'build.gradle'], cwd=root_dir)
+            if '@' in thisbuild['gradle']:
+                subprocess.call(['sed', '-i',
+                    's@compileSdkVersion[ ]*[0-9]*@compileSdkVersion '+n+'@g',
+                    'build.gradle'], cwd=gradle_dir)
+
     # Remove forced debuggable flags
     print "Removing debuggable flags..."
     for path in manifest_paths(root_dir, flavour):
index 552a338e4a9df865ca515c71d913febbf531692e..f3108b569e47bbc0a9efa62ef1e35c8dd6f97588 100644 (file)
@@ -698,7 +698,7 @@ def write_metadata(dest, app):
         # This defines the preferred order for the build items - as in the
         # manual, they're roughly in order of application.
         keyorder = ['disable', 'commit', 'subdir', 'submodules', 'init',
-                    'gradle', 'maven', 'oldsdkloc', 'target', 'compilesdk',
+                    'gradle', 'maven', 'oldsdkloc', 'target',
                     'update', 'encoding', 'forceversion', 'forcevercode', 'rm',
                     'fixtrans', 'fixapos', 'extlibs', 'srclibs', 'patch',
                     'prebuild', 'scanignore', 'scandelete', 'build', 'buildjni',