Skip to content

docs(tutorial): Explicitly set Java lang for create plugin command#524

Open
OS-pedrogustavobilro wants to merge 2 commits intomainfrom
docs/generate-plugin-java
Open

docs(tutorial): Explicitly set Java lang for create plugin command#524
OS-pedrogustavobilro wants to merge 2 commits intomainfrom
docs/generate-plugin-java

Conversation

@OS-pedrogustavobilro
Copy link
Contributor

1-liner PR.

With create-capacitor-plugin version 0.21.0, users can now specify android-lang argument to decide whether to use Java or Kotlin for the programming language for their plugin on Android.

Since the tutorial in the docs is Java-based, this PR updates the command to explicitly set the language being used (so that users don't have to prompt it afterwards). Maybe one day the tutorial can be revamped to use Kotlin (as well as probably a myriad of other updates), but that's not gonna happen in this PR.

Only added to the current docs, because it was added after official Cap 8 support in the create plugin package, so I don't see it making much sense adding for older versions, but please correct me if I'm wrong.

@OS-pedrogustavobilro OS-pedrogustavobilro requested a review from a team March 4, 2026 18:30
@vercel
Copy link

vercel bot commented Mar 4, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
capacitor-docs Ready Ready Preview, Comment Mar 4, 2026 6:39pm

Request Review

@jcesarmobile
Copy link
Member

so --android-lang is now mandatory? I don't love that, would have preferred to keep java as default if no param is passed.

Anyway, could be good to also add the author and directory so it doesn't prompt anything.
(would also need to remove the When prompted to provide a directory, use the default by pressing Enter. When asked for the author’s name, use your own! line).

@jcesarmobile
Copy link
Member

This section should also include a kotlin example since it's linked right after the plugin generation
https://capacitorjs.com/docs/plugins/workflow

This should also be updated since it says that the way of using kotlin is creating a java plugin and converting it
https://capacitorjs.com/docs/plugins/android#using-kotlin

And all the code there is java, not sure if it would be possible to have both examples with a language selector like Android docs do, Ionic docs already have a selector for Angular/Javascript/React/Vue, so since both docs websites are similar, I think it should be possible to do something similar but with Java/Kotlin options

All that can be done in a separate PR, but needs to be considered for the future since the generator supports kotlin now

@OS-pedrogustavobilro
Copy link
Contributor Author

This should also be updated since it says that the way of using kotlin is creating a java plugin and converting it
https://capacitorjs.com/docs/plugins/android#using-kotlin

This one sounds simple enough, I think I can do it in this PR, it is related after all.

This section should also include a kotlin example since it's linked right after the plugin generation

https://capacitorjs.com/docs/plugins/workflow

Yeah that makes sense. I'll need to look into better how we can present both Java and Kotlin code in the docs, what "UI" options we have at our disposal. That would be more suitable in a separate PR.

Anyway, could be good to also add the author and directory so it doesn't prompt anything.
(would also need to remove the When prompted to provide a directory, use the default by pressing Enter. When asked for the author’s name, use your own! line).

I'll also do that in this PR.

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.

2 participants