chiark / gitweb /
Remove @dir support from gradle
authorDaniel Martí <mvdan@mvdan.cc>
Tue, 1 Jul 2014 17:39:41 +0000 (19:39 +0200)
committerDaniel Martí <mvdan@mvdan.cc>
Tue, 1 Jul 2014 17:39:41 +0000 (19:39 +0200)
docs/fdroid.texi
fdroidserver/build.py
fdroidserver/common.py

index f0debc4d638e21466ff92ff683fae25254138614..e72d3fe3e9891618ac2cceb1b77d8544117cce36 100644 (file)
@@ -989,19 +989,16 @@ actually not required or used, remove the directory instead (using
 isn't used nor built will result in an error saying that native
 libraries were expected in the resulting package.
 
 isn't used nor built will result in an error saying that native
 libraries were expected in the resulting package.
 
-@item gradle=<flavour>[@@<dir>]
+@item gradle=<flavour>
 Build with gradle instead of ant, specifying what flavour to assemble.
 Build with gradle instead of ant, specifying what flavour to assemble.
-If <flavour> is 'yes', 'main' or empty, no flavour will be used. Note
+If <flavour> is 'yes' or 'main', no flavour will be used. Note
 that this will not work on projects with flavours, since it will build
 all flavours and there will be no 'main' build.
 that this will not work on projects with flavours, since it will build
 all flavours and there will be no 'main' build.
-If @@<dir> is attached to <flavour>, then the gradle tasks will be run
-in that directory. This might be necessary if gradle needs to be run in
-the parent directory, in which case one would use
-'gradle=<flavour>@@..'.
 
 @item maven=yes[@@<dir>]
 
 @item maven=yes[@@<dir>]
-Build with maven instead of ant. Like gradle, an extra @@<dir> tells f-droid
-to run maven inside that relative subdirectory.
+Build with maven instead of ant. An extra @@<dir> tells f-droid to run maven
+inside that relative subdirectory. Sometimes it is needed to use @@.. so that
+builds happen correctly.
 
 @item preassemble=<task1> <task2>
 Space-separated list of gradle tasks to be run before the assemble task
 
 @item preassemble=<task1> <task2>
 Space-separated list of gradle tasks to be run before the assemble task
index 32c6602f748ed8170fa0405f9dc44e80014b074b..3870d7e3a3f2d00aadac72e2d314302840f48c7e 100644 (file)
@@ -473,17 +473,11 @@ def build_local(app, thisbuild, vcs, build_dir, output_dir, srclib_dir, extlib_d
         logging.info("Cleaning Gradle project...")
         cmd = [config['gradle'], 'clean']
 
         logging.info("Cleaning Gradle project...")
         cmd = [config['gradle'], 'clean']
 
-        if '@' in thisbuild['gradle']:
-            gradle_dir = os.path.join(root_dir, thisbuild['gradle'].split('@', 1)[1])
-            gradle_dir = os.path.normpath(gradle_dir)
-        else:
-            gradle_dir = root_dir
-
         adapt_gradle(build_dir)
         for name, number, libpath in srclibpaths:
             adapt_gradle(libpath)
 
         adapt_gradle(build_dir)
         for name, number, libpath in srclibpaths:
             adapt_gradle(libpath)
 
-        p = FDroidPopen(cmd, cwd=gradle_dir)
+        p = FDroidPopen(cmd, cwd=root_dir)
 
     elif thisbuild['type'] == 'kivy':
         pass
 
     elif thisbuild['type'] == 'kivy':
         pass
@@ -685,13 +679,7 @@ def build_local(app, thisbuild, vcs, build_dir, output_dir, srclib_dir, extlib_d
 
     elif thisbuild['type'] == 'gradle':
         logging.info("Building Gradle project...")
 
     elif thisbuild['type'] == 'gradle':
         logging.info("Building Gradle project...")
-        if '@' in thisbuild['gradle']:
-            flavours = thisbuild['gradle'].split('@')[0].split(',')
-            gradle_dir = thisbuild['gradle'].split('@')[1]
-            gradle_dir = os.path.join(root_dir, gradle_dir)
-        else:
-            flavours = thisbuild['gradle'].split(',')
-            gradle_dir = root_dir
+        flavours = thisbuild['gradle'].split(',')
 
         if len(flavours) == 1 and flavours[0] in ['main', 'yes', '']:
             flavours[0] = ''
 
         if len(flavours) == 1 and flavours[0] in ['main', 'yes', '']:
             flavours[0] = ''
@@ -711,7 +699,7 @@ def build_local(app, thisbuild, vcs, build_dir, output_dir, srclib_dir, extlib_d
         if LooseVersion('0.8') <= thisbuild['gradlepluginver'] < LooseVersion('0.11'):
             commands += ['-x', 'lintVital' + flavours_cmd + 'Release']
 
         if LooseVersion('0.8') <= thisbuild['gradlepluginver'] < LooseVersion('0.11'):
             commands += ['-x', 'lintVital' + flavours_cmd + 'Release']
 
-        p = FDroidPopen(commands, cwd=gradle_dir)
+        p = FDroidPopen(commands, cwd=root_dir)
 
     elif thisbuild['type'] == 'ant':
         logging.info("Building Ant project...")
 
     elif thisbuild['type'] == 'ant':
         logging.info("Building Ant project...")
index 0636915c3328d3c19f0cffea07422b3fbb5e9d09..e80613d1cede3f3ac6e1d7057d79ab846c64e259 100644 (file)
@@ -1196,13 +1196,6 @@ def prepare_source(vcs, app, build, build_dir, srclib_dir, extlib_dir, onserver=
                          's@compileSdkVersion *[0-9]*@compileSdkVersion ' + n + '@g',
                          'build.gradle'],
                         cwd=root_dir)
                          's@compileSdkVersion *[0-9]*@compileSdkVersion ' + n + '@g',
                          'build.gradle'],
                         cwd=root_dir)
-            if '@' in build['gradle']:
-                gradle_dir = os.path.join(root_dir, build['gradle'].split('@', 1)[1])
-                gradle_dir = os.path.normpath(gradle_dir)
-                FDroidPopen(['sed', '-i',
-                             's@compileSdkVersion *[0-9]*@compileSdkVersion ' + n + '@g',
-                             'build.gradle'],
-                            cwd=gradle_dir)
 
     # Remove forced debuggable flags
     remove_debuggable_flags(root_dir)
 
     # Remove forced debuggable flags
     remove_debuggable_flags(root_dir)