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

Remove java 8 & 9 multi jar compatibility #1148

Merged
merged 2 commits into from
Nov 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
29 changes: 2 additions & 27 deletions richtextfx/build.gradle
Original file line number Diff line number Diff line change
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.

Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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