Improved handling of Android framework archive (in particualr for Eclipse).
This commit is contained in:
parent
66491c6295
commit
333ed62072
|
@ -12,3 +12,4 @@ build
|
||||||
com.logicalhacking.dasca.dataflow/config/main.config
|
com.logicalhacking.dasca.dataflow/config/main.config
|
||||||
com.logicalhacking.dasca.dataflow/main.log*
|
com.logicalhacking.dasca.dataflow/main.log*
|
||||||
com.logicalhacking.dasca.crosslanguage/BuildCordovaCallgraph.launch
|
com.logicalhacking.dasca.crosslanguage/BuildCordovaCallgraph.launch
|
||||||
|
com.logicalhacking.dasca.crosslanguage/src/main/resources/android-26.jar
|
||||||
|
|
|
@ -63,15 +63,15 @@ task installAndroidSdk(type: Sync, dependsOn: downloadAndroidSdk) {
|
||||||
outputs.cacheIf { true }
|
outputs.cacheIf { true }
|
||||||
}
|
}
|
||||||
|
|
||||||
task copyAndroidJar(type: Sync, dependsOn: installAndroidSdk) {
|
task copyAndroidJar(type: Copy, dependsOn: installAndroidSdk) {
|
||||||
from "${installAndroidSdk.destinationDir}/platforms/${installAndroidSdk.components['platforms']}/android.jar"
|
from "${installAndroidSdk.destinationDir}/platforms/${installAndroidSdk.components['platforms']}/android.jar"
|
||||||
into temporaryDir
|
rename { "android-26.jar" }
|
||||||
|
into 'src/main/resources'
|
||||||
}
|
}
|
||||||
|
|
||||||
processResources {
|
processResources {
|
||||||
with copySpec {
|
with copySpec {
|
||||||
from copyAndroidJar
|
from copyAndroidJar
|
||||||
rename { "android-dasca.jar" }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -161,12 +161,25 @@ class CordovaCGBuilder(val apk: File, val apkUnzipDir: File) {
|
||||||
}
|
}
|
||||||
|
|
||||||
private def createJavaCallGraph = {
|
private def createJavaCallGraph = {
|
||||||
val tmpAndroidJar = File.createTempFile("android-dasca", ".jar")
|
val tmpAndroidJar = File.createTempFile("android-26", ".jar")
|
||||||
tmpAndroidJar.deleteOnExit()
|
tmpAndroidJar.deleteOnExit()
|
||||||
if (null != getClass.getClassLoader.getResource("android-dasca.jar")){
|
|
||||||
TemporaryFile.urlToFile(tmpAndroidJar, getClass.getClassLoader.getResource("android-dasca.jar"))
|
val rscDirs = List("android-26.jar")
|
||||||
|
var androidResource = null:java.net.URL
|
||||||
|
for (rsc <- rscDirs) {
|
||||||
|
if (null == androidResource) {
|
||||||
|
logger.info("Searching android framework: " + rsc)
|
||||||
|
androidResource = getClass.getClassLoader.getResource(rsc)
|
||||||
|
if (null != androidResource) {
|
||||||
|
logger.info(" Found android framework: " + rsc)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (null != androidResource){
|
||||||
|
TemporaryFile.urlToFile(tmpAndroidJar, androidResource)
|
||||||
}else{
|
}else{
|
||||||
val msg = "Please install android-dasca.jar in resources directory."
|
val msg = "Please install a suiteable android framework in the resources directory."
|
||||||
logger.error(msg);
|
logger.error(msg);
|
||||||
throw new FileNotFoundException(msg);
|
throw new FileNotFoundException(msg);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue