1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-10-03 17:50:11 +02:00

Some build and update system improvements, including the ability to set javac encoding

This commit is contained in:
Ciaran Gultnieks 2011-01-26 16:02:30 +00:00
parent e952029859
commit 50a962db31
4 changed files with 24 additions and 11 deletions

5
README
View File

@ -164,6 +164,11 @@ configuration to the build. These are:
submodules=yes Use if the project (git only) has submodules - causes git
submodule init and update to be executed after the source is
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:

View File

@ -222,6 +222,9 @@ for app in apps:
props += "\nsdk-location=" + sdkloc + "\n"
# Add ndk location...
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.write(props)
f.close()
@ -246,8 +249,8 @@ for app in apps:
# Run a pre-build command if one is required...
if thisbuild.has_key('prebuild'):
if subprocess.call(shlex.split(thisbuild['prebuild']),
cwd=root_dir) != 0:
if subprocess.call(thisbuild['prebuild'],
cwd=root_dir, shell=True) != 0:
print "Error running pre-build command"
sys.exit(1)

View File

@ -16,7 +16,7 @@
# 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/>.
def read_metadata():
def read_metadata(verbose=False):
apps = []
@ -26,7 +26,8 @@ def read_metadata():
# Get metadata...
thisinfo['id'] = metafile[9:-4]
print "Reading metadata for " + thisinfo['id']
if verbose:
print "Reading metadata for " + thisinfo['id']
thisinfo['description'] = ''
thisinfo['name'] = None
thisinfo['summary'] = ''
@ -82,7 +83,7 @@ def read_metadata():
part != "Tracking" and
part != "NonFreeNet" and
part != "NonFreeAdd"):
print "Unrecognised antifeature '" + part + "'"
print "Unrecognised antifeature '" + part + "' in "+ metafile
sys.exit(1)
thisinfo['antifeatures'] = value
elif field == 'Market Version':
@ -96,7 +97,7 @@ def read_metadata():
elif field == 'Build Version':
parts = value.split(",")
if len(parts) < 3:
print "Invalid build format: " + value
print "Invalid build format: " + value + " in " + metafile
sys.exit(1)
thisbuild = {}
thisbuild['version'] = parts[0]
@ -110,7 +111,7 @@ def read_metadata():
if value == "Yes":
thisinfo['usebuilt'] = True
else:
print "Unrecognised field " + field
print "Unrecognised field " + field + " in " + metafile
sys.exit(1)
elif mode == 1:
if line == '.':
@ -125,7 +126,7 @@ def read_metadata():
thisinfo['description'] += line
if mode == 1:
print "Description not terminated"
print "Description not terminated in " + metafile
sys.exit(1)
if len(thisinfo['description']) == 0:
thisinfo['description'] = 'No description available'

View File

@ -42,6 +42,8 @@ parser.add_option("-c", "--createmeta", action="store_true", default=False,
help="Create skeleton metadata files that are missing")
parser.add_option("-v", "--verbose", action="store_true", default=False,
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,
help="Report on build data status")
(options, args) = parser.parse_args()
@ -64,13 +66,14 @@ if (repo_url is None or repo_name is None or
sys.exit(1)
# 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
# is flagged to be included in the repo...
for app in apps:
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'] + "_*")
for file in glob.glob(src):
shutil.copy(file, 'repo/')
@ -81,7 +84,8 @@ for apkfile in glob.glob(os.path.join('repo','*.apk')):
apkfilename = apkfile[5:]
print "Processing " + apkfilename
if not options.quiet:
print "Processing " + apkfilename
thisinfo = {}
thisinfo['apkname'] = apkfilename
thisinfo['size'] = os.path.getsize(apkfile)