bindir = os.path.join(root_dir, 'target')
else:
bindir = os.path.join(root_dir, 'bin')
- if thisbuild.get('initfun', 'no') == "yes":
- # Special case (again!) for funambol...
- src = ("funambol-android-sync-client-" +
- thisbuild['version'] + "-unsigned.apk")
- src = os.path.join(bindir, src)
- elif 'maven' in thisbuild:
+ if 'maven' in thisbuild:
m = re.match(r".*^\[INFO\] .*apkbuilder.*/([^/]*)\.apk",
p.stdout_apk, re.S|re.M)
if not m:
}
""")
- # Special case init functions for funambol...
- if build.get('initfun', 'no') == "yes":
-
- if subprocess.call(['sed','-i','s@' +
- '<taskdef resource="net/sf/antcontrib/antcontrib.properties" />' +
- '@' +
- '<taskdef resource="net/sf/antcontrib/antcontrib.properties">' +
- '<classpath>' +
- '<pathelement location="/usr/share/java/ant-contrib.jar"/>' +
- '</classpath>' +
- '</taskdef>' +
- '@g',
- 'build.xml'], cwd=root_dir) !=0:
- raise BuildException("Failed to amend build.xml")
-
- if subprocess.call(['sed','-i','s@' +
- '\${user.home}/funambol/build/android/build.properties' +
- '@' +
- 'build.properties' +
- '@g',
- 'build.xml'], cwd=root_dir) !=0:
- raise BuildException("Failed to amend build.xml")
-
- buildxml = os.path.join(root_dir, 'build.xml')
- f = open(buildxml, 'r')
- xml = f.read()
- f.close()
- xmlout = ""
- mode = 0
- for line in xml.splitlines():
- if mode == 0:
- if line.find("jarsigner") != -1:
- mode = 1
- else:
- xmlout += line + "\n"
- else:
- if line.find("/exec") != -1:
- mode += 1
- if mode == 3:
- mode =0
- f = open(buildxml, 'w')
- f.write(xmlout)
- f.close()
-
- if subprocess.call(['sed','-i','s@' +
- 'platforms/android-2.0' +
- '@' +
- 'platforms/android-8' +
- '@g',
- 'build.xml'], cwd=root_dir) !=0:
- raise BuildException("Failed to amend build.xml")
-
- shutil.copyfile(
- os.path.join(root_dir, "build.properties.example"),
- os.path.join(root_dir, "build.properties"))
-
- if subprocess.call(['sed','-i','s@' +
- 'javacchome=.*'+
- '@' +
- 'javacchome=' + javacc_path +
- '@g',
- 'build.properties'], cwd=root_dir) !=0:
- raise BuildException("Failed to amend build.properties")
-
- if subprocess.call(['sed','-i','s@' +
- 'sdk-folder=.*'+
- '@' +
- 'sdk-folder=' + sdk_path +
- '@g',
- 'build.properties'], cwd=root_dir) !=0:
- raise BuildException("Failed to amend build.properties")
-
- if subprocess.call(['sed','-i','s@' +
- 'android.sdk.version.*'+
- '@' +
- 'android.sdk.version=2.0' +
- '@g',
- 'build.properties'], cwd=root_dir) !=0:
- raise BuildException("Failed to amend build.properties")
return (root_dir, srclibpaths)