Skip to content

Commit c2a6bbe

Browse files
authored
Merge branch 'develop' into feature/macSupport
2 parents 58405c7 + 420eb18 commit c2a6bbe

23 files changed

Lines changed: 249 additions & 69 deletions

.github/workflows/mavenCi.yml

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ on:
1414

1515
jobs:
1616

17-
Analyze_Build_Upload:
17+
build-analyze:
1818

1919
runs-on: ubuntu-latest
2020

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

2424
steps:
2525
- uses: actions/checkout@v3
@@ -30,15 +30,14 @@ jobs:
3030
java-version: '17'
3131
distribution: 'corretto'
3232
cache: maven
33-
34-
# Initializes the CodeQL tools for scanning.
33+
3534
- name: Initialize CodeQL
3635
uses: github/codeql-action/init@v2
3736
with:
3837
languages: 'java'
39-
38+
4039
- name: Build
41-
run: mvn -V -B -DskipTests=true clean verify 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
40+
run: mvn -V -B -DskipTests=true 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
4241

4342
- name: Upload Build Artifact
4443
uses: actions/upload-artifact@v3
@@ -59,3 +58,20 @@ jobs:
5958

6059
- name: Perform CodeQL Analysis
6160
uses: github/codeql-action/analyze@v2
61+
62+
dependency-check:
63+
64+
runs-on: ubuntu-latest
65+
66+
steps:
67+
- uses: actions/checkout@v3
68+
69+
- name: Set up JDK 11
70+
uses: actions/setup-java@v3
71+
with:
72+
java-version: '11'
73+
distribution: 'corretto'
74+
cache: maven
75+
76+
- name: dependencyCheck
77+
run: mvn dependency-check:check

CHANGELOG.md

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

33
All notable changes to this project will be documented in this file.
44

5-
## v1.3.TODO - 2023-01-11
5+
## v1.3.x - 2023-02-14
66

77
### Added
88
- option to show note reminder only when switching from a work project without notes
@@ -25,7 +25,7 @@ All notable changes to this project will be documented in this file.
2525
### Fixed
2626
- 'hide projects' setting was not working correctly on linux. we disabled the setting for linux
2727

28-
## v1.2.0 - yyyy-mm-dd
28+
## v1.2.0 - 2021-04-14
2929

3030
### Added
3131

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ Create projects and choose if they are counted as 'work time'. Select the projec
3535

3636
## Install
3737

38-
* Download keeptime.bat and keeptime-<version>-bin.zip (see [releases](https://github.com/doubleSlashde/KeepTime/releases))
38+
* Download keeptime-<version>.zip (see [releases](https://github.com/doubleSlashde/KeepTime/releases))
3939
* Extract the downloaded .zip
40-
* Copy the downloaded keeptime.bat file next to the *.jar*. Adapt the path inside the *keeptime.bat* to the name of the *.jar* file (if needed). Try starting the application by executing the *keeptime.bat* file. The start may take up to one minute.
40+
* Try starting the application by executing the *keeptime.bat* file. The start may take up to one minute.
4141

4242
It is recommended to run the application at computer start, so you do not forget to track your time. For autostart also execute the following steps (for windows)
4343
* Open the autostart folder: Press *Windows+R*, execute *shell:startup*
@@ -67,4 +67,4 @@ You should put the .jar in an extra folder as a *logs* and a *db* folder will be
6767

6868
* Windows 7, 10
6969
* Linux (tested on Ubuntu 18.04)
70-
* Java 11
70+
* Java 11

assembly.xml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<id>bin</id>
55

66
<formats>
7-
<format>zip</format>
7+
<format>zip</format>
88
</formats>
99

1010
<includeBaseDirectory>false</includeBaseDirectory>
@@ -15,12 +15,19 @@
1515
<outputDirectory>licenses</outputDirectory>
1616
</fileSet>
1717
</fileSets>
18+
<files>
19+
<file>
20+
<source>${project.basedir}/keeptime.bat</source>
21+
</file>
22+
</files>
1823

1924
<dependencySets>
2025
<dependencySet>
2126
<includes>
2227
<include>de.doubleslash:keeptime</include>
2328
</includes>
29+
<!-- default value is ${artifact.artifactId}-${artifact.version}${dashClassifier?}.${artifact.extension} - #152 removed version-->
30+
<outputFileNameMapping>${artifact.artifactId}.${artifact.extension}</outputFileNameMapping>
2431
</dependencySet>
2532
</dependencySets>
2633
</assembly>
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<suppressions xmlns="https://jeremylong.github.io/DependencyCheck/dependency-suppression.1.3.xsd">
3+
<suppress>
4+
<notes>
5+
<![CDATA[
6+
file name: maven-core-3.0.jar
7+
suppression-reason: referenced from 'maven-assembly-plugin' which is executed in build step (no runtime vulnerability). no assembly-plugin update available.
8+
]]>
9+
</notes>
10+
<packageUrl regex="true">^pkg:maven/org\.apache\.maven/maven\-core@.*$</packageUrl>
11+
<cve>CVE-2021-26291</cve>
12+
</suppress>
13+
<suppress>
14+
<notes>
15+
<![CDATA[
16+
file name: maven-settings-3.0.jar
17+
suppression-reason: referenced from 'maven-assembly-plugin' which is executed in build step (no runtime vulnerability). no assembly-plugin update available.
18+
]]>
19+
</notes>
20+
<packageUrl regex="true">^pkg:maven/org\.apache\.maven/maven\-settings@.*$</packageUrl>
21+
<vulnerabilityName>CVE-2021-26291</vulnerabilityName>
22+
</suppress>
23+
<suppress>
24+
<notes>
25+
<![CDATA[
26+
file name: snakeyaml-1.30.jar
27+
suppression-reason: we are not using .yaml files
28+
]]>
29+
</notes>
30+
<packageUrl regex="true">^pkg:maven/org\.yaml/snakeyaml@.*$</packageUrl>
31+
<cve>CVE-2022-1471</cve>
32+
</suppress>
33+
</suppressions>
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/bin/bash
2+
H2_VERSION=1.4.197
3+
DB_URL=jdbc:h2:file:./db/$H2_VERSION/keeptime-h2-db;DB_CLOSE_ON_EXIT=FALSE
4+
DB_USER=sa
5+
DB_PASSWD=
6+
SQL_BACKUP_FILENAME=KeepTime_database-export_H2-version-$H2_VERSION.sql
7+
8+
echo "Script to export the content of H2 databse from KeepTime version 1.2.0-SNAPSHOT to .sql file."
9+
echo "The script should be placed next to the .jar file."
10+
read -p "Press enter to continue"
11+
12+
echo -e "\nExtracting H2 driver from KeepTime .jar file."
13+
DRIVER_JAR_FROM_KEEPTIME=BOOT-INF/lib/h2-$H2_VERSION.jar
14+
jar xfv keeptime-1.2.0-SNAPSHOT.jar $DRIVER_JAR_FROM_KEEPTIME
15+
16+
echo -e "\nTriggering database backup."
17+
java -cp $DRIVER_JAR_FROM_KEEPTIME org.h2.tools.Script -url $DB_URL -user $DB_USER -script $SQL_BACKUP_FILENAME -options DROP
18+
19+
echo -e "\nCleanup of extracted .jar file."
20+
rm -rv BOOT-INF
21+
22+
echo -e "\nIf no error occured the export has succeeded."
23+
echo "The exported file was created at '$(pwd)/$SQL_BACKUP_FILENAME'."
24+
echo -e "\nYou can now import this file in a new version of KeepTime.\n"
25+
26+
read -p "All set. Press enter to exit script."

keeptime.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
start "" "javaw" -Dprism.order=sw -jar keeptime-1.2.0-SNAPSHOT.jar
1+
start "" "javaw" -Dprism.order=sw -jar keeptime.jar

pom.xml

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@
3232
</parent>
3333

3434
<properties>
35-
<project.version>1.2.0-SNAPSHOT</project.version>
35+
<project.version>1.3.0-SNAPSHOT</project.version>
3636
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
3737
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
3838
<maven.compiler.source>17</maven.compiler.source>
3939
<maven.compiler.target>17</maven.compiler.target>
4040

41-
<maven-dependency-check.version>6.0.5</maven-dependency-check.version>
41+
<maven-dependency-check.version>8.0.2</maven-dependency-check.version>
4242
<!-- USING HTML,XML (comma-separated list) did not work with plugin version 5.1.0 -->
4343
<maven-dependency-check.format>ALL</maven-dependency-check.format>
4444
<maven-dependency-check.failOnError>true</maven-dependency-check.failOnError>
@@ -193,8 +193,14 @@
193193
</executions>
194194
</plugin>
195195

196-
<!-- see https://jeremylong.github.io/DependencyCheck/dependency-check-maven/ -->
197-
<!-- https://mvnrepository.com/artifact/org.owasp/dependency-check-maven -->
196+
<!-- needed for mvn site - see https://stackoverflow.com/a/51099913 -->
197+
<plugin>
198+
<groupId>org.apache.maven.plugins</groupId>
199+
<artifactId>maven-site-plugin</artifactId>
200+
<version>3.12.1</version>
201+
</plugin>
202+
203+
<!-- https://mvnrepository.com/artifact/org.owasp/dependency-check-maven (run with mvn dependency-check:check ) -->
198204
<plugin>
199205
<groupId>org.owasp</groupId>
200206
<artifactId>dependency-check-maven</artifactId>
@@ -204,31 +210,24 @@
204210
<failOnError>${maven-dependency-check.failOnError}</failOnError>
205211
<failBuildOnCVSS>${maven-dependency-check.failBuildOnCVSS}</failBuildOnCVSS>
206212
<outputDirectory>target/site</outputDirectory>
207-
<!--suppressionFile>${project.basedir}/dependency-check-report_suppressions.xml</suppressionFile -->
213+
<suppressionFile>dependency-check-report_suppressions.xml</suppressionFile>
208214
</configuration>
209215
<executions>
210-
<execution>
211-
<goals>
212-
<goal>update-only</goal>
213-
</goals>
214-
</execution>
216+
<execution>
217+
<goals>
218+
<goal>check</goal>
219+
</goals>
220+
</execution>
215221
</executions>
216222
</plugin>
217-
218223
</plugins>
219224
</build>
220225

226+
<!-- generate site with mvn site (including dependency check) -->
221227
<reporting>
222228
<plugins>
223-
<!-- needed for mvn site - see https://stackoverflow.com/a/51099913 -->
224-
<plugin>
225-
<groupId>org.apache.maven.plugins</groupId>
226-
<artifactId>maven-site-plugin</artifactId>
227-
<version>3.12.1</version>
228-
</plugin>
229-
230229
<plugin>
231-
<!-- https://mvnrepository.com/artifact/org.owasp/dependency-check-maven -->
230+
<!-- https://mvnrepository.com/artifact/org.owasp/dependency-check-maven (redefinition to run also with site) -->
232231
<groupId>org.owasp</groupId>
233232
<artifactId>dependency-check-maven</artifactId>
234233
<version>${maven-dependency-check.version}</version>
@@ -244,7 +243,7 @@
244243
<failOnError>${maven-dependency-check.failOnError}</failOnError>
245244
<failBuildOnCVSS>${maven-dependency-check.failBuildOnCVSS}</failBuildOnCVSS>
246245
<outputDirectory>target/site</outputDirectory>
247-
<!--suppressionFile>${project.basedir}/dependency-check-report_suppressions.xml</suppressionFile -->
246+
<suppressionFile>dependency-check-report_suppressions.xml</suppressionFile>
248247
</configuration>
249248
</plugin>
250249
</plugins>

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
// Copyright 2019 doubleSlash Net Business GmbH
2+
//
3+
// This file is part of KeepTime.
4+
// KeepTime is free software: you can redistribute it and/or modify
5+
// it under the terms of the GNU General Public License as published by
6+
// the Free Software Foundation, either version 3 of the License, or
7+
// (at your option) any later version.
8+
//
9+
// This program is distributed in the hope that it will be useful,
10+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
// GNU General Public License for more details.
13+
//
14+
// You should have received a copy of the GNU General Public License
15+
// along with this program. If not, see <http://www.gnu.org/licenses/>.
16+
117
package de.doubleslash.keeptime;
218

319
import static javafx.application.Application.launch;

src/main/java/de/doubleslash/keeptime/common/ScreenPosHelper.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
// Copyright 2019 doubleSlash Net Business GmbH
2+
//
3+
// This file is part of KeepTime.
4+
// KeepTime is free software: you can redistribute it and/or modify
5+
// it under the terms of the GNU General Public License as published by
6+
// the Free Software Foundation, either version 3 of the License, or
7+
// (at your option) any later version.
8+
//
9+
// This program is distributed in the hope that it will be useful,
10+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
// GNU General Public License for more details.
13+
//
14+
// You should have received a copy of the GNU General Public License
15+
// along with this program. If not, see <http://www.gnu.org/licenses/>.
16+
117
package de.doubleslash.keeptime.common;
218

319
import org.slf4j.Logger;

0 commit comments

Comments
 (0)