JFXtras / jfxtras

A supporting library for JavaFX, containing helper classes, extended layouts, controls and other interesting widgets.
http://jfxtras.org
Other
599 stars 123 forks source link

Gradle build issues #94

Closed aalmiray closed 3 years ago

aalmiray commented 6 years ago

Following the thread at https://twitter.com/tbeernot/status/974290102800273411

What are the issues currently faced by the team in order to get Gradle perform as expected?

I see a few minor things:

tbee commented 6 years ago

The biggest problem I have is migration to Java 9; the project in the 9 branch compiles completely under Intellij, but not under Gradle.

aalmiray commented 6 years ago

Gradle 4.2 is the minimum required version for Java9 compatibility. The gradle wrapper is currently set to 4.0.

aalmiray commented 6 years ago

FYI, switching to Gradle 4.6 and JDK 9 yields the following errors when running gradle from the command line

> Task :jfxtras-controls:compileJava FAILED
/Users/aalmiray/dev/github/jfxtras/jfxtras-controls/src/main/java/jfxtras/internal/scene/control/skin/CalendarPickerControlSkin.java:42: error: package com.sun.javafx.css.converters does not 
exist
import com.sun.javafx.css.converters.EnumConverter;
                                    ^
/Users/aalmiray/dev/github/jfxtras/jfxtras-controls/src/main/java/jfxtras/internal/scene/control/skin/CalendarTimePickerSkin.java:43: error: package com.sun.javafx.css.converters does not exist
import com.sun.javafx.css.converters.EnumConverter;
                                    ^
/Users/aalmiray/dev/github/jfxtras/jfxtras-controls/src/main/java/jfxtras/internal/scene/control/skin/ListSpinnerSkin.java:68: error: package com.sun.javafx.css.converters does not exist
import com.sun.javafx.css.converters.EnumConverter;
                                    ^
/Users/aalmiray/dev/github/jfxtras/jfxtras-controls/src/main/java/jfxtras/internal/scene/control/skin/ListViewSkinJFXtras.java:32: error: cannot find symbol
import com.sun.javafx.scene.control.skin.ListViewSkin;
                                        ^
  symbol:   class ListViewSkin
  location: package com.sun.javafx.scene.control.skin
/Users/aalmiray/dev/github/jfxtras/jfxtras-controls/src/main/java/jfxtras/internal/scene/control/skin/ListViewSkinJFXtras.java:39: error: cannot find symbol
public class ListViewSkinJFXtras<T> extends ListViewSkin<T>
                                            ^
  symbol: class ListViewSkin
/Users/aalmiray/dev/github/jfxtras/jfxtras-controls/src/main/java/jfxtras/internal/scene/control/skin/CalendarPickerControlSkin.java:218: error: cannot find symbol
        private static final CssMetaData<CalendarPicker, ShowWeeknumbers> SHOW_WEEKNUMBERS = new CssMetaDataForSkinProperty<CalendarPicker, CalendarPickerControlSkin, ShowWeeknumbers>("-fxx-show-weeknumbers", new EnumConverter<ShowWeeknumbers>(ShowWeeknumbers.class), ShowWeeknumbers.YES ) {
                                                                                                                                                                                                                     ^
  symbol:   class EnumConverter
  location: class StyleableProperties
/Users/aalmiray/dev/github/jfxtras/jfxtras-controls/src/main/java/jfxtras/internal/scene/control/skin/CalendarTimePickerSkin.java:182: error: cannot find symbol
        private static final CssMetaData<CalendarTimePicker, ShowTickLabels> SHOW_TICKLABELS = new CssMetaDataForSkinProperty<CalendarTimePicker, CalendarTimePickerSkin, ShowTickLabels>("-fxx-show-ticklabels", new EnumConverter<ShowTickLabels>(ShowTickLabels.class), ShowTickLabels.NO ) {
                                                                                                                                                                                                                      ^
  symbol:   class EnumConverter
  location: class StyleableProperties
/Users/aalmiray/dev/github/jfxtras/jfxtras-controls/src/main/java/jfxtras/internal/scene/control/skin/ListSpinnerSkin.java:195: error: cannot find symbol
        private static final CssMetaData<ListSpinner<?>, ArrowPosition> ARROW_POSITION = new CssMetaDataForSkinProperty<ListSpinner<?>, ListSpinnerSkin<?>, ArrowPosition>("-fxx-arrow-position", new EnumConverter<ArrowPosition>(ArrowPosition.class), ArrowPosition.TRAILING ) {
                                                                                                                                                                                                      ^
  symbol:   class EnumConverter
  location: class StyleableProperties
/Users/aalmiray/dev/github/jfxtras/jfxtras-controls/src/main/java/jfxtras/internal/scene/control/skin/ListSpinnerSkin.java:202: error: cannot find symbol
        private static final CssMetaData<ListSpinner<?>, ArrowDirection> ARROW_DIRECTION = new CssMetaDataForSkinProperty<ListSpinner<?>, ListSpinnerSkin<?>, ArrowDirection>("-fxx-arrow-direction", new EnumConverter<ArrowDirection>(ArrowDirection.class), ArrowDirection.HORIZONTAL ) {
                                                                                                                                                                                                          ^
  symbol:   class EnumConverter
  location: class StyleableProperties
/Users/aalmiray/dev/github/jfxtras/jfxtras-controls/src/main/java/jfxtras/internal/scene/control/skin/ListSpinnerSkin.java:209: error: cannot find symbol
        private static final CssMetaData<ListSpinner<?>, Pos> VALUE_ALIGNMENT = new CssMetaDataForSkinProperty<ListSpinner<?>, ListSpinnerSkin<?>, Pos>("-fxx-value-alignment", new EnumConverter<Pos>(Pos.class), Pos.CENTER_LEFT ) {
                                                                                                                                                                                    ^
  symbol:   class EnumConverter
  location: class StyleableProperties
/Users/aalmiray/dev/github/jfxtras/jfxtras-controls/src/main/java/jfxtras/internal/scene/control/skin/ListViewSkinJFXtras.java:49: error: cannot find symbol
                flow.recreateCells();
                ^
  symbol:   variable flow
  location: class ListViewSkinJFXtras<T>
  where T is a type-variable:
    T extends Object declared in class ListViewSkinJFXtras
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
11 errors

How did you get around usages of private APIs that are removed in JDK9?

tbee commented 6 years ago

You're not compile the 9 branch, but the 8 (java 8) branch.

aalmiray commented 6 years ago

I see now. The 9.0 branch is on gradle 3.3.

aalmiray commented 6 years ago

Now we're getting somewhere

:jfxtras-common:javadoc
javadoc: warning - The old Doclet and Taglet APIs in the packages
com.sun.javadoc, com.sun.tools.doclets and their implementations
are planned to be removed in a future JDK release. These
components have been superseded by the new APIs in jdk.javadoc.doclet.
Users are strongly recommended to migrate to the new APIs.
javadoc: warning - --base-dir must be present for includes or file reference features to work properly.
javadoc: error - In doclet class org.asciidoctor.Asciidoclet,  method start has thrown an exception java.lang.reflect.InvocationTargetException
java.lang.ExceptionInInitializerError
        at org.asciidoctor.internal.JRubyAsciidoctor.createOptimizedConfiguration(JRubyAsciidoctor.java:151)
        at org.asciidoctor.internal.JRubyAsciidoctor.createJRubyAsciidoctorInstance(JRubyAsciidoctor.java:114)
        at org.asciidoctor.internal.JRubyAsciidoctor.create(JRubyAsciidoctor.java:73)
        at org.asciidoctor.Asciidoctor$Factory.create(Asciidoctor.java:662)
        at org.asciidoctor.asciidoclet.AsciidoctorRenderer.<init>(AsciidoctorRenderer.java:59)
        at org.asciidoctor.Asciidoclet.run(Asciidoclet.java:273)
        at org.asciidoctor.Asciidoclet.start(Asciidoclet.java:268)
        at org.asciidoctor.Asciidoclet.start(Asciidoclet.java:242)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:564)
        at jdk.javadoc/com.sun.tools.javadoc.main.DocletInvoker.invoke(DocletInvoker.java:332)
        at jdk.javadoc/com.sun.tools.javadoc.main.DocletInvoker.start(DocletInvoker.java:211)
        at jdk.javadoc/com.sun.tools.javadoc.main.Start.parseAndExecute(Start.java:453)
        at jdk.javadoc/com.sun.tools.javadoc.main.Start.begin(Start.java:238)
        at jdk.javadoc/com.sun.tools.javadoc.main.Start.begin(Start.java:224)
        at jdk.javadoc/com.sun.tools.javadoc.Main.execute(Main.java:173)
        at jdk.javadoc/jdk.javadoc.internal.tool.Start.begin(Start.java:411)
        at jdk.javadoc/jdk.javadoc.internal.tool.Start.begin(Start.java:340)
        at jdk.javadoc/jdk.javadoc.internal.tool.Main.execute(Main.java:63)
        at jdk.javadoc/jdk.javadoc.internal.tool.Main.main(Main.java:52)
Caused by: java.lang.RuntimeException: unsupported Java version: 9
        at org.jruby.RubyInstanceConfig.initGlobalJavaVersion(RubyInstanceConfig.java:1858)
        at org.jruby.RubyInstanceConfig.<clinit>(RubyInstanceConfig.java:1608)
        ... 22 more

@mojavelinux @ysb33r @headius do you have an idea on how to run Asciidoctor with Java9?

mojavelinux commented 6 years ago

Have you been following https://github.com/asciidoctor/asciidoctorj/issues/591 and https://github.com/asciidoctor/asciidoctorj/issues/515? Simply put, it's a work in progress.

aalmiray commented 6 years ago

Ah, got it. See @tbee? Not a Gradle specific issue per-se 😏 All hail the Java9 overlords that granted us the woes of broken build tools ... not!

tbee commented 6 years ago

Yeah. More likely the real cause is me. I chose to use Gradle for JFXtras to force me to learn it. But the light has not turned on yet; I keep Googling and 'aalmiray'ing my way through any issues. :-) The basics, task definitions, dependencies are quite ok, but the minute it gets more complex I run into that I really don't understand Gradle yet. But having to work through that kinda was the idea, only I 'm becoming frustrated on not having been able to release JFXtras under 9 yet... So thank you for the help!

Oh. In light of that, there is one thing that still eludes me: I'm trying to generate a jfxtras-all (this is on the 8 branch), so there is a shadow task. But its release fails because Maven central requires a javadoc and src artifact and asciidoc can't handle multiple sources. I would be okay if it would simply use the control's javadoc and src artiface for 'all', but how do I do that (look, it gets more complicated)? :-D

aalmiray commented 6 years ago

Oh I know a way to fix that 😏 Asciidoc does support multiple sources, but javadoc may not.

aalmiray commented 6 years ago

Is it a strict requirement that the filename appears at the top of the license header?

aalmiray commented 6 years ago

I've pushed an update to the gradle build, unfortunately there are broken tests in the 8.0 branch

> Task :jfxtras-agenda:test

jfxtras.scene.control.agenda.test.AgendaMenuTest > toggleWholedayInMenu FAILED
    java.lang.AssertionError at AgendaMenuTest.java:161

jfxtras.scene.control.agenda.test.AgendaRenderTest > renderRegularSpanningAppointment FAILED
    java.lang.AssertionError at AgendaRenderTest.java:307

jfxtras.scene.control.agenda.test.AgendaRenderTest > renderOverlappingAppointments FAILED
    java.lang.AssertionError at AgendaRenderTest.java:372

jfxtras.scene.control.agenda.test.AgendaRenderTest > renderWholeDayAppointmentLocalDate FAILED
    java.lang.AssertionError at AgendaRenderTest.java:197

jfxtras.scene.control.agenda.test.AgendaRenderTest > renderRegularAppointmentOffset FAILED
    java.lang.AssertionError at AgendaRenderTest.java:234

jfxtras.scene.control.agenda.test.AgendaRenderTest > renderTwoConsequetiveRegularAppointment FAILED
    java.lang.AssertionError at AgendaRenderTest.java:112

jfxtras.scene.control.agenda.test.AgendaRenderTest > renderRegularAppointment FAILED
    java.lang.AssertionError at AgendaRenderTest.java:88

jfxtras.scene.control.agenda.test.AgendaRenderTest > renderRegularAppointmentCalendar FAILED
    java.lang.AssertionError at AgendaRenderTest.java:159

jfxtras.scene.control.agenda.test.AgendaRenderTest > renderWholeDayAppointment FAILED
    java.lang.AssertionError at AgendaRenderTest.java:336

jfxtras.scene.control.agenda.test.AgendaRenderTest > renderWholeDayAppointmentHijrahDate FAILED
    java.lang.AssertionError at AgendaRenderTest.java:216

jfxtras.scene.control.agenda.test.AgendaRenderTest > renderRegularAppointmentDaySkin FAILED
    java.lang.AssertionError at AgendaRenderTest.java:281

jfxtras.scene.control.agenda.test.AgendaRenderTest > renderRegularAppointmentZoned FAILED
    java.lang.AssertionError at AgendaRenderTest.java:179

jfxtras.scene.control.agenda.test.AgendaRenderTest > renderRegularAppointmentInstant FAILED
    java.lang.AssertionError at AgendaRenderTest.java:260

55 tests completed, 13 failed

Running with

------------------------------------------------------------
Gradle 4.0
------------------------------------------------------------

Build time:   2017-06-14 15:11:08 UTC
Revision:     316546a5fcb4e2dfe1d6aa0b73a4e09e8cecb5a5

Groovy:       2.4.11
Ant:          Apache Ant(TM) version 1.9.6 compiled on June 29 2015
JVM:          1.8.0_162 (Oracle Corporation 25.162-b12)
OS:           Mac OS X 10.12.5 x86_64
tbee commented 6 years ago

You're running the tests on windows, Mac or Linux?

aalmiray commented 6 years ago

I'm running them on Mac

tbee commented 6 years ago

Yeah, I'm running on Windows and JavaFX has subtle differences between those platforms, which I have not included in the tests yet. I need a Mac for that (but working on that).

aalmiray commented 6 years ago

Most failures occur because a strict match of y coordinates could not be found, such as

java.lang.AssertionError: node=pane=2014-01-01T10:00-2014-01-01T12:00;appointment=2014-01-01T10:00-2014-01-01T12:00;sumary=null, Y expected:<419.5> but was:<406.5>

or the height did not match

java.lang.AssertionError: node=appointment=2014-01-01T00:00-2014-01-02T00:00;sumary=null, H expected:<1006.125> but was:<974.90625>

Could a range be used instead? Or is there a platform specific offset that may need to be used?

tbee commented 6 years ago

That are exactly the questions I need answering when I got my old laptop converted to a fake mac.

aalmiray commented 6 years ago

OK. In any case #95 should get you closer to allowing an uber jar with sources and javadoc to be published at MC. May I suggest publishing to Bintray too? It's possible to automatically sync to MC from Bintray with a single command.

tbee commented 6 years ago

What is the advantage of including BinTray?

aalmiray commented 6 years ago

Bintray's JCenter is a superset of the MC. It includes more artifacts than the ones found at MC. You can also skip signing artifacts locally, as Bintray takes care of that, either using it's own, shared certificate or your personal one. JCenter resolves faster than MC.

tbee commented 6 years ago

Released! Including jfxtras-all... Thank you :-)

tbee commented 6 years ago

Ok. And then. Cherry-picked the changes you made for jfxtras-all to the 9 branch. Tried to compile and I get the 'modules are not supported for source 1.8" error. I know. That is why I have specified the sourceCompatibility='9' for allprojects. Why you not listening? :-)

tbee commented 6 years ago

Ok. I'm giving up. I tried to cherry-pick the J8 solution in the 9 branch, but it isn't picking up the source code "9" setting if I do that on the subproject level, only per project. And then it still won't compile. Any chance I can convince you too... (Haven't checked my attempts in yet.)

headius commented 6 years ago

Keep me posted if there's further Java 9 work needed in JRuby. It should be solid for pure-Ruby stuff that doesn't hit low-level APIs (hot selector loops on process IO or something) but we very much want to fix any showstopper issues. I will turn off notifications for now.

aalmiray commented 6 years ago

@headius latest AsciidoctorJ (1.5.6) and Asciidoclet (1.5.4) are now working with JDK9 (JRuby version is 1.7.26).

+--- org.asciidoctor:asciidoclet:1.5.4
|    +--- org.asciidoctor:asciidoctorj:1.5.4 -> 1.5.6
|    |    +--- org.jruby:jruby-complete:1.7.26
|    |    \--- com.beust:jcommander:1.35
|    +--- org.slf4j:slf4j-simple:1.7.13
|    |    \--- org.slf4j:slf4j-api:1.7.13
|    \--- com.google.guava:guava:19.0
\--- org.asciidoctor:asciidoctorj:1.5.6 (*)
tbee commented 6 years ago

And JFXtras is compiling as well. Again; reading what you have done is quite different from having to do it myself. Thank you!

headius commented 3 years ago

Seems like this should be marked resolved, since asciidoctorj is working fine as of @aalmiray's comment above.

JRuby has also had considerable work to support Java 9+ since this time, and I believe asciidoctorj has kept up with those changes.