Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 25 additions & 2 deletions build-artifacts/project-template-gradle/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@
*/

import groovy.json.JsonSlurper //used to parse package.json

import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.regex.Pattern;

buildscript {
repositories {
jcenter()
Expand Down Expand Up @@ -477,9 +482,27 @@ task pluginExtend {

// we need to copy all dependencies into a flat dir, as pointed by the repositories configurations at the top
task copyAarDependencies (type: Copy) {
println "$configStage copyAarDependencies"
from fileTree(dir: nodeModulesDir, include: ["**/*.aar"], exclude: '**/.bin/**').files
def filterAarFilesFn = { path, attrs ->
String pathString = path.toString();
def isBin = Pattern.matches(".*/\\.bin/.*", pathString);
def isAar = Pattern.matches(".*\\.aar\$", pathString);
return !isBin && isAar;
}

def mapToStringFn = { path ->
return path.toString();
}

Object[] files = Files.find(
Paths.get("$nodeModulesDir"),
Integer.MAX_VALUE,
filterAarFilesFn
)
.map(mapToStringFn)
.toArray();

into "$projectDir/libs/aar"
from files
}

task addAarDependencies {
Expand Down