@@ -39,7 +39,7 @@ def configStage = "\n:config phase: "
39
39
def nodeModulesDir = " ../../node_modules/"
40
40
def libDir = " ../../lib/Android/"
41
41
def pluginNames = new ArrayList<String > ()
42
- def configDir = file(nodeModulesDir )
42
+ def configDir = file(configurationsDir )
43
43
def appResExists = false
44
44
def appResourcesName = " NativescriptAppResources"
45
45
@@ -69,25 +69,24 @@ def computeBuildToolsVersion() {
69
69
return " 22.0.1"
70
70
}
71
71
}
72
-
73
72
project. ext. selectedBuildType = project. hasProperty(" release" ) ? " release" : " debug"
74
73
75
74
def renameResultApks (variant ) {
76
75
def name
77
- variant. outputs. each { output ->
76
+ variant. outputs. each { output ->
78
77
79
- def apkDirectory = output. packageApplication. outputFile. parentFile
78
+ def apkDirectory = output. packageApplication. outputFile. parentFile
80
79
def apkNamePrefix = rootProject. name + " -" + variant. buildType. name
81
80
82
- name = apkNamePrefix + " -unaligned.apk"
83
- output. packageApplication. outputFile = new File (apkDirectory, name);
84
-
85
- if (output. packageApplication && (project. ext. selectedBuildType == variant. buildType. name)) {
86
- project. ext. currentApkFile = output. packageApplication. outputFile. getAbsolutePath(). replace(' \\ ' , ' /' )
81
+ if (output. zipAlign) {
82
+ name = apkNamePrefix + " .apk"
83
+ output. outputFile = new File (apkDirectory, name);
87
84
}
88
- }
89
- }
90
85
86
+ name = apkNamePrefix + " -unaligned.apk"
87
+ output. packageApplication. outputFile = new File (apkDirectory, name);
88
+ }
89
+ }
91
90
92
91
// //////////////////////////////////////////////////////////////////////////////////
93
92
// /////////////////////////// CONFIGURATIONS ///////////////////////////////////////
@@ -391,7 +390,20 @@ task buildMetadata (type: JavaExec) {
391
390
}
392
391
393
392
doLast {
394
- def tmpResourceAPK = new File (" ${ buildDir} /intermediates/res/resources-${ project.ext.selectedBuildType} .ap_" )
393
+ copy {
394
+ from " metadata/output/assets/metadata"
395
+ into " src/main/assets/metadata"
396
+ }
397
+
398
+ def files = new File (" ${ buildDir} /intermediates/res" ). listFiles()
399
+ def tmpResourceAPK = null
400
+ for (File f : files) {
401
+ def name = f. getName();
402
+ if (name. endsWith(" .ap_" )) {
403
+ tmpResourceAPK = f;
404
+ break ;
405
+ }
406
+ }
395
407
396
408
def aaptCommand = " ${ android.getSdkDirectory().getAbsolutePath()} /build-tools/${ android.buildToolsVersion} /aapt"
397
409
if (isWinOs) {
@@ -477,3 +489,4 @@ task buildapk {
477
489
478
490
dependsOn deleteExplodedAarFolder
479
491
}
492
+
0 commit comments