Skip to content

Commit 6af48b4

Browse files
petekanevPlamen5kov
authored andcommitted
fix(project-build-script): add plugin jar libraries as arguments for the SBG and MDG
1 parent 7a312a4 commit 6af48b4

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

test-app/app/build.gradle

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ def MDG_OUTPUT_DIR = "mdg-output-dir.txt"
4343
def MDG_JAVA_DEPENDENCIES = "mdg-java-dependencies.txt"
4444
def METADATA_OUT_PATH = "$projectDir/src/main/assets/metadata"
4545

46+
//paths to jar libraries
47+
def jarLibraries = new LinkedList<String>()
48+
4649
// the build script will not work with previous versions of the CLI (3.1 or earlier)
4750
def dependenciesJson = file("$rootDir/dependencies.json")
4851
if (!dependenciesJson.exists()) {
@@ -228,12 +231,14 @@ task addDependenciesFromNativeScriptPlugins {
228231
project.dependencies.add("compile", [name: fileName, ext: "aar"])
229232
}
230233

231-
def jarFiles = fileTree(dir: file("${dep.directory}/$PLATFORMS_ANDROID"), include: ["**/*.jar"])
234+
def jarFiles = fileTree(dir: file("$rootDir/${dep.directory}/$PLATFORMS_ANDROID"), include: ["**/*.jar"])
232235
jarFiles.each { jarFile ->
233-
println "\t + adding jar plugin dependency: " + jarFile.getAbsolutePath()
236+
def jarFileAbsolutePath = jarFile.getAbsolutePath()
237+
println "\t + adding jar plugin dependency: $jarFileAbsolutePath"
238+
jarLibraries.add(jarFile.getAbsolutePath())
234239
}
235240

236-
project.dependencies.add("compile", jarFiles)
241+
project.dependencies.add("implementation", jarFiles)
237242
}
238243
}
239244

@@ -251,7 +256,9 @@ task addDependenciesFromAppResourcesLibraries {
251256

252257
def jarFiles = fileTree(dir: appResourcesLibraries, include: ["**/*.jar"])
253258
jarFiles.each { jarFile ->
254-
println "\t + adding jar library dependency: " + jarFile.getAbsolutePath()
259+
def jarFileAbsolutePath = jarFile.getAbsolutePath()
260+
println "\t + adding jar plugin dependency: $jarFileAbsolutePath"
261+
jarLibraries.add(jarFile.getAbsolutePath())
255262
}
256263

257264
project.dependencies.add("compile", jarFiles)
@@ -353,6 +360,7 @@ task collectAllJars {
353360
doFirst {
354361
def allJarPaths = new LinkedList<String>()
355362
allJarPaths.add(androidJar)
363+
allJarPaths.addAll(jarLibraries)
356364
def ft = fileTree(dir: extractedDependenciesDir, include: "**/*.jar")
357365
ft.each { currentJarFile ->
358366
allJarPaths.add(currentJarFile.getAbsolutePath())

0 commit comments

Comments
 (0)