|
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 |
@@ -303,40 +305,27 @@ repositories { |
303 | 305 | } |
304 | 306 |
|
305 | 307 | dependencies { |
306 | | - def supportVer = "28.0.0" |
307 | | - if (project.hasProperty("supportVersion")) { |
308 | | - supportVer = supportVersion |
| 308 | + def androidXLegacyVersion = "1.0.0" |
| 309 | + if (project.hasProperty("androidXLegacy")) { |
| 310 | + androidXLegacyVersion = androidXLegacy |
309 | 311 | } |
310 | | - if (project.hasProperty("useAndroidX") && (useAndroidX || useAndroidX.toBoolean())) { |
311 | | - def androidXLegacyVersion = "1.0.0" |
312 | | - if (project.hasProperty("androidXLegacy")) { |
313 | | - androidXLegacyVersion = androidXLegacy |
314 | | - } |
315 | | - |
316 | | - def androidXAppCompatVersion = "1.1.0-alpha01" |
317 | | - if (project.hasProperty("androidXAppCompat")) { |
318 | | - androidXAppCompatVersion = androidXAppCompat |
319 | | - } |
320 | 312 |
|
321 | | - def androidXMaterialVersion = "1.1.0-alpha01" |
322 | | - if (project.hasProperty("androidXMaterial")) { |
323 | | - androidXMaterialVersion = androidXMaterial |
324 | | - } |
| 313 | + def androidXAppCompatVersion = "1.1.0-alpha01" |
| 314 | + if (project.hasProperty("androidXAppCompat")) { |
| 315 | + androidXAppCompatVersion = androidXAppCompat |
| 316 | + } |
325 | 317 |
|
326 | | - println "\t + using andorid X library androidx.legacy:legacy-support-v4:$androidXLegacyVersion" |
| 318 | + def androidXMaterialVersion = "1.1.0-alpha01" |
| 319 | + if (project.hasProperty("androidXMaterial")) { |
| 320 | + androidXMaterialVersion = androidXMaterial |
| 321 | + } |
327 | 322 |
|
328 | | - implementation "androidx.multidex:multidex:2.0.0" |
329 | | - implementation "androidx.legacy:legacy-support-v4:$androidXLegacyVersion" |
330 | | - implementation "androidx.appcompat:appcompat:$androidXAppCompatVersion" |
331 | | - implementation "com.google.android.material:material:$androidXMaterialVersion" |
332 | | - } else { |
333 | | - println "\t + using support library version $supportVer" |
| 323 | + println "\t + using andorid X library androidx.legacy:legacy-support-v4:$androidXLegacyVersion" |
334 | 324 |
|
335 | | - implementation "com.android.support:multidex:1.0.2" |
336 | | - implementation "com.android.support:support-v4:$supportVer" |
337 | | - implementation "com.android.support:appcompat-v7:$supportVer" |
338 | | - implementation "com.android.support:design:$supportVer" |
339 | | - } |
| 325 | + implementation "androidx.multidex:multidex:2.0.0" |
| 326 | + implementation "androidx.legacy:legacy-support-v4:$androidXLegacyVersion" |
| 327 | + implementation "androidx.appcompat:appcompat:$androidXAppCompatVersion" |
| 328 | + implementation "com.google.android.material:material:$androidXMaterialVersion" |
340 | 329 |
|
341 | 330 | def useV8Symbols = false |
342 | 331 |
|
@@ -428,7 +417,6 @@ tasks.whenTaskAdded({ org.gradle.api.DefaultTask currentTask -> |
428 | 417 | extractAllJars.finalizedBy(collectAllJars) |
429 | 418 | } |
430 | 419 | if (currentTask =~ /compile.+JavaWithJavac/) { |
431 | | - currentTask.dependsOn(makeAndroidXChanges) |
432 | 420 | currentTask.dependsOn(runSbg) |
433 | 421 | currentTask.finalizedBy(ensureMetadataOutDir) |
434 | 422 | ensureMetadataOutDir.finalizedBy(buildMetadata) |
@@ -708,43 +696,6 @@ task buildMetadata(type: JavaExec) { |
708 | 696 | } |
709 | 697 | } |
710 | 698 |
|
711 | | -task makeAndroidXChanges { |
712 | | - if (project.hasProperty("useAndroidX") && (useAndroidX || useAndroidX.toBoolean())) { |
713 | | - // code changes |
714 | | - def codeTuples = new ArrayList<Tuple2<String, String>>() |
715 | | - codeTuples.add(new Tuple2<String, String>('android\\.support\\.annotation\\.NonNull', 'androidx.annotation.NonNull')) |
716 | | - codeTuples.add(new Tuple2<String, String>('android\\.support\\.v7\\.app\\.AppCompatActivity', 'androidx.appcompat.app.AppCompatActivity')) |
717 | | - codeTuples.add(new Tuple2<String, String>('android\\.support\\.v7\\.appcompat\\.R', 'androidx.appcompat.R')) |
718 | | - codeTuples.add(new Tuple2<String, String>('android\\.support\\.design\\.widget\\.TabLayout', 'com.google.android.material.tabs.TabLayout')) |
719 | | - codeTuples.add(new Tuple2<String, String>('android\\.support\\.v4\\.app\\.ActivityCompat', 'androidx.core.app.ActivityCompat')) |
720 | | - codeTuples.add(new Tuple2<String, String>('android\\.support\\.v4\\.app\\.Fragment', 'androidx.fragment.app.Fragment')) |
721 | | - codeTuples.add(new Tuple2<String, String>('android\\.support\\.v4\\.view\\.ViewPager', 'androidx.viewpager.widget.ViewPager')) |
722 | | - codeTuples.add(new Tuple2<String, String>('android\\.support\\.v7\\.widget\\.Toolbar', 'androidx.appcompat.widget.Toolbar')) |
723 | | - codeTuples.add(new Tuple2<String, String>('android\\.support\\.multidex\\.MultiDex', 'androidx.multidex.MultiDex')) |
724 | | - |
725 | | - codeTuples.each { tuple -> |
726 | | - ant.replaceregexp(match: tuple.first, replace: tuple.second, flags: 'g', byline: true) { |
727 | | - fileset(dir: "$projectDir/src/debug/java/com/tns/", includes: '*.java') |
728 | | - } |
729 | | - ant.replaceregexp(match: tuple.first, replace: tuple.second, flags: 'g', byline: true) { |
730 | | - fileset(dir: "$projectDir/src/main/java/com/tns/", includes: '*.java') |
731 | | - } |
732 | | - } |
733 | | - |
734 | | - // resource changes |
735 | | - def resourceTuples = new ArrayList<Tuple2<String, String>>() |
736 | | - resourceTuples.add(new Tuple2<String, String>('android\\.support\\.v7\\.widget\\.Toolbar', 'androidx.appcompat.widget.Toolbar')) |
737 | | - resourceTuples.add(new Tuple2<String, String>('android\\.support\\.v4\\.view\\.ViewPager', 'androidx.viewpager.widget.ViewPager')) |
738 | | - resourceTuples.add(new Tuple2<String, String>('android\\.support\\.design\\.widget\\.TabLayout', 'com.google.android.material.tabs.TabLayout')) |
739 | | - |
740 | | - resourceTuples.each { tuple -> |
741 | | - ant.replaceregexp(match: tuple.first, replace: tuple.second, flags: 'g', byline: true) { |
742 | | - fileset(dir: "$projectDir/src/debug/res/layout/", includes: 'error_activity.xml') |
743 | | - } |
744 | | - } |
745 | | - } |
746 | | -} |
747 | | - |
748 | 699 | task generateTypescriptDefinitions(type: JavaExec) { |
749 | 700 | if (!findProject(':dts-generator').is(null)) { |
750 | 701 | dependsOn ':dts-generator:jar' |
|
0 commit comments