Skip to content

feat: Option to Select Language (Kotlin or Java) for Android Plugins#122

Merged
OS-pedrogustavobilro merged 14 commits intoionic-team:mainfrom
fabiomartino:feat/kotlin_template
Mar 2, 2026
Merged

feat: Option to Select Language (Kotlin or Java) for Android Plugins#122
OS-pedrogustavobilro merged 14 commits intoionic-team:mainfrom
fabiomartino:feat/kotlin_template

Conversation

@fabiomartino
Copy link
Contributor

Title:
(feat) Add Option to Select Programming Language (Kotlin or Java) for Android Plugins

Description:
This pull request introduces the ability to select the programming language (Kotlin or Java) when working with Android plugins.

Key Changes:

  1. Kotlin Templates:

    • Added templates for Kotlin as an alternative to the existing Java templates.
    • Developers can now choose Kotlin during plugin creation, providing greater flexibility and allowing the use of Kotlin's modern features.
  2. Dependency Management:

    • When Kotlin is selected, the necessary dependencies for Kotlin support are automatically added to the build.gradle file.
    • This ensures the generated project is correctly configured for Kotlin development without manual intervention.
  3. Enhanced Development Workflow:

    • This new feature streamlines the development of plugins by providing an easy choice between Java and Kotlin, based on developer preference or project requirements.

Changelog:

  • Added: Kotlin templates for Android plugin development.
  • Updated: Build configuration (build.gradle) to include Kotlin dependencies when Kotlin is selected.
  • Enhanced: Plugin creation workflow to allow selecting between Java and Kotlin.

Notes:

  • Ensure to test the new workflow with both Kotlin and Java templates to verify correctness and compatibility.
  • The Kotlin dependencies added to build.gradle include standard configurations required for compatibility with Android projects.

Let me know if you need further edits or details!

@OS-pedrogustavobilro OS-pedrogustavobilro self-assigned this Feb 27, 2026
@OS-pedrogustavobilro OS-pedrogustavobilro changed the title (feat) Add Option to Select Programming Language (Kotlin or Java) for Android Plugins feat: Option to Select Language (Kotlin or Java) for Android Plugins Feb 27, 2026
Otherwise --android-lang is ignored and user needs to prompt it specifically
Rather than using kotlin only if "kotlin" is returned
Copy link
Contributor

@OS-pedrogustavobilro OS-pedrogustavobilro left a comment

Choose a reason for hiding this comment

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

Hey @fabiomartino, thanks for the PR! Apologies for the time it took to take a look at it. I did some minor fixes and improvements that I noticed but overall it looks good, tested here and it's all working fine.

For reference: Most of the tests I did are available at https://github.com/OS-pedrogustavobilro/test-create-capacitor-plugin-pr122

@fabiomartino
Copy link
Contributor Author

Hey @fabiomartino, thanks for the PR! Apologies for the time it took to take a look at it. I did some minor fixes and improvements that I noticed but overall it looks good, tested here and it's all working fine.

For reference: Most of the tests I did are available at https://github.com/OS-pedrogustavobilro/test-create-capacitor-plugin-pr122

Hi @OS-pedrogustavobilro, thank you for the review and for the feedback!
I'm glad to see this moving forward.

I've also opened a related proposal here (#141) which I think could be a valuable addition to the project.
Feel free to take a look when you have a moment, as it might complement these changes well.

Looking forward to your thoughts!

@OS-pedrogustavobilro
Copy link
Contributor

@fabiomartino merging this PR. As for #141, from a quick look I gave it makes sense, but we'll take a closer look and provide feedback there. Thanks again!

@OS-pedrogustavobilro OS-pedrogustavobilro merged commit 9861597 into ionic-team:main Mar 2, 2026
2 checks passed
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.

3 participants