|
12 | 12 | * |
13 | 13 | * -PtargetSdk=[target_sdk] |
14 | 14 | * -PbuildToolsVersion=[build_tools_version] |
15 | | -* -PsupportVersion=[support_version] |
16 | 15 | * -PcompileSdk=[compile_sdk_version] |
| 16 | +* -PandroidXLegacy=[androidx_legacy_version] |
| 17 | +* -PandroidXAppCompat=[androidx_appcompat_version] |
| 18 | +* -PandroidXMaterial=[androidx_material_version] |
17 | 19 | */ |
18 | 20 |
|
19 | 21 | import groovy.json.JsonSlurper |
@@ -304,40 +306,27 @@ repositories { |
304 | 306 | } |
305 | 307 |
|
306 | 308 | dependencies { |
307 | | - def supportVer = "28.0.0" |
308 | | - if (project.hasProperty("supportVersion")) { |
309 | | - supportVer = supportVersion |
| 309 | + def androidXLegacyVersion = "1.0.0" |
| 310 | + if (project.hasProperty("androidXLegacy")) { |
| 311 | + androidXLegacyVersion = androidXLegacy |
310 | 312 | } |
311 | | - if (project.hasProperty("useAndroidX") && (useAndroidX || useAndroidX.toBoolean())) { |
312 | | - def androidXLegacyVersion = "1.0.0" |
313 | | - if (project.hasProperty("androidXLegacy")) { |
314 | | - androidXLegacyVersion = androidXLegacy |
315 | | - } |
316 | | - |
317 | | - def androidXAppCompatVersion = "1.1.0-alpha01" |
318 | | - if (project.hasProperty("androidXAppCompat")) { |
319 | | - androidXAppCompatVersion = androidXAppCompat |
320 | | - } |
321 | 313 |
|
322 | | - def androidXMaterialVersion = "1.1.0-alpha01" |
323 | | - if (project.hasProperty("androidXMaterial")) { |
324 | | - androidXMaterialVersion = androidXMaterial |
325 | | - } |
| 314 | + def androidXAppCompatVersion = "1.1.0-alpha01" |
| 315 | + if (project.hasProperty("androidXAppCompat")) { |
| 316 | + androidXAppCompatVersion = androidXAppCompat |
| 317 | + } |
326 | 318 |
|
327 | | - println "\t + using andorid X library androidx.legacy:legacy-support-v4:$androidXLegacyVersion" |
| 319 | + def androidXMaterialVersion = "1.1.0-alpha01" |
| 320 | + if (project.hasProperty("androidXMaterial")) { |
| 321 | + androidXMaterialVersion = androidXMaterial |
| 322 | + } |
328 | 323 |
|
329 | | - implementation "androidx.multidex:multidex:2.0.0" |
330 | | - implementation "androidx.legacy:legacy-support-v4:$androidXLegacyVersion" |
331 | | - implementation "androidx.appcompat:appcompat:$androidXAppCompatVersion" |
332 | | - implementation "com.google.android.material:material:$androidXMaterialVersion" |
333 | | - } else { |
334 | | - println "\t + using support library version $supportVer" |
| 324 | + println "\t + using andorid X library androidx.legacy:legacy-support-v4:$androidXLegacyVersion" |
335 | 325 |
|
336 | | - implementation "com.android.support:multidex:1.0.2" |
337 | | - implementation "com.android.support:support-v4:$supportVer" |
338 | | - implementation "com.android.support:appcompat-v7:$supportVer" |
339 | | - implementation "com.android.support:design:$supportVer" |
340 | | - } |
| 326 | + implementation "androidx.multidex:multidex:2.0.0" |
| 327 | + implementation "androidx.legacy:legacy-support-v4:$androidXLegacyVersion" |
| 328 | + implementation "androidx.appcompat:appcompat:$androidXAppCompatVersion" |
| 329 | + implementation "com.google.android.material:material:$androidXMaterialVersion" |
341 | 330 |
|
342 | 331 | def useV8Symbols = false |
343 | 332 |
|
@@ -429,7 +418,6 @@ tasks.whenTaskAdded({ org.gradle.api.DefaultTask currentTask -> |
429 | 418 | extractAllJars.finalizedBy(collectAllJars) |
430 | 419 | } |
431 | 420 | if (currentTask =~ /compile.+JavaWithJavac/) { |
432 | | - currentTask.dependsOn(makeAndroidXChanges) |
433 | 421 | currentTask.dependsOn(runSbg) |
434 | 422 | currentTask.finalizedBy(ensureMetadataOutDir) |
435 | 423 | ensureMetadataOutDir.finalizedBy(buildMetadata) |
@@ -691,43 +679,6 @@ task buildMetadata(type: JavaExec) { |
691 | 679 | } |
692 | 680 | } |
693 | 681 |
|
694 | | -task makeAndroidXChanges { |
695 | | - if (project.hasProperty("useAndroidX") && (useAndroidX || useAndroidX.toBoolean())) { |
696 | | - // code changes |
697 | | - def codeTuples = new ArrayList<Tuple2<String, String>>() |
698 | | - codeTuples.add(new Tuple2<String, String>('android\\.support\\.annotation\\.NonNull', 'androidx.annotation.NonNull')) |
699 | | - codeTuples.add(new Tuple2<String, String>('android\\.support\\.v7\\.app\\.AppCompatActivity', 'androidx.appcompat.app.AppCompatActivity')) |
700 | | - codeTuples.add(new Tuple2<String, String>('android\\.support\\.v7\\.appcompat\\.R', 'androidx.appcompat.R')) |
701 | | - codeTuples.add(new Tuple2<String, String>('android\\.support\\.design\\.widget\\.TabLayout', 'com.google.android.material.tabs.TabLayout')) |
702 | | - codeTuples.add(new Tuple2<String, String>('android\\.support\\.v4\\.app\\.ActivityCompat', 'androidx.core.app.ActivityCompat')) |
703 | | - codeTuples.add(new Tuple2<String, String>('android\\.support\\.v4\\.app\\.Fragment', 'androidx.fragment.app.Fragment')) |
704 | | - codeTuples.add(new Tuple2<String, String>('android\\.support\\.v4\\.view\\.ViewPager', 'androidx.viewpager.widget.ViewPager')) |
705 | | - codeTuples.add(new Tuple2<String, String>('android\\.support\\.v7\\.widget\\.Toolbar', 'androidx.appcompat.widget.Toolbar')) |
706 | | - codeTuples.add(new Tuple2<String, String>('android\\.support\\.multidex\\.MultiDex', 'androidx.multidex.MultiDex')) |
707 | | - |
708 | | - codeTuples.each { tuple -> |
709 | | - ant.replaceregexp(match: tuple.first, replace: tuple.second, flags: 'g', byline: true) { |
710 | | - fileset(dir: "$projectDir/src/debug/java/com/tns/", includes: '*.java') |
711 | | - } |
712 | | - ant.replaceregexp(match: tuple.first, replace: tuple.second, flags: 'g', byline: true) { |
713 | | - fileset(dir: "$projectDir/src/main/java/com/tns/", includes: '*.java') |
714 | | - } |
715 | | - } |
716 | | - |
717 | | - // resource changes |
718 | | - def resourceTuples = new ArrayList<Tuple2<String, String>>() |
719 | | - resourceTuples.add(new Tuple2<String, String>('android\\.support\\.v7\\.widget\\.Toolbar', 'androidx.appcompat.widget.Toolbar')) |
720 | | - resourceTuples.add(new Tuple2<String, String>('android\\.support\\.v4\\.view\\.ViewPager', 'androidx.viewpager.widget.ViewPager')) |
721 | | - resourceTuples.add(new Tuple2<String, String>('android\\.support\\.design\\.widget\\.TabLayout', 'com.google.android.material.tabs.TabLayout')) |
722 | | - |
723 | | - resourceTuples.each { tuple -> |
724 | | - ant.replaceregexp(match: tuple.first, replace: tuple.second, flags: 'g', byline: true) { |
725 | | - fileset(dir: "$projectDir/src/debug/res/layout/", includes: 'error_activity.xml') |
726 | | - } |
727 | | - } |
728 | | - } |
729 | | -} |
730 | | - |
731 | 682 | task generateTypescriptDefinitions(type: JavaExec) { |
732 | 683 | if (!findProject(':dts-generator').is(null)) { |
733 | 684 | dependsOn ':dts-generator:jar' |
|
0 commit comments