chiark
/
gitweb
/
~ianmdlvl
/
fdroidserver.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
ce25054
)
Make gradle and antcommands (previously antcommand) proper lists
author
Daniel Martí
<mvdan@mvdan.cc>
Sat, 13 Sep 2014 11:01:08 +0000
(13:01 +0200)
committer
Daniel Martí
<mvdan@mvdan.cc>
Sat, 13 Sep 2014 11:01:08 +0000
(13:01 +0200)
docs/fdroid.texi
patch
|
blob
|
history
fdroidserver/build.py
patch
|
blob
|
history
fdroidserver/checkupdates.py
patch
|
blob
|
history
fdroidserver/common.py
patch
|
blob
|
history
fdroidserver/metadata.py
patch
|
blob
|
history
diff --git
a/docs/fdroid.texi
b/docs/fdroid.texi
index c85fad9c00029451eb28c56515478dee5eb9c7c2..232f0a01422d7f9e0b7fe8af6cec482882bae78f 100644
(file)
--- a/
docs/fdroid.texi
+++ b/
docs/fdroid.texi
@@
-1006,8
+1006,8
@@
builds happen correctly.
Space-separated list of Gradle tasks to be run before the assemble task
in a Gradle project build.
Space-separated list of Gradle tasks to be run before the assemble task
in a Gradle project build.
-@item antcommand
=xxx
-Specify an alternate
Ant command
(target) instead of the default
+@item antcommand
s=<target1>[,<target2>,...]
+Specify an alternate
set of Ant commands
(target) instead of the default
'release'. It can't be given any flags, such as the path to a build.xml.
@item output=path/to/output.apk
'release'. It can't be given any flags, such as the path to a build.xml.
@item output=path/to/output.apk
diff --git
a/fdroidserver/build.py
b/fdroidserver/build.py
index b38250e4b5fd4f123b93ef24e26fe6e35ce1421f..836835de7e2bfaa8bc563553a986f1ae9cd20b5b 100644
(file)
--- a/
fdroidserver/build.py
+++ b/
fdroidserver/build.py
@@
-680,7
+680,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...")
- flavours = thisbuild['gradle']
.split(',')
+ flavours = thisbuild['gradle']
if len(flavours) == 1 and flavours[0] in ['main', 'yes', '']:
flavours[0] = ''
if len(flavours) == 1 and flavours[0] in ['main', 'yes', '']:
flavours[0] = ''
@@
-705,8
+705,8
@@
def build_local(app, thisbuild, vcs, build_dir, output_dir, srclib_dir, extlib_d
elif thisbuild['type'] == 'ant':
logging.info("Building Ant project...")
cmd = ['ant']
elif thisbuild['type'] == 'ant':
logging.info("Building Ant project...")
cmd = ['ant']
- if thisbuild['antcommand']:
- cmd +=
[thisbuild['antcommand']
]
+ if thisbuild['antcommand
s
']:
+ cmd +=
thisbuild['antcommands'
]
else:
cmd += ['release']
p = FDroidPopen(cmd, cwd=root_dir)
else:
cmd += ['release']
p = FDroidPopen(cmd, cwd=root_dir)
diff --git
a/fdroidserver/checkupdates.py
b/fdroidserver/checkupdates.py
index 4c1b57287e8b81b5e49ab0f4d0bb45b4e91c6811..9bfd1151320dc16a80e5e59141388938c58b5ed4 100644
(file)
--- a/
fdroidserver/checkupdates.py
+++ b/
fdroidserver/checkupdates.py
@@
-352,18
+352,17
@@
def fetch_autoname(app, tag):
except VCSException:
return None
except VCSException:
return None
- flavour = None
+ flavour
s
= None
if len(app['builds']) > 0:
if app['builds'][-1]['subdir']:
app_dir = os.path.join(app_dir, app['builds'][-1]['subdir'])
if app['builds'][-1]['gradle']:
if len(app['builds']) > 0:
if app['builds'][-1]['subdir']:
app_dir = os.path.join(app_dir, app['builds'][-1]['subdir'])
if app['builds'][-1]['gradle']:
- flavour = app['builds'][-1]['gradle']
- if
flavour == 'yes'
:
- flavour = None
+ flavour
s
= app['builds'][-1]['gradle']
+ if
len(flavours) == 1 and flavours[0] in ['main', 'yes', '']
:
+ flavour
s
= None
- logging.debug("...fetch auto name from " + app_dir +
- ((" (flavour: %s)" % flavour) if flavour else ""))
- new_name = common.fetch_real_name(app_dir, flavour)
+ logging.debug("...fetch auto name from " + app_dir)
+ new_name = common.fetch_real_name(app_dir, flavours)
commitmsg = None
if new_name:
logging.debug("...got autoname '" + new_name + "'")
commitmsg = None
if new_name:
logging.debug("...got autoname '" + new_name + "'")
@@
-375,7
+374,7
@@
def fetch_autoname(app, tag):
logging.debug("...couldn't get autoname")
if app['Current Version'].startswith('@string/'):
logging.debug("...couldn't get autoname")
if app['Current Version'].startswith('@string/'):
- cv = common.version_name(app['Current Version'], app_dir, flavour)
+ cv = common.version_name(app['Current Version'], app_dir, flavour
s
)
if app['Current Version'] != cv:
app['Current Version'] = cv
if not commitmsg:
if app['Current Version'] != cv:
app['Current Version'] = cv
if not commitmsg:
diff --git
a/fdroidserver/common.py
b/fdroidserver/common.py
index e884568a81df5fb491c04b977fef6e59258af5b3..6e6dfbc0d1879900d04e8c61becde629d7c292d5 100644
(file)
--- a/
fdroidserver/common.py
+++ b/
fdroidserver/common.py
@@
-825,7
+825,7
@@
def retrieve_string(app_dir, string, xmlfiles=None):
# Return list of existing files that will be used to find the highest vercode
# Return list of existing files that will be used to find the highest vercode
-def manifest_paths(app_dir, flavour):
+def manifest_paths(app_dir, flavour
s
):
possible_manifests = \
[os.path.join(app_dir, 'AndroidManifest.xml'),
possible_manifests = \
[os.path.join(app_dir, 'AndroidManifest.xml'),
@@
-833,19
+833,20
@@
def manifest_paths(app_dir, flavour):
os.path.join(app_dir, 'src', 'AndroidManifest.xml'),
os.path.join(app_dir, 'build.gradle')]
os.path.join(app_dir, 'src', 'AndroidManifest.xml'),
os.path.join(app_dir, 'build.gradle')]
- if flavour:
- possible_manifests.append(
- os.path.join(app_dir, 'src', flavour, 'AndroidManifest.xml'))
+ if flavours:
+ for flavour in flavours:
+ possible_manifests.append(
+ os.path.join(app_dir, 'src', flavour, 'AndroidManifest.xml'))
return [path for path in possible_manifests if os.path.isfile(path)]
# Retrieve the package name. Returns the name, or None if not found.
return [path for path in possible_manifests if os.path.isfile(path)]
# Retrieve the package name. Returns the name, or None if not found.
-def fetch_real_name(app_dir, flavour):
+def fetch_real_name(app_dir, flavour
s
):
app_search = re.compile(r'.*<application.*').search
name_search = re.compile(r'.*android:label="([^"]+)".*').search
app_found = False
app_search = re.compile(r'.*<application.*').search
name_search = re.compile(r'.*android:label="([^"]+)".*').search
app_found = False
- for f in manifest_paths(app_dir, flavour):
+ for f in manifest_paths(app_dir, flavour
s
):
if not has_extension(f, 'xml'):
continue
logging.debug("fetch_real_name: Checking manifest at " + f)
if not has_extension(f, 'xml'):
continue
logging.debug("fetch_real_name: Checking manifest at " + f)
@@
-866,8
+867,8
@@
def fetch_real_name(app_dir, flavour):
# Retrieve the version name
# Retrieve the version name
-def version_name(original, app_dir, flavour):
- for f in manifest_paths(app_dir, flavour):
+def version_name(original, app_dir, flavour
s
):
+ for f in manifest_paths(app_dir, flavour
s
):
if not has_extension(f, 'xml'):
continue
string = retrieve_string(app_dir, original)
if not has_extension(f, 'xml'):
continue
string = retrieve_string(app_dir, original)
@@
-1209,11
+1210,11
@@
def prepare_source(vcs, app, build, build_dir, srclib_dir, extlib_dir, onserver=
f.write(props)
f.close()
f.write(props)
f.close()
- flavour = None
+ flavour
s
= None
if build['type'] == 'gradle':
if build['type'] == 'gradle':
- flavour = build['gradle']
- if
flavour
in ['main', 'yes', '']:
- flavour = None
+ flavour
s
= build['gradle']
+ if
len(flavours) == 1 and flavours[0]
in ['main', 'yes', '']:
+ flavour
s
= None
version_regex = re.compile(r".*'com\.android\.tools\.build:gradle:([^\.]+\.[^\.]+).*'.*")
gradlepluginver = None
version_regex = re.compile(r".*'com\.android\.tools\.build:gradle:([^\.]+\.[^\.]+).*'.*")
gradlepluginver = None
@@
-1256,7
+1257,7
@@
def prepare_source(vcs, app, build, build_dir, srclib_dir, extlib_dir, onserver=
# Insert version code and number into the manifest if necessary
if build['forceversion']:
logging.info("Changing the version name")
# Insert version code and number into the manifest if necessary
if build['forceversion']:
logging.info("Changing the version name")
- for path in manifest_paths(root_dir, flavour):
+ for path in manifest_paths(root_dir, flavour
s
):
if not os.path.isfile(path):
continue
if has_extension(path, 'xml'):
if not os.path.isfile(path):
continue
if has_extension(path, 'xml'):
@@
-1275,7
+1276,7
@@
def prepare_source(vcs, app, build, build_dir, srclib_dir, extlib_dir, onserver=
raise BuildException("Failed to amend build.gradle")
if build['forcevercode']:
logging.info("Changing the version code")
raise BuildException("Failed to amend build.gradle")
if build['forcevercode']:
logging.info("Changing the version code")
- for path in manifest_paths(root_dir, flavour):
+ for path in manifest_paths(root_dir, flavour
s
):
if not os.path.isfile(path):
continue
if has_extension(path, 'xml'):
if not os.path.isfile(path):
continue
if has_extension(path, 'xml'):
diff --git
a/fdroidserver/metadata.py
b/fdroidserver/metadata.py
index 77ee09c8d55b4ced72ab8d664c740e7347337fe3..0b0106d09f62eea91b1a11ba2488e7d8be8ec145 100644
(file)
--- a/
fdroidserver/metadata.py
+++ b/
fdroidserver/metadata.py
@@
-99,7
+99,7
@@
flag_defaults = OrderedDict([
('build', ''),
('buildjni', []),
('preassemble', []),
('build', ''),
('buildjni', []),
('preassemble', []),
- ('antcommand', None),
+ ('antcommand
s
', None),
('novcheck', False),
])
('novcheck', False),
])
@@
-528,7
+528,7
@@
def metafieldtype(name):
def flagtype(name):
if name in ['extlibs', 'srclibs', 'patch', 'rm', 'buildjni',
def flagtype(name):
if name in ['extlibs', 'srclibs', 'patch', 'rm', 'buildjni',
- 'update', 'scanignore', 'scandelete']:
+ 'update', 'scanignore', 'scandelete'
, 'gradle', 'antcommands'
]:
return 'list'
if name in ['init', 'prebuild', 'build']:
return 'script'
return 'list'
if name in ['init', 'prebuild', 'build']:
return 'script'