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:
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()
# 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)
# 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 = []
# 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'] = ''
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':
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]
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 == '.':
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'
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()
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/')
apkfilename = apkfile[5:]
- print "Processing " + apkfilename
+ if not options.quiet:
+ print "Processing " + apkfilename
thisinfo = {}
thisinfo['apkname'] = apkfilename
thisinfo['size'] = os.path.getsize(apkfile)