@@ -43,8 +43,9 @@ def MDG_OUTPUT_DIR = "mdg-output-dir.txt"
43
43
def MDG_JAVA_DEPENDENCIES = " mdg-java-dependencies.txt"
44
44
def METADATA_OUT_PATH = " $projectDir /src/main/assets/metadata"
45
45
46
- // paths to jar libraries
47
- def jarLibraries = new LinkedList<String > ()
46
+ // paths to jar libraries
47
+ def pluginsJarLibraries = new LinkedList<String > ()
48
+ def allJarLibraries = new LinkedList<String > ()
48
49
49
50
// the build script will not work with previous versions of the CLI (3.1 or earlier)
50
51
def dependenciesJson = file(" $rootDir /dependencies.json" )
@@ -235,7 +236,7 @@ task addDependenciesFromNativeScriptPlugins {
235
236
jarFiles. each { jarFile ->
236
237
def jarFileAbsolutePath = jarFile. getAbsolutePath()
237
238
println " \t + adding jar plugin dependency: $jarFileAbsolutePath "
238
- jarLibraries . add(jarFile. getAbsolutePath())
239
+ pluginsJarLibraries . add(jarFile. getAbsolutePath())
239
240
}
240
241
241
242
project. dependencies. add(" implementation" , jarFiles)
@@ -258,7 +259,7 @@ task addDependenciesFromAppResourcesLibraries {
258
259
jarFiles. each { jarFile ->
259
260
def jarFileAbsolutePath = jarFile. getAbsolutePath()
260
261
println " \t + adding jar plugin dependency: $jarFileAbsolutePath "
261
- jarLibraries . add(jarFile. getAbsolutePath())
262
+ pluginsJarLibraries . add(jarFile. getAbsolutePath())
262
263
}
263
264
264
265
project. dependencies. add(" compile" , jarFiles)
@@ -360,7 +361,7 @@ task collectAllJars {
360
361
doFirst {
361
362
def allJarPaths = new LinkedList<String > ()
362
363
allJarPaths. add(androidJar)
363
- allJarPaths. addAll(jarLibraries )
364
+ allJarPaths. addAll(pluginsJarLibraries )
364
365
def ft = fileTree(dir : extractedDependenciesDir, include : " **/*.jar" )
365
366
ft. each { currentJarFile ->
366
367
allJarPaths. add(currentJarFile. getAbsolutePath())
@@ -383,6 +384,8 @@ task collectAllJars {
383
384
new File (" $BUILD_TOOLS_PATH /$SBG_OUTPUT_FILE " ). withWriter { out ->
384
385
out. println OUTPUT_JAVA_DIR
385
386
}
387
+
388
+ allJarLibraries. addAll(allJarPaths)
386
389
}
387
390
}
388
391
@@ -438,7 +441,7 @@ task generateTypescriptDefinitions(type: JavaExec) {
438
441
paramz. add(" dts-generator.jar" )
439
442
paramz. add(" -input" )
440
443
441
- for (String jarPath : project . jarFiles ) {
444
+ for (String jarPath : allJarLibraries ) {
442
445
// don't generate typings for runtime jars and classes
443
446
if (shouldIncludeDirForTypings(jarPath, includeDirs)) {
444
447
paramz. add(jarPath)
@@ -457,6 +460,8 @@ generateTypescriptDefinitions.onlyIf {
457
460
project. hasProperty(" generateTypings" ) && Boolean . parseBoolean(project. generateTypings)
458
461
}
459
462
463
+ collectAllJars. finalizedBy(generateTypescriptDefinitions)
464
+
460
465
static def shouldIncludeDirForTypings (path , includeDirs ) {
461
466
for (String p : includeDirs) {
462
467
if (path. indexOf(p) > -1 ) {
@@ -479,6 +484,7 @@ task copyTypings {
479
484
}
480
485
481
486
copyTypings. onlyIf { generateTypescriptDefinitions. didWork }
487
+ generateTypescriptDefinitions. finalizedBy(copyTypings)
482
488
483
489
task validateAppIdMatch {
484
490
doLast {
0 commit comments