mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-04 22:40:29 +03:00
Some build and update system improvements, including the ability to set javac encoding
This commit is contained in:
parent
e952029859
commit
50a962db31
4 changed files with 24 additions and 11 deletions
5
README
5
README
|
|
@ -164,6 +164,11 @@ configuration to the build. These are:
|
||||||
submodules=yes Use if the project (git only) has submodules - causes git
|
submodules=yes Use if the project (git only) has submodules - causes git
|
||||||
submodule init and update to be executed after the source is
|
submodule init and update to be executed after the source is
|
||||||
cloned.
|
cloned.
|
||||||
|
encoding=xxxx Adds a java.encoding property to local.properties with the given
|
||||||
|
value. Generally the value will be 'utf-8'. This is picked up by
|
||||||
|
the SDK's ant rules, and forces the Java compiler to interpret
|
||||||
|
source files with this encoding. If you receive warnings during
|
||||||
|
the compile about character encodings, you probably need this.
|
||||||
|
|
||||||
Another example, using extra parameters:
|
Another example, using extra parameters:
|
||||||
|
|
||||||
|
|
|
||||||
7
build.py
7
build.py
|
|
@ -222,6 +222,9 @@ for app in apps:
|
||||||
props += "\nsdk-location=" + sdkloc + "\n"
|
props += "\nsdk-location=" + sdkloc + "\n"
|
||||||
# Add ndk location...
|
# Add ndk location...
|
||||||
props+= "\nndk.dir=" + ndk_path + "\n"
|
props+= "\nndk.dir=" + ndk_path + "\n"
|
||||||
|
# Add java.encoding if necessary...
|
||||||
|
if thisbuild.has_key('encoding'):
|
||||||
|
props += "\njava.encoding=" + thisbuild['encoding'] + "\n"
|
||||||
f = open(locprops, 'w')
|
f = open(locprops, 'w')
|
||||||
f.write(props)
|
f.write(props)
|
||||||
f.close()
|
f.close()
|
||||||
|
|
@ -246,8 +249,8 @@ for app in apps:
|
||||||
|
|
||||||
# Run a pre-build command if one is required...
|
# Run a pre-build command if one is required...
|
||||||
if thisbuild.has_key('prebuild'):
|
if thisbuild.has_key('prebuild'):
|
||||||
if subprocess.call(shlex.split(thisbuild['prebuild']),
|
if subprocess.call(thisbuild['prebuild'],
|
||||||
cwd=root_dir) != 0:
|
cwd=root_dir, shell=True) != 0:
|
||||||
print "Error running pre-build command"
|
print "Error running pre-build command"
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
|
|
||||||
13
metadata.py
13
metadata.py
|
|
@ -16,7 +16,7 @@
|
||||||
# You should have received a copy of the GNU Affero General Public License
|
# You should have received a copy of the GNU Affero General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
def read_metadata():
|
def read_metadata(verbose=False):
|
||||||
|
|
||||||
apps = []
|
apps = []
|
||||||
|
|
||||||
|
|
@ -26,7 +26,8 @@ def read_metadata():
|
||||||
|
|
||||||
# Get metadata...
|
# Get metadata...
|
||||||
thisinfo['id'] = metafile[9:-4]
|
thisinfo['id'] = metafile[9:-4]
|
||||||
print "Reading metadata for " + thisinfo['id']
|
if verbose:
|
||||||
|
print "Reading metadata for " + thisinfo['id']
|
||||||
thisinfo['description'] = ''
|
thisinfo['description'] = ''
|
||||||
thisinfo['name'] = None
|
thisinfo['name'] = None
|
||||||
thisinfo['summary'] = ''
|
thisinfo['summary'] = ''
|
||||||
|
|
@ -82,7 +83,7 @@ def read_metadata():
|
||||||
part != "Tracking" and
|
part != "Tracking" and
|
||||||
part != "NonFreeNet" and
|
part != "NonFreeNet" and
|
||||||
part != "NonFreeAdd"):
|
part != "NonFreeAdd"):
|
||||||
print "Unrecognised antifeature '" + part + "'"
|
print "Unrecognised antifeature '" + part + "' in "+ metafile
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
thisinfo['antifeatures'] = value
|
thisinfo['antifeatures'] = value
|
||||||
elif field == 'Market Version':
|
elif field == 'Market Version':
|
||||||
|
|
@ -96,7 +97,7 @@ def read_metadata():
|
||||||
elif field == 'Build Version':
|
elif field == 'Build Version':
|
||||||
parts = value.split(",")
|
parts = value.split(",")
|
||||||
if len(parts) < 3:
|
if len(parts) < 3:
|
||||||
print "Invalid build format: " + value
|
print "Invalid build format: " + value + " in " + metafile
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
thisbuild = {}
|
thisbuild = {}
|
||||||
thisbuild['version'] = parts[0]
|
thisbuild['version'] = parts[0]
|
||||||
|
|
@ -110,7 +111,7 @@ def read_metadata():
|
||||||
if value == "Yes":
|
if value == "Yes":
|
||||||
thisinfo['usebuilt'] = True
|
thisinfo['usebuilt'] = True
|
||||||
else:
|
else:
|
||||||
print "Unrecognised field " + field
|
print "Unrecognised field " + field + " in " + metafile
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
elif mode == 1:
|
elif mode == 1:
|
||||||
if line == '.':
|
if line == '.':
|
||||||
|
|
@ -125,7 +126,7 @@ def read_metadata():
|
||||||
thisinfo['description'] += line
|
thisinfo['description'] += line
|
||||||
|
|
||||||
if mode == 1:
|
if mode == 1:
|
||||||
print "Description not terminated"
|
print "Description not terminated in " + metafile
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
if len(thisinfo['description']) == 0:
|
if len(thisinfo['description']) == 0:
|
||||||
thisinfo['description'] = 'No description available'
|
thisinfo['description'] = 'No description available'
|
||||||
|
|
|
||||||
10
update.py
10
update.py
|
|
@ -42,6 +42,8 @@ parser.add_option("-c", "--createmeta", action="store_true", default=False,
|
||||||
help="Create skeleton metadata files that are missing")
|
help="Create skeleton metadata files that are missing")
|
||||||
parser.add_option("-v", "--verbose", action="store_true", default=False,
|
parser.add_option("-v", "--verbose", action="store_true", default=False,
|
||||||
help="Spew out even more information than normal")
|
help="Spew out even more information than normal")
|
||||||
|
parser.add_option("-q", "--quiet", action = "store_true", default=False,
|
||||||
|
help="No output, except for warnings and errors")
|
||||||
parser.add_option("-b", "--buildreport", action="store_true", default=False,
|
parser.add_option("-b", "--buildreport", action="store_true", default=False,
|
||||||
help="Report on build data status")
|
help="Report on build data status")
|
||||||
(options, args) = parser.parse_args()
|
(options, args) = parser.parse_args()
|
||||||
|
|
@ -64,13 +66,14 @@ if (repo_url is None or repo_name is None or
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
# Get all apps...
|
# Get all apps...
|
||||||
apps = read_metadata()
|
apps = read_metadata(verbose=options.verbose)
|
||||||
|
|
||||||
# Copy apks and source tarballs for stuff we've built from source that
|
# Copy apks and source tarballs for stuff we've built from source that
|
||||||
# is flagged to be included in the repo...
|
# is flagged to be included in the repo...
|
||||||
for app in apps:
|
for app in apps:
|
||||||
if app['usebuilt']:
|
if app['usebuilt']:
|
||||||
print "Copying built files for " + app['id']
|
if not options.quiet:
|
||||||
|
print "Copying built files for " + app['id']
|
||||||
src = os.path.join('built', app['id'] + "_*")
|
src = os.path.join('built', app['id'] + "_*")
|
||||||
for file in glob.glob(src):
|
for file in glob.glob(src):
|
||||||
shutil.copy(file, 'repo/')
|
shutil.copy(file, 'repo/')
|
||||||
|
|
@ -81,7 +84,8 @@ for apkfile in glob.glob(os.path.join('repo','*.apk')):
|
||||||
|
|
||||||
apkfilename = apkfile[5:]
|
apkfilename = apkfile[5:]
|
||||||
|
|
||||||
print "Processing " + apkfilename
|
if not options.quiet:
|
||||||
|
print "Processing " + apkfilename
|
||||||
thisinfo = {}
|
thisinfo = {}
|
||||||
thisinfo['apkname'] = apkfilename
|
thisinfo['apkname'] = apkfilename
|
||||||
thisinfo['size'] = os.path.getsize(apkfile)
|
thisinfo['size'] = os.path.getsize(apkfile)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue