Comments (9)
Google's ossdetector plugin is used by everyone building gRPC projects, with both Maven and Gradle. That's a sizeable chunk.
from openjfx-docs.
A possible solution would be to use https://github.com/google/osdetector-gradle-plugin from Google, which builds on top of https://github.com/trustin/os-maven-plugin.
This plugin resolves linux
and windows
as expected but uses osx
for MacOSX. The JavaFX 11 artifacts expect mac
, thus the minimum changes needed for it to work are
buildscript {
repositories {
maven { url 'https://plugins.gradle.org/m2/' }
}
dependencies {
classpath 'com.google.gradle:osdetector-gradle-plugin:1.6.0'
}
}
apply plugin: 'com.google.osdetector'
ext.platform = osdetector.os != 'osx' ? osdetector.os : 'mac'
Or alternatively since Gradle 2.1
plugins {
id 'com.google.osdetector' version '1.6.0'
}
ext.platform = osdetector.os != 'osx' ? osdetector.os : 'mac'
Also, do not use script variables, prefer the usage of project variables, that is,
def platform = 'mac' // don't !!
project.ext.platform = 'mac' // :-)
from openjfx-docs.
Using a plugin to replace the internal API and the ugly if..else
is definitely a +1
from openjfx-docs.
There is also org.gradle.nativeplatform.platform.OperatingSystem, which is however still incubating.
from openjfx-docs.
I like it!
Note that for gradle 2.1+ this is sufficient to apply the plugin:
plugins {
id "com.google.osdetector" version "1.6.0"
}
from openjfx-docs.
My opinion is that having a dependency to a gradle plugin or a dependency to internal gradle API is the same. They are both pieces that are outside your direct control and that might break things in the future.
Having said that, the plugin dependency is an improvement here, just for the sake of readability. @aalmiray, it would be great if you can create a PR with your suggestions!
from openjfx-docs.
Use of a plugin for such a simple thing (at this stage anyway - with only three flavours to pick) seems like overkill. Specially if you have to massage the strings with additional conditions anyway ('osx' -> 'mac').
The use of the internal API in the first place is strange. The author should have known they were making mistake before they finished typing the line. Forgivable for your own private code perhaps, but when making it a public example - worthy of a few lashes. :-)
from openjfx-docs.
Fixed by #7.
from openjfx-docs.
Just got my hand on a windows machine. The plugin actually sets the platform as 'windows' instead of 'win'.
A viable solution would be to extend the condition:
ext.platform = osdetector.os == 'osx' ? 'mac' : osdetector.os == 'windows' ? 'win' : osdetector.os
I am writing it here in case someone has a better approach.
from openjfx-docs.
Related Issues (20)
- javac command fails to find javafx.controls with openjfx 18.0.2 HOT 1
- TableView Scroll to bottom issue and adding graphics to the cell
- JavaFX HelloWorld Failed to run HOT 1
- JavaFX 20 release
- Class com.sun.glass.ui.monocle.MonocleWindow does not define or inherit method _updateViewSize(long)
- Error occurred during initialization of boot layer java.lang.module.FindException: Module javafx.controls not found HOT 2
- javaFX - Run time error - Graphics Device initialization failed HOT 1
- Doesn't work on Apple M1 Mac --> Error. Warning
- Text cannot show some unicode String like "𝔸𝔹𝕒𝕓"
- JavaFX runtime components are missing, and are required to run this program HOT 2
- 不自己搞一个脚手架吗?新建个项目都报错
- JavaFX 21 release
- Graphics Device initialization failed for : es2, sw Error initializing QuantumRenderer: no suitable pipeline found HOT 2
- java.lang.module.FindException: Module JavaFXApp not found
- The desired archetype does not exist (org.openjfx:javafx-maven-archetypes:0.0.6) HOT 1
- the javaFX documentation page do not work! HOT 2
- JavaFX 乱码问题不知道如何解决
- Which repository can I submit pull requests to? HOT 1
- Version 22, yet GH page still says "Getting started guide for JavaFX 11" HOT 1
- error
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from openjfx-docs.