@@ -199,21 +199,22 @@ dependencies {
199199 supportVer = supportVersion
200200 }
201201
202- compile " com.android.support:multidex:1.0.2"
203- compile " com.android.support:support-v4:$supportVer "
204- compile " com.android.support:appcompat-v7:$supportVer "
205- debugCompile " com.android.support:design:$supportVer "
202+ implementation " com.android.support:multidex:1.0.2"
203+ implementation " com.android.support:support-v4:$supportVer "
204+ implementation " com.android.support:appcompat-v7:$supportVer "
205+ debugImplementation " com.android.support:design:$supportVer "
206+
206207 def sbgProjectExists = ! findProject(' :static-binding-generator' ). is(null )
207208 if (sbgProjectExists) {
208- provided project(' :static-binding-generator' )
209+ compileOnly project(' :static-binding-generator' )
209210 }
210211 def mdgProjectExists = ! findProject(' :android-metadata-generator' ). is(null )
211212 if (mdgProjectExists) {
212- provided project(' :android-metadata-generator' )
213+ compileOnly project(' :android-metadata-generator' )
213214 }
214215 def dtsgProjectExists = ! findProject(' :dts-generator' ). is(null )
215216 if (dtsgProjectExists) {
216- provided project(' :dts-generator' )
217+ compileOnly project(' :dts-generator' )
217218 }
218219
219220 def useV8Symbols = nativescriptDependencies. any {
@@ -224,10 +225,9 @@ dependencies {
224225 if (! externalRuntimeExists) {
225226 def runtime = useV8Symbols ? " nativescript-regular" : " nativescript-optimized"
226227 println " \t + adding nativescript runtime package dependency: $runtime "
227- project. dependencies. add(" compile " , [name : runtime, ext : " aar" ])
228+ project. dependencies. add(" implementation " , [name : runtime, ext : " aar" ])
228229 } else {
229- implementation project(' :runtime' )
230-
230+ implementation project(path : ' :runtime' , configuration : ' default' )
231231 }
232232}
233233
@@ -242,7 +242,7 @@ task addDependenciesFromNativeScriptPlugins {
242242 def length = aarFile. name. length() - 4
243243 def fileName = aarFile. name[0 .. < length]
244244 println " \t + adding aar plugin dependency: " + aarFile. getAbsolutePath()
245- project. dependencies. add(" compile " , [name : fileName, ext : " aar" ])
245+ project. dependencies. add(" implementation " , [name : fileName, ext : " aar" ])
246246 }
247247
248248 def jarFiles = fileTree(dir : file(" $rootDir /${ dep.directory} /$PLATFORMS_ANDROID " ), include : [" **/*.jar" ])
@@ -265,7 +265,7 @@ task addDependenciesFromAppResourcesLibraries {
265265 def length = aarFile. name. length() - 4
266266 def fileName = aarFile. name[0 .. < length]
267267 println " \t + adding aar library dependency: " + aarFile. getAbsolutePath()
268- project. dependencies. add(" compile " , [name : fileName, ext : " aar" ])
268+ project. dependencies. add(" implementation " , [name : fileName, ext : " aar" ])
269269 }
270270
271271 def jarFiles = fileTree(dir : appResourcesLibraries, include : [" **/*.jar" ])
@@ -275,7 +275,7 @@ task addDependenciesFromAppResourcesLibraries {
275275 pluginsJarLibraries. add(jarFile. getAbsolutePath())
276276 }
277277
278- project. dependencies. add(" compile " , jarFiles)
278+ project. dependencies. add(" implementation " , jarFiles)
279279 }
280280}
281281
@@ -348,18 +348,20 @@ def explodeAar(File compileDependency, String outputDir) {
348348}
349349
350350task extractAllJars {
351-
352351 outputs. dir extractedDependenciesDir
353352
354353 doLast {
355- def iter = configurations. compile. resolvedConfiguration. resolvedArtifacts. iterator()
354+ def iter;
355+ if (project. selectedBuildType == " release" ) {
356+ iter = configurations. releaseCompileClasspath. resolve()
357+ } else {
358+ iter = configurations. debugCompileClasspath. resolve()
359+ }
356360 def dependencyCounter = 0
357- while (iter. hasNext()) {
358- // declaring variable as specific class for getting code completion in Android Studio
359- org.gradle.api.internal.artifacts.DefaultResolvedArtifact nextDependency = iter. next()
360-
361+ iter. each {
362+ def nextDependency = it
361363 def outputDir = java.nio.file.Paths . get(extractedDependenciesDir, " " + dependencyCounter). normalize(). toString()
362- explodeAar(nextDependency. file , outputDir)
364+ explodeAar(nextDependency, outputDir)
363365 dependencyCounter++
364366 }
365367 }
0 commit comments