Skip to content

Commit d2a4aab

Browse files
Merge pull request #107 from DazedNConfused-/develop
2 parents ea45db1 + 5603e88 commit d2a4aab

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+2518
-810
lines changed

.github/workflows/attachbinarytorelease.yml renamed to .github/workflows/attach_binary_on_manual_release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Attach binary to release
1+
name: Attach binary on manual release
22

33
on:
44
release:

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Java build & test
1+
name: Build & Test
22

33
on: [push]
44

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Pre-release on develop merge
2+
3+
on:
4+
workflow_run:
5+
workflows: ["Build & Test"]
6+
types:
7+
- completed
8+
9+
jobs:
10+
build-and-release:
11+
if: ${{ github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.head_branch == 'develop' }}
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v3
16+
17+
- name: Set up JDK 18
18+
uses: actions/setup-java@v3
19+
with:
20+
java-version: '18'
21+
distribution: 'adopt'
22+
cache: maven
23+
24+
- name: Cache local Maven repository
25+
uses: actions/cache@v3
26+
with:
27+
path: ~/.m2/repository
28+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
29+
restore-keys: |
30+
${{ runner.os }}-maven-
31+
32+
- name: Build with Maven
33+
run: mvn package
34+
35+
- name: Extract Version from POM
36+
id: extract_version
37+
run: echo "version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_OUTPUT
38+
39+
- name: Generate Timestamp
40+
id: gen_timestamp
41+
run: echo "timestamp=$(date +'%Y%m%d_%H%M%S')" >> $GITHUB_OUTPUT
42+
43+
- name: Create Pre-release
44+
id: create_release
45+
uses: actions/create-release@v1
46+
env:
47+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
48+
with:
49+
tag_name: prerelease-${{ steps.extract_version.outputs.version }}-${{ steps.gen_timestamp.outputs.timestamp }}
50+
release_name: Pre-release ${{ steps.extract_version.outputs.version }} (${{ steps.gen_timestamp.outputs.timestamp }})
51+
draft: false
52+
prerelease: true
53+
54+
- name: Upload Release Asset
55+
uses: actions/upload-release-asset@v1
56+
env:
57+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
58+
with:
59+
upload_url: ${{ steps.create_release.outputs.upload_url }}
60+
asset_path: ./target/macatalauncher-${{ steps.extract_version.outputs.version }}.jar
61+
asset_name: macatalauncher-${{ steps.extract_version.outputs.version }}-${{ steps.gen_timestamp.outputs.timestamp }}.jar
62+
asset_content_type: application/java-archive

.github/workflows/sonarcloud.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,8 @@ jobs:
3939
env:
4040
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
4141
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
42-
run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=dazednconfused_macata-launcher
42+
run: |
43+
mvn -B verify sonar:sonar \
44+
-Dsonar.projectKey=dazednconfused_macata-launcher \
45+
-Dsonar.organization=dazednconfused \
46+
-Dsonar.token=$SONAR_TOKEN

.java-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
11.0.24
1+
19.0.2

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535

3636
## Requirements
3737

38-
MaCata requires Java 11 to run.
38+
MaCata requires Java 19 to run.
3939

4040
## Installation
4141

@@ -66,7 +66,8 @@ While not mandatory, if commits are not properly formatted, they may get rejecte
6666
- [x] Soundpack management
6767
- [x] Launcher autoupdater
6868
- [x] Mod management
69-
- [x] Bright Nights support
69+
- [x] [Bright Nights](https://github.com/cataclysmbnteam/Cataclysm-BN) support
70+
- [x] [The Last Generation](https://github.com/Cataclysm-TLG/Cataclysm-TLG) support
7071

7172
### Planned
7273

checkstyle.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,4 +219,10 @@
219219
</module>
220220
<module name="UnusedImports"/>
221221
</module>
222+
223+
<module name="RegexpMultiline">
224+
<property name="format" value="(\n\s*){3,}"/>
225+
<property name="message" value="Too many consecutive blank lines."/>
226+
<property name="severity" value="error"/>
227+
</module>
222228
</module>

pom.xml

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,17 @@
66

77
<groupId>com.dazednconfused</groupId>
88
<artifactId>macatalauncher</artifactId>
9-
<version>0.3.3</version>
9+
<version>0.4.0</version>
1010

1111
<properties>
1212
<maven.compiler.source>11</maven.compiler.source>
1313
<maven.compiler.target>11</maven.compiler.target>
1414
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
1515

16-
<sonar.organization>dazednconfused</sonar.organization>
16+
<sonar.organization>dazednconfused</sonar.organization> <!-- should match .github/workflows/sonarcloud.yml -->
17+
<sonar.projectKey>dazednconfused_macata-launcher</sonar.projectKey> <!-- ^ditto -->
1718
<sonar.host.url>https://sonarcloud.io</sonar.host.url>
18-
<sonar.cpd.exclusions>**/MainWindow.java</sonar.cpd.exclusions>
19+
<sonar.cpd.exclusions>**/gui/**</sonar.cpd.exclusions>
1920
</properties>
2021

2122
<profiles>
@@ -102,16 +103,11 @@
102103
</plugin>
103104

104105
<plugin>
105-
<groupId>org.apache.maven.plugins</groupId>
106-
<artifactId>maven-jar-plugin</artifactId>
107-
<version>3.3.0</version>
106+
<groupId>org.openjfx</groupId>
107+
<artifactId>javafx-maven-plugin</artifactId>
108+
<version>0.0.8</version>
108109
<configuration>
109-
<archive>
110-
<manifest>
111-
<addClasspath>true</addClasspath>
112-
<mainClass>com.dazednconfused.catalauncher.Application</mainClass>
113-
</manifest>
114-
</archive>
110+
<mainClass>com.dazednconfused.catalauncher.Application</mainClass>
115111
</configuration>
116112
</plugin>
117113

@@ -248,6 +244,24 @@
248244
<version>3.0</version>
249245
</dependency>
250246

247+
<dependency>
248+
<groupId>li.flor</groupId>
249+
<artifactId>native-j-file-chooser</artifactId>
250+
<version>1.6.4</version>
251+
</dependency>
252+
253+
<dependency>
254+
<groupId>org.openjfx</groupId>
255+
<artifactId>javafx-controls</artifactId>
256+
<version>19.0.2.1</version>
257+
</dependency>
258+
259+
<dependency>
260+
<groupId>org.openjfx</groupId>
261+
<artifactId>javafx-swing</artifactId>
262+
<version>19.0.2.1</version>
263+
</dependency>
264+
251265
<dependency>
252266
<groupId>org.apache.xmlgraphics</groupId>
253267
<artifactId>batik-all</artifactId>

src/main/java/com/dazednconfused/catalauncher/database/base/BaseDAO.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import java.sql.Statement;
88
import java.util.ArrayList;
99
import java.util.Arrays;
10+
import java.util.Collection;
1011
import java.util.List;
1112
import java.util.Objects;
1213
import java.util.Optional;
@@ -27,6 +28,11 @@ public interface BaseDAO<T extends BaseEntity> {
2728
* */
2829
T insert(T t) throws DAOException;
2930

31+
/**
32+
* Inserts the given {@link BaseEntity}(ies) into the table.
33+
* */
34+
int bulkInsert(Collection<T> t) throws DAOException;
35+
3036
/**
3137
* Updates the given {@link BaseEntity}. It must have an ID set.
3238
* */

src/main/java/com/dazednconfused/catalauncher/database/h2/H2Database.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,6 @@ protected static Result<Throwable, Connection> openConnection(String database) {
104104
).map(Result::success).recover(Result::failure).get();
105105
}
106106

107-
108107
/**
109108
* Completely wipes this database of any and all data, <b>including</b> the underlying schema.
110109
*

0 commit comments

Comments
 (0)