-
-
Notifications
You must be signed in to change notification settings - Fork 159
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Plugin #219
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…trategy # Conflicts: # plugin/src/main/kotlin/com/louiscad/splitties/Splitties.kt # plugin/src/main/kotlin/com/louiscad/splitties/SplittiesPlugin.kt
``` $ ./gradlew migrateToAndroidX > Configure project : Hello World SplittiesPlugin > Task :migrateToAndroidX Let's migrate this Android project from support libraries to AndroidX. moduleDirectories=[/Users/jmfayard/Downloads/SmallVictories/update-legacy-project/app] There's 24 source files that may need migration CSV file ok. Starting batch migration Migrating file named "MainActivityTest.kt" with full name: "/Users/jmfayard/Downloads/SmallVictories/update-legacy-project/app/src/androidTest/java/com/raywenderlich/android/smallvictories/MainActivityTest.kt"… Overwriting file… Done.✔🆗 Migrating file named "VictoryViewModelTest.kt" with full name: "/Users/jmfayard/Downloads/SmallVictories/update-legacy-project/app/src/androidTest/java/com/raywenderlich/android/smallvictories/VictoryViewModelTest.kt"… Overwriting file… Done.✔🆗 Migrating file named "content_main.xml" with full name: "/Users/jmfayard/Downloads/SmallVictories/update-legacy-project/app/src/main/res/layout/content_main.xml"… Overwriting file… Done.✔🆗 Migrating file named "activity_main.xml" with full name: "/Users/jmfayard/Downloads/SmallVictories/update-legacy-project/app/src/main/res/layout/activity_main.xml"… Overwriting file… Done.✔🆗 Migrating file named "MainActivity.kt" with full name: "/Users/jmfayard/Downloads/SmallVictories/update-legacy-project/app/src/main/java/com/raywenderlich/android/smallvictories/MainActivity.kt"… Overwriting file… Done.✔🆗 Migrating file named "VictoryViewModel.kt" with full name: "/Users/jmfayard/Downloads/SmallVictories/update-legacy-project/app/src/main/java/com/raywenderlich/android/smallvictories/VictoryViewModel.kt"… Overwriting file… Done.✔🆗 Migrating file named "SplashActivity.kt" with full name: "/Users/jmfayard/Downloads/SmallVictories/update-legacy-project/app/src/main/java/com/raywenderlich/android/smallvictories/SplashActivity.kt"… Overwriting file… Done.✔🆗 Migrating file named "build.gradle" with full name: "/Users/jmfayard/Downloads/SmallVictories/update-legacy-project/app/build.gradle"… Overwriting file… Done.✔🆗oid/smallvictories/VictoryUiModel.kt"… 7 source files (kt,java,xml) have been migrated (17 didn't need it). 1 gradle files have been migrated (0 didn't need it). AndroidX migration complete! You now just need to update the dependencies, if not already done. BUILD SUCCESSFUL in 1s 1 actionable task: 1 executed Publishing build scan... https://gradle.com/s/ye2bgafkqdhfa ```
LouisCAD
reviewed
Oct 18, 2019
LouisCAD
reviewed
Oct 18, 2019
using an exact version will mislead people using "_" makes Android Sync fails We should keep an exact version for important things like splitties version and Kotlin version
Thanks to Paul from Gradle, the path to the CSV file is not hardcoded anymore
Except for versions that do not have yet a stable release. Those may be filtered out by the filter refreshVersions.rejectVersionIf { ... }
LouisCAD
approved these changes
Oct 22, 2019
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks Good To Me.
Will publish the plugin on the Gradle Portal in the afternoon CEST, and merge into develop.
Gradle Build Scan: https://gradle.com/s/dfriulkefvlvm ``` > Task :migrateToAndroidX ## Searching Android Support Dependencies androidTestImplementation("android.arch.core:core-testing:1.1.1") androidTestImplementation("com.android.support.test:runner:1.0.2") androidTestImplementation("com.android.support.test:rules:1.0.2") androidTestImplementation("com.android.support.test.espresso:espresso-core:3.0.2") implementation("com.android.support:appcompat-v7:28.0.0-beta01") implementation("com.android.support.constraint:constraint-layout:1.1.2") implementation("com.android.support:design:28.0.0-beta01") implementation("android.arch.lifecycle:runtime:1.1.1") implementation("android.arch.lifecycle:extensions:1.1.1") implementation("android.arch.lifecycle:compiler:1.1.1") ## Use instead those Androidx libraries androidTestImplementation("androidx.arch.core:core-testing") androidTestImplementation("androidx.test:runner") androidTestImplementation("androidx.test:rules") androidTestImplementation("androidx.test.espresso:espresso-core") implementation("androidx.appcompat:appcompat") implementation("androidx.constraintlayout:constraintlayout") implementation("com.google.android.material:material") implementation("androidx.lifecycle:lifecycle-runtime") implementation("androidx.lifecycle:lifecycle-extensions") implementation("androidx.lifecycle:lifecycle-compiler") ```
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Plugin documentation:
https://github.com/LouisCAD/Splitties/tree/plugin/plugin
Run
./gradlew :plugin:publishToMavenLocal
Run
$ ./gradlew migrateToAndroidX
in the project that needs to be migratedRunning
:plugin:publishPlugins
will publish a version to https://plugins.gradle.org/plugin/com.louiscad.splittiesThis in turns will allow us to test it more easily in other projects.
What about the version? I considered three alternatives:
_
-- but that makes the Android Sync fails, so no+
-- that works and only needs to be explainedI kept the version for Splitties, which is a special case, and for AndroidX (just for now)
Caveat: Android Studio does not seem to support auto-completion for build.gradle
The path to the CSV file is hardcoded. It should be possible to use the CSV from theresources
folder but I couldn't find the right syntax for this. https://github.com/LouisCAD/Splitties/blob/plugin/plugin/src/main/kotlin/com/louiscad/splitties/MigrateAndroidxTask.kt#L14-L16