Skip to content

Conversation

@ItsChaceD
Copy link

@ItsChaceD ItsChaceD commented Nov 10, 2025

  • Upgrade Capacitor core to next
  • Upgrade Gradle to 8.14.3
  • Upgrade AGP to 8.13.0
  • Upgrade Android minSDK to 24 and compileSDK to 36
  • Upgrade AndroidX lib versions
  • Replace deprecated propName value syntax with propName = value
  • Replace deprecated kotlinOptions syntax
  • Upgrade iOS deployment target to 15.0

@ItsChaceD ItsChaceD requested a review from a team November 11, 2025 21:09
@ItsChaceD ItsChaceD marked this pull request as ready for review November 11, 2025 21:11
}

function updateDeprecatedPropertySyntax(gradleFile: string): string {
const propertiesToUpdate = [

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.

Copy link
Author

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?

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.

Copy link
Member

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

Copy link
Author

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

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.

fyi @OS-ruimoreiramendes

@OS-ruimoreiramendes
Copy link

@jcesarmobile I’ve applied the changes you requested on updateKotlinOptions to remove the extra whitespace and update the JVM version.

src/index.ts Outdated
}
}

logger.info('Updated kotlinOptions to compilerOptions for Kotlin 2.2.0');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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

Copy link
Member

@jcesarmobile jcesarmobile left a 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.

@OS-pedrogustavobilro
Copy link

I was testing on the privacy screen plugin and the kotlin version is not being updated

Hmm this was working before in this PR, so something must have broken it.

@OS-ruimoreiramendes
Copy link

I was testing on the privacy screen plugin and the kotlin version is not being updated

Hmm this was working before in this PR, so something must have broken it.

This might be related to the changes in this commit

@OS-ruimoreiramendes
Copy link

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.

The goal is to update the version in both cases, correct?

When

ext {
    kotlin_version = '1.9.24'
} 

should be converted to

ext {
    kotlin_version = 'x.x.x'
} 

When
ext.kotlin_version = '1.9.24'

should be converted to

ext.kotlin_version = 'x.x.x'

@jcesarmobile
Copy link
Member

should be converted to kotlin_version = project.hasProperty("kotlin_version") ? rootProject.ext.kotlin_version : '2.2.20'

Copy link
Member

@jcesarmobile jcesarmobile left a 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

@OS-pedrogustavobilro
Copy link

OS-pedrogustavobilro commented Dec 2, 2025

@jcesarmobile in that case should update @types/node as well, as we had to do for some plugins otherwise builds may fail? e.g. https://github.com/ionic-team/capacitor-geolocation/pull/63/files#diff-197d2f3d2108bd4f19137a72da4e4179f0333faa653397e4035bd4461d784969R64

src/index.ts Outdated
}
if (pluginJSON.devDependencies?.['typescript']) {
pluginJSON.devDependencies['typescript'] = typeScriptVersion;
if (pluginJSON.devDependencies?.['@types/node']) {
Copy link
Member

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hm yeah, I see

@jcesarmobile
Copy link
Member

Turns out that what was causing the build problems when updating the typescript version was @capacitor/docgen, I've released a 0.3.1 version that no longer requires to include @types/node.
Can you update the @capacitor/docgen dependency to 0.3.1 and remove the @types/node addition or put the code back to update it only if it was already present?

@OS-ruimoreiramendes
Copy link

Turns out that what was causing the build problems when updating the typescript version was @capacitor/docgen, I've released a 0.3.1 version that no longer requires to include @types/node. Can you update the @capacitor/docgen dependency to 0.3.1 and remove the @types/node addition or put the code back to update it only if it was already present?

@jcesarmobile pushed new changes with this

@jcesarmobile
Copy link
Member

If a plugin has implementation "org.jetbrains.kotlin:kotlin-stdlib:1.9.25" it gets converted to implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" even if there is no kotlin_version declared, if there is no kotlin_version declared it should be turned into "org.jetbrains.kotlin:kotlin-stdlib:2.2.20"`

And also for classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.25", in this case it's not getting transformed, but isn't getting updated neither.

@OS-ruimoreiramendes
Copy link

If a plugin has implementation "org.jetbrains.kotlin:kotlin-stdlib:1.9.25" it gets converted to implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" even if there is no kotlin_version declared, if there is no kotlin_version declared it should be turned into "org.jetbrains.kotlin:kotlin-stdlib:2.2.20"`

And also for classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.25", in this case it's not getting transformed, but isn't getting updated neither.

Pushed a new commit with these changes.
PS: Sorry, I closed the PR by mistake, it’s open again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants