-
Notifications
You must be signed in to change notification settings - Fork 2
feat: migrate from cap 7 to cap 8 #28
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
| } | ||
|
|
||
| function updateDeprecatedPropertySyntax(gradleFile: string): string { | ||
| const propertiesToUpdate = [ |
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.
This script ends up changing more property assignments that we actually changed for our plugins - i.e. the ones that had gradle warnings.
I don't think it's necessarily bad to change assignment for all these properties, or at least I didn't get any errors nor warnings myself, but if we want to keep changes to a minimum, we can restrict these to the fewer properties that gradle seems to complain about.
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.
I did run into some issues where ./gradlew clean lint build test -b build.gradle --warning-mode all would not log all of the warnings.. But then when going to Android Studio there would be more props that would actually be highlighted. As a result, I just included any property where I thought it made sense to update the syntax, even if there wasn't an explicit warning, in case the linter was not accurate.
I think it's better to be proactive since the documentation is pretty vague on which properties are actually affected (https://docs.gradle.org/current/userguide/upgrading_version_8.html#groovy_space_assignment_syntax)
Thoughts?
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.
Yeah fair enough, not foreseeing any side effects so everything should be good.
Resolving this 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.
If we do this then we should do it for our plugins too, and document it
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.
Added it to the documentation. I will make the changes in the plugins as well for the variables that have not been updated to the recommended syntax yet
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.
Since we ended up not updating the plugins since then, for now it will just be quicker to remove some gradle properties from this command and only include the ones we updated for plugins.
|
@jcesarmobile I’ve applied the changes you requested on |
src/index.ts
Outdated
| } | ||
| } | ||
|
|
||
| logger.info('Updated kotlinOptions to compilerOptions for Kotlin 2.2.0'); |
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.
| logger.info('Updated kotlinOptions to compilerOptions for Kotlin 2.2.0'); | |
| logger.info('Updated kotlinOptions to compilerOptions for Kotlin 2'); |
While it was removed in 2.2.0, it was deprecated in 2, so better just say 2
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.
I was testing on the privacy screen plugin and the kotlin version is not being updated because it's like:
ext {
kotlin_version = '1.9.24'
}
instead of ext.kotlin_version = '1.9.24'.
I did a code search in our org and find some others, so we should handle that too.
Hmm this was working before in this PR, so something must have broken it. |
This might be related to the changes in this commit |
The goal is to update the version in both cases, correct? When should be converted to When should be converted to
|
|
should be converted to |
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.
Just noticed it's not updating typescript, it should update to "typescript": "^5.9.3" as we did on ionic-team/capacitor-plugins@4c05924
|
@jcesarmobile in that case should update |
src/index.ts
Outdated
| } | ||
| if (pluginJSON.devDependencies?.['typescript']) { | ||
| pluginJSON.devDependencies['typescript'] = typeScriptVersion; | ||
| if (pluginJSON.devDependencies?.['@types/node']) { |
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.
but don't check if @types/node is present, the build problem happens if typescript gets updated and adding @types/node is a workaround to make it work again, so we need to add it if it's not there
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.
hm yeah, I see
|
Turns out that what was causing the build problems when updating the typescript version was |
@jcesarmobile pushed new changes with this |
|
If a plugin has And also for |
Pushed a new commit with these changes. |
next8.14.38.13.0minSDKto24andcompileSDKto36propName valuesyntax withpropName = valuekotlinOptionssyntax15.0