@@ -199,21 +199,22 @@ dependencies {
199
199
supportVer = supportVersion
200
200
}
201
201
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
+
206
207
def sbgProjectExists = ! findProject(' :static-binding-generator' ). is(null )
207
208
if (sbgProjectExists) {
208
- provided project(' :static-binding-generator' )
209
+ compileOnly project(' :static-binding-generator' )
209
210
}
210
211
def mdgProjectExists = ! findProject(' :android-metadata-generator' ). is(null )
211
212
if (mdgProjectExists) {
212
- provided project(' :android-metadata-generator' )
213
+ compileOnly project(' :android-metadata-generator' )
213
214
}
214
215
def dtsgProjectExists = ! findProject(' :dts-generator' ). is(null )
215
216
if (dtsgProjectExists) {
216
- provided project(' :dts-generator' )
217
+ compileOnly project(' :dts-generator' )
217
218
}
218
219
219
220
def useV8Symbols = nativescriptDependencies. any {
@@ -224,10 +225,9 @@ dependencies {
224
225
if (! externalRuntimeExists) {
225
226
def runtime = useV8Symbols ? " nativescript-regular" : " nativescript-optimized"
226
227
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" ])
228
229
} else {
229
- implementation project(' :runtime' )
230
-
230
+ implementation project(path : ' :runtime' , configuration : ' default' )
231
231
}
232
232
}
233
233
@@ -242,7 +242,7 @@ task addDependenciesFromNativeScriptPlugins {
242
242
def length = aarFile. name. length() - 4
243
243
def fileName = aarFile. name[0 .. < length]
244
244
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" ])
246
246
}
247
247
248
248
def jarFiles = fileTree(dir : file(" $rootDir /${ dep.directory} /$PLATFORMS_ANDROID " ), include : [" **/*.jar" ])
@@ -265,7 +265,7 @@ task addDependenciesFromAppResourcesLibraries {
265
265
def length = aarFile. name. length() - 4
266
266
def fileName = aarFile. name[0 .. < length]
267
267
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" ])
269
269
}
270
270
271
271
def jarFiles = fileTree(dir : appResourcesLibraries, include : [" **/*.jar" ])
@@ -275,7 +275,7 @@ task addDependenciesFromAppResourcesLibraries {
275
275
pluginsJarLibraries. add(jarFile. getAbsolutePath())
276
276
}
277
277
278
- project. dependencies. add(" compile " , jarFiles)
278
+ project. dependencies. add(" implementation " , jarFiles)
279
279
}
280
280
}
281
281
@@ -348,18 +348,20 @@ def explodeAar(File compileDependency, String outputDir) {
348
348
}
349
349
350
350
task extractAllJars {
351
-
352
351
outputs. dir extractedDependenciesDir
353
352
354
353
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
+ }
356
360
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
361
363
def outputDir = java.nio.file.Paths . get(extractedDependenciesDir, " " + dependencyCounter). normalize(). toString()
362
- explodeAar(nextDependency. file , outputDir)
364
+ explodeAar(nextDependency, outputDir)
363
365
dependencyCounter++
364
366
}
365
367
}
0 commit comments