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

Improve launcher command line interface. #1682

Merged
merged 8 commits into from
Oct 19, 2024
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,9 @@ Chunky uses the following 3rd party libraries:
- **Apache Maven Artifact by the Apache Software Foundation**
The library is covered by the Apache License, version 2.0.
See the file `licenses/Apache-2.0.txt` for the full license text.
- **Apache Commons CLI by the Apache Software Foundation**
The library is covered by the Apache License, version 2.0.
See the file `licenses/Apache-2.0.txt` for the full license text.
- **FastUtil by Sebastiano Vigna**
FastUtil is covered by Apache License, version 2.0.
See the file `licenses/Apache-2.0.txt` for the full license text.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
import javafx.scene.layout.VBox;
import javafx.scene.text.Font;
import javafx.stage.Stage;
import se.llbit.chunky.HelpCopyright;
import se.llbit.chunky.main.Chunky;
import se.llbit.chunky.plugin.PluginApi;
import se.llbit.chunky.ui.ChunkyFx;
Expand All @@ -49,10 +50,11 @@
import se.llbit.util.Pair;

public class CreditsController implements Initializable {

@FXML
private Label version;
@FXML
public Label copyrightLine;
@FXML
private Hyperlink gplv3;
@FXML
private Hyperlink markdown;
Expand Down Expand Up @@ -83,6 +85,10 @@ public class CreditsController implements Initializable {
@FXML
private Hyperlink lz4JavaLicense;
@FXML
private Hyperlink apacheCli;
@FXML
private Hyperlink apacheCliLicense;
@FXML
private VBox pluginBox;
@FXML
private ImageView logoImage;
Expand Down Expand Up @@ -140,6 +146,8 @@ public void initialize(URL location, ResourceBundle resources) {

version.setText(Chunky.getMainWindowTitle());

copyrightLine.setText(HelpCopyright.COPYRIGHT_LINE);

gplv3.setOnAction(
e -> launchAndReset(gplv3, "https://github.com/chunky-dev/chunky/blob/master/LICENSE")
);
Expand Down Expand Up @@ -189,6 +197,11 @@ public void initialize(URL location, ResourceBundle resources) {
lz4JavaLicense.setBorder(Border.EMPTY);
lz4JavaLicense.setOnAction(e -> launchAndReset(lz4JavaLicense, "https://github.com/lz4/lz4-java/blob/master/LICENSE.txt"));

apacheCli.setBorder(Border.EMPTY);
apacheCli.setOnAction(e -> launchAndReset(apacheCli, "https://commons.apache.org/proper/commons-cli/"));
apacheCliLicense.setBorder(Border.EMPTY);
apacheCliLicense.setOnAction(e -> launchAndReset(apacheCliLicense, "http://www.apache.org/licenses/LICENSE-2.0"));

if (!plugins.isEmpty()) {
plugins.forEach((key, item) -> pluginBox.getChildren().addAll(buildBox(item)));
} else {
Expand Down
16 changes: 15 additions & 1 deletion chunky/src/res/se/llbit/chunky/ui/dialogs/Credits.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<Font name="System Bold" size="14.0"/>
</font>
</Label>
<Label text="Copyright (c) 2010-2024, Jesper Öqvist and Chunky contributors." wrapText="true">
<Label fx:id="copyrightLine" text="Copyright (c) 2010-2024, Jesper Öqvist and Chunky contributors" wrapText="true">
<padding>
<Insets top="10.0"/>
</padding>
Expand Down Expand Up @@ -249,6 +249,20 @@
<Insets left="20.0" />
</padding>
</Hyperlink>

<Hyperlink fx:id="apacheCli" text="Apache Commons CLI">
<padding>
<Insets/>
</padding>
</Hyperlink>
<Hyperlink fx:id="apacheCliLicense" text="Apache License 2.0">
<font>
<Font size="10.0"/>
</font>
<padding>
<Insets left="20.0"/>
</padding>
</Hyperlink>
</children>
</VBox>
</children>
Expand Down
27 changes: 20 additions & 7 deletions launcher/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,13 @@ configurations {
}

dependencies {
bundled 'org.apache.maven:maven-artifact:3.9.9'
bundled 'org.apache.maven:maven-artifact:3.9.9'
bundled 'commons-cli:commons-cli:1.6.0'

implementation project(':lib')
implementation project(':lib')

testImplementation 'com.google.truth:truth:1.1.3'
testImplementation 'junit:junit:4.13.2'
}

java {
Expand All @@ -21,13 +25,22 @@ java {
}
}

sourceSets.main {
java.srcDir 'src'
sourceSets {
main {
java {
srcDir 'src'
}
resources {
srcDir 'src'
include '**/*.png'
include '**/*.fxml'
srcDir 'src'
include '**/*.png'
include '**/*.fxml'
}
}
test {
java {
srcDir 'test'
}
}
}

jar {
Expand Down
Loading