Skip to content

Commit eab713c

Browse files
authored
Merge pull request #138 from doubleSlashde/feature/macSupport
Spring 3 + Mac support
2 parents 2278df0 + e87b12d commit eab713c

File tree

24 files changed

+239
-236
lines changed

24 files changed

+239
-236
lines changed

.github/workflows/mavenCi.yml

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -19,28 +19,28 @@ jobs:
1919
runs-on: ubuntu-latest
2020

2121
env:
22-
version: 1.3.${{ github.run_number }}
22+
version: 2.0.${{ github.run_number }}
2323

2424
steps:
25-
- uses: actions/checkout@v3
25+
- uses: actions/checkout@v4
2626

27-
- name: Set up JDK 11
28-
uses: actions/setup-java@v3
27+
- name: Set up JDK 17
28+
uses: actions/setup-java@v4
2929
with:
30-
java-version: '11'
30+
java-version: '17'
3131
distribution: 'corretto'
3232
cache: maven
3333

3434
- name: Initialize CodeQL
35-
uses: github/codeql-action/init@v2
35+
uses: github/codeql-action/init@v3
3636
with:
3737
languages: 'java'
3838

3939
- name: Build
4040
run: mvn -V -B clean package org.jacoco:jacoco-maven-plugin:0.8.7:prepare-agent org.jacoco:jacoco-maven-plugin:0.8.7:report -Pcoverage -Dproject.version=${{ env.version }}-SNAPSHOT
4141

4242
- name: Upload Build Artifact
43-
uses: actions/upload-artifact@v3
43+
uses: actions/upload-artifact@v4
4444
with:
4545
name: KeepTime-${{ env.version }}
4646
path: /home/runner/work/KeepTime/KeepTime/target/*-bin.zip
@@ -49,27 +49,22 @@ jobs:
4949
env:
5050
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5151
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
52-
run: mvn -V -B sonar:sonar
53-
-Dsonar.host.url=${{ secrets.HOST_URL }}
54-
-Dsonar.organization=${{ secrets.ORGANIZATION_NAME }}
55-
-Dsonar.projectKey=${{ secrets.PROJECT_KEY }}
56-
-Dsonar.java.binaries=.
57-
-Dsonar.qualitygate.wait=false
52+
run: mvn -V -B sonar:sonar -Dsonar.host.url=${{ secrets.HOST_URL }} -Dsonar.organization=${{ secrets.ORGANIZATION_NAME }} -Dsonar.projectKey=${{ secrets.PROJECT_KEY }} -Dsonar.java.binaries=. -Dsonar.qualitygate.wait=false
5853

5954
- name: Perform CodeQL Analysis
60-
uses: github/codeql-action/analyze@v2
55+
uses: github/codeql-action/analyze@v3
6156

6257
dependency-check:
6358

6459
runs-on: ubuntu-latest
6560

6661
steps:
67-
- uses: actions/checkout@v3
62+
- uses: actions/checkout@v4
6863

69-
- name: Set up JDK 11
70-
uses: actions/setup-java@v3
64+
- name: Set up JDK 17
65+
uses: actions/setup-java@v4
7166
with:
72-
java-version: '11'
67+
java-version: '17'
7368
distribution: 'corretto'
7469
cache: maven
7570

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ You should put the .jar in an extra folder as a *logs* and a *db* folder will be
6464
7. To see the changes just start the new KeepTime again
6565

6666
## Requirements
67-
68-
* Windows 7, 10
69-
* Linux (tested on Ubuntu 18.04)
70-
* Java 11
67+
* Operating System
68+
* Windows 7, 10, 11
69+
* Linux (tested on Ubuntu 18.04)
70+
* Mac (tested on MacBook M2 Pro (ARM based CPU))
71+
* Java 17

pom.xml

Lines changed: 81 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,29 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
44
<modelVersion>4.0.0</modelVersion>
55

6+
<parent>
7+
<groupId>org.springframework.boot</groupId>
8+
<artifactId>spring-boot-starter-parent</artifactId>
9+
<version>3.1.10</version>
10+
<relativePath />
11+
<!-- lookup parent from repository -->
12+
</parent>
613
<groupId>de.doubleslash</groupId>
714
<artifactId>keeptime</artifactId>
815
<version>${project.version}</version>
9-
<packaging>jar</packaging>
1016

17+
<packaging>jar</packaging>
1118
<name>KeepTime</name>
19+
1220
<description>Time tracker</description>
1321

22+
<organization>
23+
<name>doubleSlash Net-Business GmbH</name>
24+
<url>https://www.doubleslash.de/</url>
25+
</organization>
26+
1427
<licenses>
1528
<license>
1629
<name>GNU General Public License (GPL) version 3.0</name>
@@ -19,26 +32,14 @@
1932
</license>
2033
</licenses>
2134

22-
<organization>
23-
<name>doubleSlash Net-Business GmbH</name>
24-
<url>https://www.doubleslash.de/</url>
25-
</organization>
26-
27-
<parent>
28-
<groupId>org.springframework.boot</groupId>
29-
<artifactId>spring-boot-starter-parent</artifactId>
30-
<version>2.7.5</version>
31-
<relativePath /> <!-- lookup parent from repository -->
32-
</parent>
33-
3435
<properties>
35-
<project.version>1.3.0-SNAPSHOT</project.version>
36+
<project.version>2.0.0-SNAPSHOT</project.version>
3637
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
3738
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
38-
<maven.compiler.source>11</maven.compiler.source>
39-
<maven.compiler.target>11</maven.compiler.target>
39+
<java.version>17</java.version>
40+
<javafx.version>22</javafx.version>
4041

41-
<maven-dependency-check.version>8.0.2</maven-dependency-check.version>
42+
<maven-dependency-check.version>9.1.0</maven-dependency-check.version>
4243
<!-- USING HTML,XML (comma-separated list) did not work with plugin version 5.1.0 -->
4344
<maven-dependency-check.format>ALL</maven-dependency-check.format>
4445
<maven-dependency-check.failOnError>true</maven-dependency-check.failOnError>
@@ -50,34 +51,45 @@
5051
<dependency>
5152
<groupId>org.openjfx</groupId>
5253
<artifactId>javafx-controls</artifactId>
53-
<version>11.0.2</version>
54+
<version>${javafx.version}</version>
5455
</dependency>
5556
<dependency>
5657
<groupId>org.openjfx</groupId>
5758
<artifactId>javafx-fxml</artifactId>
58-
<version>11.0.2</version>
59+
<version>${javafx.version}</version>
5960
</dependency>
6061
<dependency>
6162
<groupId>org.openjfx</groupId>
6263
<artifactId>javafx-swing</artifactId>
63-
<version>11</version>
64+
<version>${javafx.version}</version>
6465
</dependency>
6566
<dependency>
6667
<groupId>org.openjfx</groupId>
6768
<artifactId>javafx-graphics</artifactId>
68-
<version>11.0.2</version>
69+
<version>${javafx.version}</version>
6970
<classifier>win</classifier>
7071
</dependency>
7172
<dependency>
7273
<groupId>org.openjfx</groupId>
7374
<artifactId>javafx-graphics</artifactId>
74-
<version>11.0.2</version>
75+
<version>${javafx.version}</version>
7576
<classifier>linux</classifier>
7677
</dependency>
78+
<dependency>
79+
<groupId>org.openjfx</groupId>
80+
<artifactId>javafx-graphics</artifactId>
81+
<version>${javafx.version}</version>
82+
<classifier>mac-aarch64</classifier>
83+
</dependency>
7784
<dependency>
7885
<groupId>org.springframework.boot</groupId>
7986
<artifactId>spring-boot-starter-data-jpa</artifactId>
8087
</dependency>
88+
<dependency>
89+
<groupId>org.glassfish.jaxb</groupId>
90+
<artifactId>jaxb-runtime</artifactId>
91+
<scope>provided</scope>
92+
</dependency>
8193

8294
<dependency>
8395
<groupId>com.h2database</groupId>
@@ -105,64 +117,32 @@
105117
<dependency>
106118
<groupId>org.apache.maven.plugins</groupId>
107119
<artifactId>maven-assembly-plugin</artifactId>
108-
<version>3.4.2</version>
120+
<version>3.7.1</version>
109121
<type>maven-plugin</type>
110122
</dependency>
111123
<dependency>
112124
<groupId>org.sonarsource.scanner.maven</groupId>
113125
<artifactId>sonar-maven-plugin</artifactId>
114-
<version>3.9.1.2184</version>
126+
<version>3.11.0.3922</version>
115127
</dependency>
116128
<dependency>
117129
<groupId>org.hamcrest</groupId>
118130
<artifactId>hamcrest-library</artifactId>
119-
<version>2.2</version>
120131
<scope>test</scope>
121132
</dependency>
122133
</dependencies>
123-
<profiles>
124-
<profile>
125-
<id>coverage</id>
126-
<build>
127-
<plugins>
128-
<plugin>
129-
<groupId>org.jacoco</groupId>
130-
<artifactId>jacoco-maven-plugin</artifactId>
131-
<version>0.8.7</version>
132-
<executions>
133-
<execution>
134-
<id>prepare-agent</id>
135-
<goals>
136-
<goal>prepare-agent</goal>
137-
</goals>
138-
</execution>
139-
<execution>
140-
<id>report</id>
141-
<goals>
142-
<goal>report</goal>
143-
</goals>
144-
<configuration>
145-
<formats>
146-
<format>XML</format>
147-
</formats>
148-
</configuration>
149-
</execution>
150-
</executions>
151-
</plugin>
152-
</plugins>
153-
</build>
154-
</profile>
155-
</profiles>
156134
<build>
135+
<finalName>keeptime-${project.version}</finalName>
136+
157137
<plugins>
158138
<plugin>
159139
<groupId>org.springframework.boot</groupId>
160140
<artifactId>spring-boot-maven-plugin</artifactId>
161141
</plugin>
162142

163143
<plugin>
164-
<groupId>pl.project13.maven</groupId>
165-
<artifactId>git-commit-id-plugin</artifactId>
144+
<groupId>io.github.git-commit-id</groupId>
145+
<artifactId>git-commit-id-maven-plugin</artifactId>
166146
<configuration>
167147
<generateGitPropertiesFile>false</generateGitPropertiesFile>
168148
</configuration>
@@ -181,7 +161,6 @@
181161
<descriptors>
182162
<descriptor>./assembly.xml</descriptor>
183163
</descriptors>
184-
<finalName>keeptime-${project.version}</finalName>
185164
</configuration>
186165
</execution>
187166
</executions>
@@ -207,16 +186,15 @@
207186
<suppressionFile>dependency-check-report_suppressions.xml</suppressionFile>
208187
</configuration>
209188
<executions>
210-
<execution>
211-
<goals>
212-
<goal>check</goal>
213-
</goals>
214-
</execution>
189+
<execution>
190+
<goals>
191+
<goal>check</goal>
192+
</goals>
193+
</execution>
215194
</executions>
216195
</plugin>
217196
</plugins>
218197
</build>
219-
220198
<!-- generate site with mvn site (including dependency check) -->
221199
<reporting>
222200
<plugins>
@@ -242,4 +220,38 @@
242220
</plugin>
243221
</plugins>
244222
</reporting>
245-
</project>
223+
224+
<profiles>
225+
<profile>
226+
<id>coverage</id>
227+
<build>
228+
<plugins>
229+
<plugin>
230+
<groupId>org.jacoco</groupId>
231+
<artifactId>jacoco-maven-plugin</artifactId>
232+
<version>0.8.7</version>
233+
<executions>
234+
<execution>
235+
<id>prepare-agent</id>
236+
<goals>
237+
<goal>prepare-agent</goal>
238+
</goals>
239+
</execution>
240+
<execution>
241+
<id>report</id>
242+
<goals>
243+
<goal>report</goal>
244+
</goals>
245+
<configuration>
246+
<formats>
247+
<format>XML</format>
248+
</formats>
249+
</configuration>
250+
</execution>
251+
</executions>
252+
</plugin>
253+
</plugins>
254+
</build>
255+
</profile>
256+
</profiles>
257+
</project>

src/main/java/de/doubleslash/keeptime/App.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ public void init() throws Exception {
9595

9696
model = springContext.getBean(Model.class);
9797
controller = springContext.getBean(Controller.class);
98+
controller.enableAutoSave();
9899
model.setSpringContext(springContext);
99100
}
100101

@@ -144,6 +145,7 @@ private void initialiseApplication(final Stage primaryStage) throws Exception {
144145
readSettings();
145146

146147
final List<Work> todaysWorkItems = model.getWorkRepository().findByStartDateOrderByStartTimeAsc(LocalDate.now());
148+
147149
LOG.info("Found {} past work items", todaysWorkItems.size());
148150
model.getPastWorkItems().addAll(todaysWorkItems);
149151

@@ -184,6 +186,7 @@ private void readSettings() {
184186
final List<Settings> settingsList = model.getSettingsRepository().findAll();
185187
final Settings settings;
186188
if (settingsList.isEmpty()) {
189+
LOG.info("Empty settings. Set default");
187190
settings = new Settings();
188191
settings.setTaskBarColor(model.taskBarColor.get());
189192

@@ -197,6 +200,7 @@ private void readSettings() {
197200
settings.setHideProjectsOnMouseExit(false);
198201
model.getSettingsRepository().save(settings);
199202
} else {
203+
LOG.info("Got settings from database");
200204
settings = settingsList.get(0);
201205
}
202206

@@ -239,7 +243,7 @@ private void initialisePopupUI(final Stage primaryStage) throws IOException {
239243
final ViewControllerPopup viewControllerPopupController = loader.getController();
240244
viewControllerPopupController.setStage(popupViewStage);
241245

242-
if (!OS.isLinux()) {
246+
if (OS.isWindows()) {
243247
globalScreenListener = new GlobalScreenListener();
244248
globalScreenListener.register(model.useHotkey.get());
245249
globalScreenListener.setViewController(viewControllerPopupController);

0 commit comments

Comments
 (0)