File tree Expand file tree Collapse file tree
build-artifacts/project-template-gradle Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1919*/
2020
2121import groovy.json.JsonSlurper //used to parse package.json
22+
23+ import java.nio.file.Files ;
24+ import java.nio.file.Paths ;
25+ import java.util.regex.Pattern ;
26+
2227buildscript {
2328 repositories {
2429 jcenter()
@@ -477,9 +482,27 @@ task pluginExtend {
477482
478483// we need to copy all dependencies into a flat dir, as pointed by the repositories configurations at the top
479484task copyAarDependencies (type : Copy ) {
480- println " $configStage copyAarDependencies"
481- from fileTree(dir : nodeModulesDir, include : [" **/*.aar" ], exclude : ' **/.bin/**' ). files
485+ def filterAarFilesFn = { path , attrs ->
486+ String pathString = path. toString();
487+ def isBin = Pattern . matches(" .*/\\ .bin/.*" , pathString);
488+ def isAar = Pattern . matches(" .*\\ .aar\$ " , pathString);
489+ return ! isBin && isAar;
490+ }
491+
492+ def mapToStringFn = { path ->
493+ return path. toString();
494+ }
495+
496+ Object [] files = Files . find(
497+ Paths . get(" $nodeModulesDir " ),
498+ Integer . MAX_VALUE ,
499+ filterAarFilesFn
500+ )
501+ .map(mapToStringFn)
502+ .toArray();
503+
482504 into " $projectDir /libs/aar"
505+ from files
483506}
484507
485508task addAarDependencies {
You can’t perform that action at this time.
0 commit comments