from yaml import Loader
YamlLoader = Loader
-# use the C implementation when available
-import xml.etree.cElementTree as ElementTree
-
import fdroidserver.common
srclibs = None
for metadatapath in sorted(glob.glob(os.path.join('metadata', '*.txt'))
+ glob.glob(os.path.join('metadata', '*.json'))
- + glob.glob(os.path.join('metadata', '*.xml'))
+ glob.glob(os.path.join('metadata', '*.yml'))
+ glob.glob('.fdroid.json')
- + glob.glob('.fdroid.xml')
+ glob.glob('.fdroid.yml')):
packageName, _ = fdroidserver.common.get_extension(os.path.basename(metadatapath))
if packageName in apps:
parse_txt_metadata(mf, app)
elif ext == 'json':
parse_json_metadata(mf, app)
- elif ext == 'xml':
- parse_xml_metadata(mf, app)
elif ext == 'yml':
parse_yaml_metadata(mf, app)
else:
return app
-def parse_xml_metadata(mf, app):
-
- tree = ElementTree.ElementTree(file=mf)
- root = tree.getroot()
-
- if root.tag != 'resources':
- warn_or_exception('resources file does not have root element <resources/>')
-
- for child in root:
- if child.tag != 'builds':
- # builds does not have name="" attrib
- name = child.attrib['name']
-
- if child.tag == 'string':
- app.set_field(name, child.text)
- elif child.tag == 'string-array':
- for item in child:
- app.append_field(name, item.text)
- elif child.tag == 'builds':
- for b in child:
- build = Build()
- for key in b:
- build.set_flag(key.tag, key.text)
- app.builds.append(build)
-
- # TODO handle this using <xsd:element type="xsd:boolean> in a schema
- if not isinstance(app.RequiresRoot, bool):
- app.RequiresRoot = app.RequiresRoot == 'true'
-
- return app
-
-
def parse_yaml_metadata(mf, app):
yamlinfo = yaml.load(mf, Loader=YamlLoader)
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-
-<resources>
- <string-array name="AntiFeatures">
- <item>Tracking</item>
- <item>NonFreeNet</item>
- </string-array>
-
- <string-array name="Categories">
- <item>Navigation</item>
- </string-array>
-
- <string name="License">GPLv3</string>
- <string name="Web Site">http://osmand.net</string>
- <string name="Source Code">https://github.com/osmandapp/Osmand</string>
- <string name="Issue Tracker">https://github.com/osmandapp/Osmand/issues</string>
- <string name="Donate">https://code.google.com/p/osmand/#Please_support_the_project</string>
-
- <string name="Name">OsmAnd~</string>
- <string name="Summary">Offline/online maps and navigation</string>
- <string name="Description">Osmand~'s features can be extended by enabling the plugins via the settings,
-which include online maps from many sources, tracking, OpenStreetMap (OSM) editing and
-accessibility enhancements.
-
-Map data of both vector and raster types can be stored on the phone memory
-card for offline usage, and navigation by default uses offline methods. Map
-data packages for many territories can be downloaded from within the app and
-there is a desktop program available on the website as well for creating your
-own.
-
-Anti-Features: Tracking - It will send your device and application specs to an
-Analytics server upon downloading the list of maps you can download.
-
-[https://osmandapp.github.io/changes.html Changelog]
-</string>
-
- <string name="Repo Type">git</string>
- <string name="Repo">https://github.com/mvdan/OsmAnd-submodules</string>
-<!-- <string name="Repo">https://github.com/osmandapp/Osmand</string/ -->
-
-<!--
-# Old builds with the old repo
-#Build:0.6.5,34
-# commit=v0.6.5
-# subdir=OsmAnd
-# encoding=utf-8
-# prebuild=mkdir assets && \
-# mkdir raw
-#
-#Build:0.6.6,36
-# commit=v0.6.6_2
-# subdir=OsmAnd
-# encoding=utf-8
-# prebuild=mkdir raw
-#
-#Build:0.6.7,37
-# commit=v0.6.7
-# subdir=OsmAnd
-# encoding=utf-8
-# patch=code37.patch
-# prebuild=mkdir raw
-#
-#Build:0.6.8,39
-# commit=v0.6.8
-# subdir=OsmAnd
-# encoding=utf-8
-# prebuild=mkdir raw
-#
-#Build:0.6.8',41
-# disable=No corresponding source for whatever this is
-# commit=unknown - see disabled
-#
-#Build:0.6.9,42
-# commit=v0.6.9
-# subdir=OsmAnd
-# encoding=utf-8
-# prebuild=mkdir raw
-#
-#Build:0.6.9',43
-# disable=No corresponding source for whatever this is
-# commit=unknown - see disabled
-#
-#Build:0.8.1,65
-# commit=d62472532d8
-# subdir=OsmAnd
-# target=android-8
-# init=rm -f build.xml
-# encoding=utf-8
-# forceversion=yes
-# prebuild=cd ../DataExtractionOSM && \
-# ant compile build && \
-# cd ../OsmAnd/ && \
-# cp ../DataExtractionOSM/build/OsmAndMapCreator.jar libs/ && \
-# zip -d libs/OsmAndMapCreator.jar net/osmand/LogUtil.class && \
-# cp -r ../DataExtractionOSM/build/lib/ libs/
-# buildjni=no
-#
-#Build:0.8.2,71
-# commit=50a4733475cd
-# subdir=OsmAnd
-# submodules=yes
-# target=android-8
-# init=rm -f build.xml
-# encoding=utf-8
-# forceversion=yes
-# forcevercode=yes
-# prebuild=cd ../DataExtractionOSM && \
-# ant compile build && \
-# cd ../OsmAnd/ && \
-# sed -i 's/app_version">[^<]*/app_version">0.8.2-fdroid/' res/values/no_translate.xml && \
-# cp ../DataExtractionOSM/build/OsmAndMapCreator.jar libs/ && \
-# zip -d libs/OsmAndMapCreator.jar net/osmand/LogUtil.class && \
-# cp -r ../DataExtractionOSM/build/lib/ libs/
-# buildjni=yes
--->
-
-<builds>
-
- <build>
- <versionCode>182</versionCode>
- <versionName>1.8.2</versionName>
- <commit>76ada6c8a08afe69acb755503373ac36328ef665</commit>
- <subdir>android/OsmAnd</subdir>
- <submodules>true</submodules>
- <output>bin/OsmAnd-release-unsigned.apk</output>
- <prebuild>sed -i 's/"OsmAnd+"/"OsmAnd~"/g' build.xml</prebuild>
- <build>./old-ndk-build.sh && ant -Dsdk.dir="$ANDROID_SDK" -Dndk.dir="$ANDROID_NDK" -DBLACKBERRY_BUILD=false -DBUILD_SUFFIX= -DAPK_NUMBER_VERSION=182 "-DFEATURES=+play_market +gps_status -parking_plugin -blackberry -amazon -route_nav" -DCLEAN_CPP=false -DPACKAGE_TO_BUILT=net.osmand.plus -DAPK_VERSION=1.8.2 -Dnet.osmand.plus= -Dbuild.version=1.8.2 -Dbuild.version.code=182 -Dnativeoff=false "-DversionFeatures=+play_market +gps_status -parking_plugin -blackberry -amazon -route_nav" clean release</build>
- <buildjni>no</buildjni>
- </build>
-
- <build>
- <versionName>1.8.3</versionName>
- <versionCode>183</versionCode>
- <commit>1.8.3</commit>
- <subdir>android/OsmAnd</subdir>
- <submodules>true</submodules>
- <output>bin/OsmAnd-release-unsigned.apk</output>
- <build>../../build</build>
- <buildjni>no</buildjni>
- </build>
-
- <build>
- <versionName>1.9.4</versionName>
- <versionCode>196</versionCode>
- <commit>1.9.4</commit>
- <subdir>android/OsmAnd</subdir>
- <submodules>true</submodules>
- <output>bin/OsmAnd-release-unsigned.apk</output>
- <build>../../build</build>
- <buildjni>no</buildjni>
- <ndk>r10d</ndk>
- </build>
-
- <build>
- <versionName>1.9.5</versionName>
- <versionCode>197</versionCode>
- <commit>1.9.5</commit>
- <subdir>android/OsmAnd</subdir>
- <submodules>true</submodules>
- <output>bin/OsmAnd-release-unsigned.apk</output>
- <build>../../build</build>
- <buildjni>no</buildjni>
- <ndk>r10d</ndk>
- </build>
-
-</builds>
-
- <string name="Maintainer Notes">
-No UCMs apply because git never contains actual releases, only pre-releses.
-
-The build instructions have been moved to a script in the root of the repo,
-'build'. This way it can be updated along with the submodules.
- </string>
-
- <string name="Auto Update Mode">None</string>
- <string name="Update Check Mode">None</string>
- <string name="Current Version">1.9.5</string>
- <string name="Current Version Code">197</string>
-
-</resources>
\ No newline at end of file