chiark / gitweb /
add MobAdMob srclib: FOSS admob replacement
authorDavid Black <david8black@gmail.com>
Sat, 20 Oct 2012 17:46:01 +0000 (18:46 +0100)
committerDavid Black <david8black@gmail.com>
Sat, 20 Oct 2012 17:46:01 +0000 (18:46 +0100)
fdroidserver/common.py

index 139aacb812a99cb2e40a4645bce67c2f6e91fc92..0eba9500787d165e6b6f826d6758a95b08760e66 100644 (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)