Skip to content
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

feat(android): Enable Kotlin for Cordova Android Plugins #4536

Closed
wants to merge 4 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions capacitor-cordova-android-plugins/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ buildscript {
}

apply plugin: 'com.android.library'
if(project.hasProperty('kotlin_version')) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Not every Gradle project that has a dependency on Kotlin sets this property.

apply plugin: 'kotlin-android'
}

android {
compileSdkVersion project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 30
Expand Down Expand Up @@ -43,8 +46,12 @@ repositories {
dependencies {
implementation fileTree(dir: 'src/main/libs', include: ['*.jar'])
implementation "org.apache.cordova:framework:$cordovaAndroidVersion"
if(project.hasProperty('kotlin_version')) {
implementation "androidx.core:core-ktx:+"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
// SUB-PROJECT DEPENDENCIES START

// SUB-PROJECT DEPENDENCIES END
}

Expand All @@ -54,4 +61,4 @@ dependencies {

for (def func : cdvPluginPostBuildExtras) {
func()
}
}