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

Use JavaFX official Gradle Plugin #98

Conversation

mboukadir
Copy link
Contributor

@mboukadir mboukadir commented Dec 13, 2022

📑 What does this PR do?

We use JavaFX Desktop WebView in the user login Path. The integration of JavaFX is done with the official Gradle plugin. However, we can't use it in the same module as the Android Library plugin.

Firstly, We have put a workaround that consists of manually adding the necessary JavaFX dependencies depending on the machine running the build. Besides, normally the plugin official does the same things.

val fxSuffix = when (osdetector.classifier) {
    "linux-x86_64" -> "linux"
    "linux-aarch_64" -> "linux-aarch64"
    "windows-x86_64" -> "win"
    "osx-x86_64" -> "mac"
    "osx-aarch_64" -> "mac-aarch64"
    else -> throw IllegalStateException("Unknown OS: ${osdetector.classifier}")
}

implementation("org.openjfx:javafx-base:19:${fxSuffix}")
implementation("org.openjfx:javafx-graphics:19:${fxSuffix}")
implementation("org.openjfx:javafx-controls:19:${fxSuffix}")
implementation("org.openjfx:javafx-web:19:${fxSuffix}")
implementation("org.openjfx:javafx-swing:19:${fxSuffix}")
implementation("org.openjfx:javafx-media:19:${fxSuffix}")

So now, in this PR, to use the official JavaFX Gradle plugin, I created a new pure JVM module with a composable Webview based on the JavaFX Webview.

✅ Checklist

  • My pull request adheres to the code style of this project
  • My code requires changes to the documentation
  • I have updated the documentation as required
  • All the tests have passed

🧪 How can this PR been tested?

🧾 Tasks Remaining: (List of tasks remaining to be implemented)

  • Build and launch the login screen on Windows and Linux

🖼️ Screenshots (if applicable):

@mboukadir mboukadir force-pushed the feature/use-javafx-official-plugin branch from 49e1068 to d4ac9f6 Compare December 13, 2022 15:20
Copy link
Member

@crocsandcoffee crocsandcoffee left a comment

Choose a reason for hiding this comment

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

Looks good to me! shouldn't :ui:desktop-webview need to be added to settings gradle?

@mboukadir mboukadir force-pushed the feature/use-javafx-official-plugin branch from 9887205 to 6a5b9ae Compare December 21, 2022 10:51
@mboukadir mboukadir marked this pull request as ready for review December 21, 2022 11:27
@crocsandcoffee crocsandcoffee merged commit 03e178a into AndroidDev-social:main Dec 21, 2022
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.

None yet

2 participants