mirror of
https://gitlab.com/fdroid/fdroidserver.git
synced 2024-11-04 22:40:12 +01:00
Some more auto-building stuff
This commit is contained in:
parent
4681eff0ca
commit
ef071e0f6a
35
build.py
35
build.py
@ -60,9 +60,13 @@ for app in apps:
|
||||
|
||||
# Get the source code...
|
||||
if app['repotype'] == 'git':
|
||||
if subprocess.call(['git','clone',app['repo'],build_dir]) != 0:
|
||||
if subprocess.call(['git', 'clone',app['repo'], build_dir]) != 0:
|
||||
print "Git clone failed"
|
||||
sys.exit(1)
|
||||
elif app['repotype'] == 'svn':
|
||||
if subprocess.call(['svn', 'checkout', app['repo'], build_dir]) != 0:
|
||||
print "Svn checkout failed"
|
||||
sys.exit(1)
|
||||
else:
|
||||
print "Invalid repo type " + app['repotype'] + " in " + app['id']
|
||||
sys.exit(1)
|
||||
@ -71,42 +75,57 @@ for app in apps:
|
||||
|
||||
print "Building version " + thisbuild['version']
|
||||
|
||||
# Optionally, the actual app source can be in a subdirectory...
|
||||
if thisbuild.has_key('subdir'):
|
||||
root_dir = os.path.join(build_dir, thisbuild['subdir'])
|
||||
else:
|
||||
root_dir = build_dir
|
||||
|
||||
if app['repotype'] == 'git':
|
||||
if subprocess.call(['git','checkout',thisbuild['commit']],
|
||||
if subprocess.call(['git', 'checkout', thisbuild['commit']],
|
||||
cwd=build_dir) != 0:
|
||||
print "Git checkout failed"
|
||||
sys.exit(1)
|
||||
elif app['repotype'] == 'svn':
|
||||
if subprocess.call(['svn', 'update', '-r', thisbuild['commit']],
|
||||
cwd=build_dir) != 0:
|
||||
print "Svn update failed"
|
||||
sys.exit(1)
|
||||
else:
|
||||
print "Invalid repo type " + app['repotype']
|
||||
sys.exit(1)
|
||||
|
||||
# Generate (or update) the ant build file, build.xml...
|
||||
if subprocess.call(['android','update','project','-p','.'],
|
||||
cwd=build_dir) != 0:
|
||||
parms = ['android','update','project','-p','.']
|
||||
parms.append('--subprojects')
|
||||
if thisbuild.has_key('target'):
|
||||
parms.append('-t')
|
||||
parms.append(thisbuild['target'])
|
||||
if subprocess.call(parms, cwd=root_dir) != 0:
|
||||
print "Failed to update project"
|
||||
sys.exit(1)
|
||||
|
||||
# If the app has ant set up to sign the release, we need to switch
|
||||
# that off, because we want the unsigned apk...
|
||||
if os.path.exists(os.path.join(build_dir, 'build.properties')):
|
||||
if os.path.exists(os.path.join(root_dir, 'build.properties')):
|
||||
if subprocess.call(['sed','-i','s/^key.store/#/',
|
||||
'build.properties'], cwd=build_dir) !=0:
|
||||
print "Failed to amend build.properties"
|
||||
sys.exit(1)
|
||||
|
||||
# Build the release...
|
||||
p = subprocess.Popen(['ant','release'], cwd=build_dir,
|
||||
p = subprocess.Popen(['ant','release'], cwd=root_dir,
|
||||
stdout=subprocess.PIPE)
|
||||
output = p.communicate()[0]
|
||||
print output
|
||||
if p.returncode != 0:
|
||||
print output
|
||||
print "Build failed"
|
||||
sys.exit(1)
|
||||
|
||||
# Find the apk name in the output...
|
||||
src = re.match(r".*^.*Creating (\S+) for release.*$.*", output,
|
||||
re.S|re.M).group(1)
|
||||
src = os.path.join(os.path.join(build_dir, 'bin'), src)
|
||||
src = os.path.join(os.path.join(root_dir, 'bin'), src)
|
||||
|
||||
# By way of a sanity check, make sure the version and version
|
||||
# code in our new apk match what we expect...
|
||||
|
116
metadata.py
116
metadata.py
@ -42,62 +42,70 @@ def read_metadata():
|
||||
f = open(metafile, 'r')
|
||||
mode = 0
|
||||
for line in f.readlines():
|
||||
line = line.rstrip('\r\n')
|
||||
if len(line) == 0:
|
||||
pass
|
||||
elif mode == 0:
|
||||
index = line.find(':')
|
||||
if index == -1:
|
||||
print "Invalid metadata in " + metafile + " at:" + line
|
||||
sys.exit(1)
|
||||
field = line[:index]
|
||||
value = line[index+1:]
|
||||
if field == 'Description':
|
||||
mode = 1
|
||||
elif field == 'Summary':
|
||||
thisinfo['summary'] = value
|
||||
elif field == 'Source Code':
|
||||
thisinfo['source'] = value
|
||||
elif field == 'License':
|
||||
thisinfo['license'] = value
|
||||
elif field == 'Web Site':
|
||||
thisinfo['web'] = value
|
||||
elif field == 'Issue Tracker':
|
||||
thisinfo['tracker'] = value
|
||||
elif field == 'Disabled':
|
||||
thisinfo['disabled'] = value
|
||||
elif field == 'Market Version':
|
||||
thisinfo['marketversion'] = value
|
||||
elif field == 'Market Version Code':
|
||||
thisinfo['marketvercode'] = value
|
||||
elif field == 'Repo Type':
|
||||
thisinfo['repotype'] = value
|
||||
elif field == 'Repo':
|
||||
thisinfo['repo'] = value
|
||||
elif field == 'Build Version':
|
||||
parts = value.split(",")
|
||||
if len(parts) != 3:
|
||||
print "Invalid build format: " + value
|
||||
if not line.startswith("#"):
|
||||
line = line.rstrip('\r\n')
|
||||
if len(line) == 0:
|
||||
pass
|
||||
elif mode == 0:
|
||||
index = line.find(':')
|
||||
if index == -1:
|
||||
print "Invalid metadata in " + metafile + " at:" + line
|
||||
sys.exit(1)
|
||||
thisbuild = {}
|
||||
thisbuild['version'] = parts[0]
|
||||
thisbuild['vercode'] = parts[1]
|
||||
thisbuild['commit'] = parts[2]
|
||||
thisinfo['builds'].append(thisbuild)
|
||||
else:
|
||||
print "Unrecognised field " + field
|
||||
sys.exit(1)
|
||||
elif mode == 1:
|
||||
if line == '.':
|
||||
mode = 0
|
||||
else:
|
||||
if len(line) == 0:
|
||||
thisinfo['description'] += '\n\n'
|
||||
field = line[:index]
|
||||
value = line[index+1:]
|
||||
if field == 'Description':
|
||||
mode = 1
|
||||
elif field == 'Summary':
|
||||
thisinfo['summary'] = value
|
||||
elif field == 'Source Code':
|
||||
thisinfo['source'] = value
|
||||
elif field == 'License':
|
||||
thisinfo['license'] = value
|
||||
elif field == 'Web Site':
|
||||
thisinfo['web'] = value
|
||||
elif field == 'Issue Tracker':
|
||||
thisinfo['tracker'] = value
|
||||
elif field == 'Disabled':
|
||||
thisinfo['disabled'] = value
|
||||
elif field == 'Market Version':
|
||||
thisinfo['marketversion'] = value
|
||||
elif field == 'Market Version Code':
|
||||
thisinfo['marketvercode'] = value
|
||||
elif field == 'Repo Type':
|
||||
thisinfo['repotype'] = value
|
||||
elif field == 'Repo':
|
||||
thisinfo['repo'] = value
|
||||
elif field == 'Build Version':
|
||||
parts = value.split(",")
|
||||
if len(parts) < 3:
|
||||
print "Invalid build format: " + value
|
||||
sys.exit(1)
|
||||
thisbuild = {}
|
||||
thisbuild['version'] = parts[0]
|
||||
thisbuild['vercode'] = parts[1]
|
||||
thisbuild['commit'] = parts[2]
|
||||
for p in parts[3:]:
|
||||
pp = p.split('=')
|
||||
thisbuild[pp[0]] = pp[1]
|
||||
thisinfo['builds'].append(thisbuild)
|
||||
else:
|
||||
if (not thisinfo['description'].endswith('\n') and
|
||||
len(thisinfo['description']) > 0):
|
||||
thisinfo['description'] += ' '
|
||||
thisinfo['description'] += line
|
||||
print "Unrecognised field " + field
|
||||
sys.exit(1)
|
||||
elif mode == 1:
|
||||
if line == '.':
|
||||
mode = 0
|
||||
else:
|
||||
if len(line) == 0:
|
||||
thisinfo['description'] += '\n\n'
|
||||
else:
|
||||
if (not thisinfo['description'].endswith('\n') and
|
||||
len(thisinfo['description']) > 0):
|
||||
thisinfo['description'] += ' '
|
||||
thisinfo['description'] += line
|
||||
|
||||
if mode == 1:
|
||||
print "Description not terminated"
|
||||
sys.exit(1)
|
||||
if len(thisinfo['description']) == 0:
|
||||
thisinfo['description'] = 'No description available'
|
||||
|
||||
|
@ -8,5 +8,13 @@ Anki is a program which makes remembering things easy. Because it is a lot more
|
||||
efficient than traditional study methods, you can either greatly decrease your time
|
||||
spent studying, or greatly increase the amount you learn. AnkiDroid is the Android
|
||||
port of Anki, and is compatible with Anki data.
|
||||
.
|
||||
|
||||
Market Version:0.4.2
|
||||
Market Version Code:12
|
||||
|
||||
Repo Type:git
|
||||
Repo:git://github.com/nicolas-raoul/Anki-Android.git
|
||||
|
||||
Build Version:0.4.2,12,v0.4.2
|
||||
|
||||
|
@ -5,5 +5,14 @@ Issue Tracker:
|
||||
Summary:Client for Libre.fm
|
||||
Description:
|
||||
A streaming radio player client for Libre.fm.
|
||||
.
|
||||
|
||||
Market Version:1.4
|
||||
Market Version Code:4
|
||||
|
||||
Repo Type:git
|
||||
Repo:git://gitorious.org/foocorp/gnu-fm.git
|
||||
|
||||
Build Version:1.4,4,926fde6d208190a1fffef12a47bb231f908125e8,subdir=clients/libredroid
|
||||
Build Version:1.2,3,4ebfcf224745ca443a308463721e4f8001293f15,subdir=clients/libredroid
|
||||
|
||||
|
@ -8,3 +8,11 @@ An SSH client.
|
||||
.
|
||||
Market Version:1.7.1
|
||||
Market Version Code:323
|
||||
Repo Type:git
|
||||
Repo:git://github.com/kruton/connectbot.git
|
||||
|
||||
Build Version:1.7.1,323,19fbcefef5251cdfac97
|
||||
|
||||
#Can't build this version with SDK tools r7 due to build.xml issues
|
||||
#Build Version:1.7.0,314,5fbae7cc763edf1056c4
|
||||
|
||||
|
@ -7,5 +7,15 @@ Description:
|
||||
An FTP server allowing remote access to files on your SD card (or any files on the
|
||||
device, optionally, if you have root access).
|
||||
.
|
||||
|
||||
Market Version:1.24
|
||||
Market Version Code:17
|
||||
Repo Type:svn
|
||||
Repo:http://swiftp.googlecode.com/svn/trunk/
|
||||
|
||||
#Can't build this version - see http://code.google.com/p/swiftp/issues/detail?id=128
|
||||
#Build Version:1.24,17,69,target=android-3
|
||||
|
||||
#Can't build this version - res/values/strings.xml:117: error: Apostrophe not preceded by \
|
||||
#Build Version:1.23,15,66,target=android-3
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user