Skip to content

Commit

Permalink
Long-pending 2.0 final release
Browse files Browse the repository at this point in the history
Java version minimum is now v11
Switch to OpenJFX, each platform requires a separate build because JFX is not in JRE
"About" finally does something
Upgraded all dependencies to newer versions all around
  • Loading branch information
Brendan Robert committed Oct 8, 2020
1 parent fa18e7d commit 631afca
Show file tree
Hide file tree
Showing 7 changed files with 169 additions and 109 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/target/
/nbproject/
*.curly_favorites.xml
/dependency-reduced-pom.xml
1 change: 0 additions & 1 deletion nb-configuration.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,5 @@ Any value defined here will override the pom.xml file value but is only applicab
<netbeans.compile.on.save>all</netbeans.compile.on.save>
<org-netbeans-modules-javascript2-requirejs.enabled>false</org-netbeans-modules-javascript2-requirejs.enabled>
<netbeans.hint.licensePath>${project.basedir}/licenseheader.txt</netbeans.hint.licensePath>
<netbeans.hint.jdkPlatform>JDK_1.8</netbeans.hint.jdkPlatform>
</properties>
</project-shared-configuration>
167 changes: 83 additions & 84 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>com.adobe.ags.curly</groupId>
<artifactId>Curly</artifactId>
<version>2.0-SNAPSHOT</version>
<version>2.0</version>
<packaging>jar</packaging>

<name>Curly</name>
Expand All @@ -13,67 +13,31 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<mainClass>com.adobe.ags.curly.CurlyApp</mainClass>
<netbeans.hint.license>apache20</netbeans.hint.license>
<javafx.version>11</javafx.version>
<poi.version>4.1.2</poi.version>
</properties>

<organization>
<name>Adobe Global Services</name>
<name>Adobe Customer Solutions</name>
</organization>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.10</version>
<executions>
<execution>
<id>unpack-dependencies</id>
<phase>package</phase>
<goals>
<goal>unpack-dependencies</goal>
</goals>
<configuration>
<excludeScope>system</excludeScope>
<excludeGroupIds>junit,org.mockito,org.hamcrest</excludeGroupIds>
<outputDirectory>${project.build.directory}/classes</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.4.0</version>
<executions>
<execution>
<id>unpack-dependencies</id>

<phase>package</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>${java.home}/../bin/javapackager</executable>
<arguments>
<argument>-createjar</argument>
<argument>-nocss2bin</argument>
<argument>-appclass</argument>
<argument>${mainClass}</argument>
<argument>-srcdir</argument>
<argument>${project.build.directory}/classes</argument>
<argument>-outdir</argument>
<argument>${project.build.directory}</argument>
<argument>-outfile</argument>
<argument>${project.build.finalName}.jar</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
<groupId>org.openjfx</groupId>
<artifactId>javafx-maven-plugin</artifactId>
<version>0.0.4</version>
<configuration>
<release>${maven.compiler.release}</release>
<jlinkImageName>curly</jlinkImageName>
<launcher>launcher</launcher>
<mainClass>org.adobe.ags.curly.CurlyApp</mainClass>
</configuration>
</plugin>
<plugin>
<groupId>org.jvnet.jaxb2.maven2</groupId>
<artifactId>maven-jaxb2-plugin</artifactId>
<version>0.12.3</version>
<version>0.14.0</version>
<executions>
<execution>
<goals>
Expand All @@ -92,60 +56,64 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.2</version>
<version>3.8.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<compilerArguments>
<bootclasspath>${sun.boot.class.path}${path.separator}${java.home}/lib/jfxrt.jar</bootclasspath>
</compilerArguments>
<source>11</source>
<target>11</target>
<release>${maven.compiler.release}</release>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.18</version>
<configuration>
<additionalClasspathElements>
<additionalClasspathElement>${java.home}/lib/jfxrt.jar</additionalClasspathElement>
</additionalClasspathElements>
<argLine>-Dglass.platform=Monocle -Djavafx.monocle.headless=true -Dprism.order=sw</argLine>
</configuration>
<version>2.22.2</version>
</plugin>
<plugin>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.4</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>com.adobe.ags.curly.CurlyLauncher</mainClass>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>javafx-packager</groupId>
<artifactId>javafx-packager</artifactId>
<version>1.8</version>
<systemPath>${java.home}/../lib/ant-javafx.jar</systemPath>
<scope>system</scope>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5</version>
<version>4.5.12</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.3.1</version>
<version>2.8.6</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.12</version>
<version>${poi.version}</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.12</version>
<version>${poi.version}</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml-schemas</artifactId>
<version>3.12</version>
<version>${poi.version}</version>
</dependency>
<dependency>
<groupId>dom4j</groupId>
Expand All @@ -155,28 +123,59 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<version>4.13</version>
<scope>test</scope>
<type>jar</type>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-core</artifactId>
<version>1.3</version>
<version>2.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpmime</artifactId>
<version>4.3.4</version>
<version>4.5.12</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>org.jfxtras</groupId>
<artifactId>openjfx-monocle</artifactId>
<version>1.8.0_20</version>
<scope>test</scope>
<groupId>org.openjfx</groupId>
<artifactId>javafx-controls</artifactId>
<version>${javafx.version}</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-fxml</artifactId>
<version>${javafx.version}</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-web</artifactId>
<version>${javafx.version}</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-swing</artifactId>
<version>${javafx.version}</version>
</dependency>
<dependency>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
<version>2.3.2</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId>
<version>2.3.3</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>jakarta.activation</groupId>
<artifactId>jakarta.activation-api</artifactId>
<version>1.2.2</version>
<type>jar</type>
</dependency>
</dependencies>

</project>
26 changes: 26 additions & 0 deletions src/main/java/com/adobe/ags/curly/CurlyLauncher.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* Copyright 2020 Adobe Global Services.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.adobe.ags.curly;

/**
* Work-around for shaded jar to launch correctly
* @author brobert
*/
public class CurlyLauncher {
public static void main(String[] args) {
CurlyApp.main(args);
}
}
30 changes: 22 additions & 8 deletions src/main/java/com/adobe/ags/curly/controller/AppController.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/*
* Copyright 2015 Adobe.
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -18,12 +18,12 @@
import com.adobe.ags.curly.ApplicationState;
import com.adobe.ags.curly.ConnectionManager;
import com.adobe.ags.curly.CurlyApp;
import static com.adobe.ags.curly.Messages.NO_DATA_LOADED;
import com.adobe.ags.curly.model.ActionUtils;
import com.adobe.ags.curly.xml.Action;
import com.adobe.ags.curly.xml.ErrorBehavior;
import com.sun.javafx.collections.ObservableListWrapper;
import java.io.File;
import java.io.IOException;
import java.net.URL;
import java.util.ArrayList;
import java.util.HashMap;
Expand Down Expand Up @@ -60,6 +60,8 @@
import javafx.scene.paint.Color;
import javafx.stage.FileChooser;

import static com.adobe.ags.curly.Messages.NO_DATA_LOADED;

public class AppController {

Map<String, StringProperty> defaults;
Expand Down Expand Up @@ -194,6 +196,18 @@ void saveActionSequence(ActionEvent event) {
}
}

@FXML
void showHelp(ActionEvent event) throws IOException {
String url = "https://github.com/Adobe-Consulting-Services/curly/wiki/How-to-Use-Curly";
Runtime rt = Runtime.getRuntime();
String os = System.getProperty("os.name").toLowerCase();
if (os.contains("win")) {
rt.exec("rundll32 url.dll,FileProtocolHandler " + url);
} else {
rt.exec("open " + url);
}
}

@FXML // This method is called by the FXMLLoader when initialization is complete
void initialize() {
assert connectionTab != null : "fx:id=\"connectionTab\" was not injected: check your FXML file 'App.fxml'.";
Expand Down Expand Up @@ -237,7 +251,7 @@ void initialize() {
batchDataTable.setPlaceholder(new Label(ApplicationState.getMessage(NO_DATA_LOADED)));
batchDataTable.setRowFactory((TableView<Map<String, String>> param) -> {
final TableRow<Map<String, String>> row = new TableRow<>();
row.indexProperty().addListener((property, newValue, oldValue)->updateRowHighlight(row));
row.indexProperty().addListener((property, newValue, oldValue) -> updateRowHighlight(row));
highlightedRows.addListener((ListChangeListener.Change<? extends Integer> c) -> updateRowHighlight(row));
return row;
});
Expand Down Expand Up @@ -300,13 +314,13 @@ private void updateBatchSize(String newValue) {
batchSize.clear();
batchSizeValue = -1;
if (newValue != null && !newValue.isEmpty()) {
Platform.runLater(()->batchSize.setText(null));
Platform.runLater(() -> batchSize.setText(null));
}
} else {
batchNumberChoice.setDisable(false);
int numBatches = (batchDataTable.getItems().size() + batchSizeValue - 1) / batchSizeValue;
numBatches = Math.min(numBatches, 50);
List<Integer> selections = IntStream.range(1, numBatches+1).boxed().collect(Collectors.toList());
List<Integer> selections = IntStream.range(1, numBatches + 1).boxed().collect(Collectors.toList());
batchNumberChoice.setItems(new ObservableListWrapper<>(selections));
batchNumberChoice.setValue(1);
}
Expand Down Expand Up @@ -336,9 +350,9 @@ private void updateRowHighlight(TableRow<Map<String, String>> row) {
b = 200;
}
if (row.getIndex() % 2 == 1) {
r = Math.max(0, r-16);
g = Math.max(0, g-16);
b = Math.max(0, b-16);
r = Math.max(0, r - 16);
g = Math.max(0, g - 16);
b = Math.max(0, b - 16);
}
row.setBackground(new Background(new BackgroundFill(Color.rgb(r, g, b), null, null)));
}
Expand Down
Loading

0 comments on commit 631afca

Please sign in to comment.