@@ -33,11 +33,11 @@ apply plugin: "com.android.application"
3333def isWinOs = System . properties[' os.name' ]. toLowerCase(). contains(' windows' )
3434def metadataParams = new LinkedList <String > ()
3535def allJarPaths = new LinkedList <String > ()
36- def configurationsDir = " configurations"
36+ def configurationsDir = " $p rojectDir / configurations"
3737def createPluginConfigFile = false
3838def configStage = " \n :config phase: "
3939def nodeModulesDir = " ../../node_modules/"
40- def libDir = " ../../lib/Android/"
40+ def libDir = " $p rojectDir / ../../lib/Android/"
4141def pluginNames = new ArrayList<String > ()
4242def configDir = file(configurationsDir)
4343def appResExists = false
@@ -102,7 +102,7 @@ android {
102102 }
103103
104104 sourceSets. main {
105- jniLibs. srcDir " libs/jni"
105+ jniLibs. srcDir " $p rojectDir / libs/jni"
106106 }
107107
108108 signingConfigs {
@@ -278,7 +278,7 @@ task createPluginsConfigFile {
278278task pluginExtend {
279279 description " applies additional configuration"
280280
281- def pathToAppGradle = " ../../app/App_Resources/Android/app.gradle"
281+ def pathToAppGradle = " $p rojectDir / ../../app/App_Resources/Android/app.gradle"
282282 def appGradle = file(pathToAppGradle)
283283 if (appGradle. exists()) {
284284 apply from : pathToAppGradle
@@ -310,13 +310,13 @@ task pluginExtend {
310310task copyAarDependencies (type : Copy ) {
311311 println " $configStage copyAarDependencies"
312312 from fileTree(dir : nodeModulesDir, include : [" **/*.aar" ], exclude : ' **/.bin/**' ). files
313- into " libs/aar"
313+ into " $p rojectDir / libs/aar"
314314}
315315
316316task addAarDependencies << {
317317 println " $configStage addAarDependencies"
318318 // manually traverse all the locally copied AAR files and add them to the project compilation dependencies list
319- FileTree tree = fileTree(dir : " libs/aar" , include : [" **/*.aar" ])
319+ FileTree tree = fileTree(dir : " $p rojectDir / libs/aar" , include : [" **/*.aar" ])
320320 tree. each { File file ->
321321 // remove the extension of the file (.aar)
322322 def length = file. name. length() - 4
@@ -336,7 +336,7 @@ task cleanLocalAarFiles(type: Delete) {
336336}
337337
338338task ensureMetadataOutDir {
339- def outputDir = file(" $r ootDir /metadata/output/assets/metadata" )
339+ def outputDir = file(" $p rojectDir /metadata/output/assets/metadata" )
340340 outputDir. mkdirs()
341341}
342342
@@ -361,12 +361,12 @@ task collectAllJars {
361361 }
362362
363363 metadataParams. add(" metadata-generator.jar" )
364- metadataParams. add(" .. /metadata/output/assets/metadata" )
364+ metadataParams. add(" $p rojectDir /metadata/output/assets/metadata" )
365365 for (def i = 0 ; i < allJarPaths. size(); i++ ) {
366366 metadataParams. add(allJarPaths. get(i));
367367 }
368368
369- def classesDir = " $r ootDir /build /intermediates/classes"
369+ def classesDir = " $b uildDir /intermediates/classes"
370370
371371 def classesSubDirs = new File (classesDir). listFiles()
372372
@@ -393,7 +393,7 @@ task buildMetadata (type: JavaExec) {
393393 description " builds metadata with provided jar dependencies"
394394
395395 inputs. files(allJarPaths)
396- inputs. dir(" build /intermediates/classes" )
396+ inputs. dir(" $b uildDir /intermediates/classes" )
397397
398398 outputs. files(" metadata/output/assets/metadata/treeNodeStream.dat" , " metadata/output/assets/metadata/treeStringsStream.dat" , " metadata/output/assets/metadata/treeValueStream.dat" )
399399
@@ -407,8 +407,8 @@ task buildMetadata (type: JavaExec) {
407407
408408 doLast {
409409 copy {
410- from " metadata/output/assets/metadata"
411- into " src/main/assets/metadata"
410+ from " $p rojectDir / metadata/output/assets/metadata"
411+ into " $p rojectDir / src/main/assets/metadata"
412412 }
413413
414414 def files = new File (" ${ buildDir} /intermediates/res" ). listFiles()
@@ -432,14 +432,14 @@ task buildMetadata (type: JavaExec) {
432432
433433 exec {
434434 ignoreExitValue true
435- workingDir " metadata/output"
435+ workingDir " $p rojectDir / metadata/output"
436436 commandLine removeCmdParams. toArray()
437437 }
438438
439439 def addCmdParams = new ArrayList<String > ([aaptCommand, " add" , tmpAPKPath, " assets/metadata/treeNodeStream.dat" , " assets/metadata/treeStringsStream.dat" , " assets/metadata/treeValueStream.dat" ])
440440
441441 exec {
442- workingDir " metadata/output"
442+ workingDir " $p rojectDir / metadata/output"
443443 commandLine addCmdParams. toArray()
444444 }
445445 }
0 commit comments