Skip to content

Commit

Permalink
Remove java 8 & 9 multi jar compatibility (#1148)
Browse files Browse the repository at this point in the history
* Integrated java9 code, removing multi-jar
* Removed JavaFXCompatibility
  • Loading branch information
Jugen committed Nov 10, 2022
1 parent e7fd3c1 commit 6288ce5
Show file tree
Hide file tree
Showing 10 changed files with 280 additions and 795 deletions.
29 changes: 2 additions & 27 deletions richtextfx/build.gradle
Expand Up @@ -24,22 +24,12 @@ check.dependsOn integrationTest
integrationTest.mustRunAfter test
integrationTest.testClassesDirs = sourceSets.integrationTest.output.classesDirs

sourceSets {
java9 {
java {
srcDirs = ['src/main/java9']
}
}
}

dependencies {
api group: 'org.reactfx', name: 'reactfx', version: '2.0-M5'
api group: 'org.fxmisc.undo', name: 'undofx', version: '2.1.1'
api group: 'org.fxmisc.flowless', name: 'flowless', version: '0.6.9'
api group: 'org.fxmisc.wellbehaved', name: 'wellbehavedfx', version: '0.3.3'

java9Implementation files(sourceSets.main.output.classesDirs) { builtBy compileJava }

testImplementation group: 'junit', name: 'junit', version: '4.12'

integrationTestImplementation group: 'junit', name: 'junit', version: '4.12'
Expand All @@ -52,30 +42,19 @@ dependencies {
}

compileJava {
if ( JavaVersion.current() == JavaVersion.VERSION_1_9 ) {
sourceCompatibility = 9
targetCompatibility = 9
}
options.deprecation = true
}

compileJava9Java {
onlyIf { JavaVersion.current() == JavaVersion.VERSION_1_9 }
sourceCompatibility = 9
targetCompatibility = 9
options.deprecation = true
}

jar {
into 'META-INF/versions/9', { from sourceSets.java9.output }
manifest {
attributes(
'Specification-Title': 'RichTextFX',
'Specification-Version': project.specificationVersion,
'Implementation-Title': 'RichTextFX',
'Implementation-Version': project.version,
'Automatic-Module-Name': 'org.fxmisc.richtext',
'Multi-Release': 'true')
'Automatic-Module-Name': 'org.fxmisc.richtext')
}
}

Expand Down Expand Up @@ -175,7 +154,6 @@ task javadocJar(type: Jar, dependsOn: javadoc) {
}

task sourcesJar(type: Jar) {
into 'java9', { from sourceSets.java9.allSource }
from sourceSets.main.allSource
classifier = 'sources'
}
Expand Down Expand Up @@ -249,10 +227,7 @@ if(doUploadArchives) {

task fatJar(type: Jar, dependsOn: classes) {
archiveAppendix = 'fat'

manifest.attributes( 'Automatic-Module-Name': 'org.fxmisc.richtext',
'Multi-Release': 'true' )
into 'META-INF/versions/9', { from sourceSets.java9.output }
manifest.attributes( 'Automatic-Module-Name': 'org.fxmisc.richtext' )
from sourceSets.main.output
from { configurations.compileClasspath.collect { it.isDirectory() ? it : zipTree(it) } }
}
Expand Down

This file was deleted.

This file was deleted.

Expand Up @@ -63,7 +63,7 @@ class ParagraphText<PS, SEG, S> extends TextFlowExt {
private final SetChangeListener<? super CaretNode> caretNodeListener;

// FIXME: changing it currently has not effect, because
// Text.impl_selectionFillProperty().set(newFill) doesn't work
// Text.selectionFillProperty().set(newFill) doesn't work
// properly for Text node inside a TextFlow (as of JDK8-b100).
private final ObjectProperty<Paint> highlightTextFill = new SimpleObjectProperty<>(Color.WHITE);
public ObjectProperty<Paint> highlightTextFillProperty() {
Expand Down Expand Up @@ -145,7 +145,7 @@ public ObjectProperty<Paint> highlightTextFillProperty() {
// public void changed(ObservableValue<? extends Paint> observable,
// Paint oldFill, Paint newFill) {
// for(PumpedUpText text: textNodes())
// text.impl_selectionFillProperty().set(newFill);
// text.selectionFillProperty().set(newFill);
// }
// });

Expand All @@ -155,7 +155,7 @@ public ObjectProperty<Paint> highlightTextFillProperty() {
TextExt t = (TextExt) n;
// XXX: binding selectionFill to textFill,
// see the note at highlightTextFill
JavaFXCompatibility.Text_selectionFillProperty(t).bind(t.fillProperty());
t.selectionFillProperty().bind(t.fillProperty());
}
getChildren().add(n);
});
Expand Down Expand Up @@ -231,7 +231,7 @@ void dispose() {
carets.removeListener( caretNodeListener );

getChildren().stream().filter( n -> n instanceof TextExt ).map( n -> (TextExt) n )
.forEach( t -> JavaFXCompatibility.Text_selectionFillProperty(t).unbind() );
.forEach( t -> t.selectionFillProperty().unbind() );

getChildren().clear();
}
Expand Down
5 changes: 3 additions & 2 deletions richtextfx/src/main/java/org/fxmisc/richtext/TextExt.java
Expand Up @@ -5,6 +5,7 @@
import java.util.List;

import javafx.beans.property.ObjectProperty;
import javafx.css.converter.SizeConverter;
import javafx.css.CssMetaData;
import javafx.css.StyleConverter;
import javafx.css.Styleable;
Expand Down Expand Up @@ -319,7 +320,7 @@ private static class StyleableProperties {
);

private static final CssMetaData<TextExt, Number[]> BORDER_DASH_ARRAY = new CustomCssMetaData<>(
"-rtfx-border-stroke-dash-array", JavaFXCompatibility.SizeConverter_SequenceConverter_getInstance(),
"-rtfx-border-stroke-dash-array", SizeConverter.SequenceConverter.getInstance(),
new Double[0], n -> n.borderStrokeDashArray
);

Expand All @@ -344,7 +345,7 @@ private static class StyleableProperties {
);

private static final CssMetaData<TextExt, Number[]> UNDERLINE_DASH_ARRAY = new CustomCssMetaData<>(
"-rtfx-underline-dash-array", JavaFXCompatibility.SizeConverter_SequenceConverter_getInstance(),
"-rtfx-underline-dash-array", SizeConverter.SequenceConverter.getInstance(),
new Double[0], n -> n.underlineDashArray
);

Expand Down

0 comments on commit 6288ce5

Please sign in to comment.