add MobAdMob srclib: FOSS admob replacement

This commit is contained in:
David Black 2012-10-20 18:46:01 +01:00
parent 94acf0ed2b
commit cf8df0ba62

View file

@ -1170,6 +1170,24 @@ def getsrclib(spec, extlib_dir, sdk_path, basepath=False):
vcs.gotorevision(ref)
return sdir
if name == 'MobAdMob':
sdir = os.path.join(extlib_dir, 'MobAdMob')
vcs = getvcs('git',
'https://github.com/mar-v-in/MobAdMob.git', sdir, sdk_path)
vcs.gotorevision(ref)
libdir = os.path.join(sdir, 'MobAdMob')
pp = open(os.path.join(libdir, 'project.properties'), 'w')
pp.write('android.library=true\n')
pp.write('target=android-16\n')
pp.close()
if subprocess.call([os.path.join(sdk_path, 'tools', 'android'),
'update', 'project', '-p',
libdir]) != 0:
raise BuildException('Error updating MobAdMob project')
if basepath:
return sdir
return libdir
raise BuildException('Unknown srclib ' + name)