@@ -378,7 +378,7 @@ task collectAllJars {
378378
379379task buildMetadata (type : JavaExec ) {
380380 description " builds metadata with provided jar dependencies"
381-
381+
382382 inputs. files(allJarPaths)
383383 inputs. dir(" build/intermediates/classes" )
384384
@@ -388,7 +388,7 @@ task buildMetadata (type: JavaExec) {
388388 workingDir " build-tools"
389389
390390 main " -jar"
391-
391+
392392 // get compiled classes to pass to metadata generator
393393 // these need to be called after the classes have compiled
394394 def classesDir = " $buildDir /intermediates/classes"
@@ -429,13 +429,13 @@ task buildMetadata (type: JavaExec) {
429429
430430 args metadataParams. toArray()
431431 }
432-
432+
433433 doLast {
434434 copy {
435435 from " $projectDir /metadata/output/assets/metadata"
436436 into " $projectDir /src/main/assets/metadata"
437437 }
438-
438+
439439 def files = new File (" ${ buildDir} /intermediates/res" ). listFiles()
440440 def tmpResourceAPK = null
441441 for (File f : files) {
@@ -445,24 +445,24 @@ task buildMetadata (type: JavaExec) {
445445 break ;
446446 }
447447 }
448-
448+
449449 def aaptCommand = " ${ android.getSdkDirectory().getAbsolutePath()} /build-tools/${ android.buildToolsVersion} /aapt"
450450 if (isWinOs) {
451451 aaptCommand + = " .exe"
452452 }
453-
453+
454454 def tmpAPKPath = tmpResourceAPK. getPath()
455-
455+
456456 def removeCmdParams = new ArrayList<String > ([aaptCommand, " remove" , tmpAPKPath, " assets/metadata/treeNodeStream.dat" , " assets/metadata/treeStringsStream.dat" , " assets/metadata/treeValueStream.dat" ])
457-
457+
458458 exec {
459459 ignoreExitValue true
460460 workingDir " $projectDir /metadata/output"
461461 commandLine removeCmdParams. toArray()
462462 }
463-
463+
464464 def addCmdParams = new ArrayList<String > ([aaptCommand, " add" , tmpAPKPath, " assets/metadata/treeNodeStream.dat" , " assets/metadata/treeStringsStream.dat" , " assets/metadata/treeValueStream.dat" ])
465-
465+
466466 exec {
467467 workingDir " $projectDir /metadata/output"
468468 commandLine addCmdParams. toArray()
@@ -489,7 +489,13 @@ task deleteExplodedAarFolder (type: Delete) {
489489task setProperties {
490490 project. ext. jarFiles = []
491491 doLast {
492- project. jarFiles = allJarPaths
492+ def list = [];
493+ allJarPaths. each({f ->
494+ if (f. endsWith(" .jar" )) {
495+ list. add(f);
496+ }
497+ })
498+ project. jarFiles = list;
493499 }
494500}
495501
0 commit comments