-
Notifications
You must be signed in to change notification settings - Fork 1.1k
chore(cli): Update migrate command for Cap 8 #8217
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
base: main
Are you sure you want to change the base?
Conversation
For now, only status-bar has the possibility of breaking changes. May still be changed.
Matches what Capacitor Google Maps is using as default if no variable exists
Capacitor 8 added density to "configChanges" property for the Android template, this makes sure it's also added there. Re-uses the existing command for navigation, which came from Capacitor 7.
The gradle version that Capacitor 8 uses brings upon warnings that would eventually turn into compilation errors. This commit adds a step to fix those app/build.gradle, by making use of the updated Groovy Gradle DSL syntax for assigning certain properties in the gradle file. This way, the build.gradle will resemble that of the updated android app template for Cap 8.
Tested on several existing capacitor apps that use existing plugins, all is working with the latest versions.
Co-authored-by: jcesarmobile <[email protected]>
jcesarmobile
left a comment
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.
We have a call to patchOldCapacitorPlugins, which then calls to movePackageFromManifestToBuildGradle, which moves plugin package names from the AndroidManifest.xml to the build.gradle as namespace.
That should be revisited so it adds it as namespace =.
Or maybe the whole patchOldCapacitorPlugins can be removed at this point since all plugins should have moved the package name to the build.gradle.
In case we remove it, the update.ts file should remove the calls to that method too.
Some are updates to gradle dependencies, others to inform of changes in Android 16.
|
@jcesarmobile removed the method since all plugins should already be using |
|
Can you remove the |
@jcesarmobile So what should be used instead to allow to run this tool in a mono-repo type environment? |
|
I don't know, but not the Ionic extension. |
Ionic VC Code extension is no longer support, suggest manual migration instead.
PR description
This PR updates the
migrate.tstask to Capacitor 8, mostly updating dependency versions, but with a new addition to update app'sbuild.gradle- see commits for list of changes.Testing
I tested this command on a few capacitor apps (as well as testing the apps after running the command), for instance:
test/branches for a few different cases to make sure that the command works.You can test yourself by checking this branch, and mapping the cli version to the local source code directory (make sure you run
buildin cli directory beforehand), then runnpx cap migrateon the app.If you want to run a second time in the same app, you'll need to manually change the version for
clievery time, because themigratecommand will change the versions of capacitor next. If you're running the migrate command a second time, you can avoid runningnpm install(replyingnto the second question), to not override the cli version afterwards (coreandandroidandiosshould already be usingnextfrom running migrate the first time, so nothing should change).