Split to modules - initial work

This commit is contained in:
Robert Vokac 2024-02-04 16:08:27 +00:00
parent 6f52f66675
commit 5f60f85bff
No known key found for this signature in database
GPG Key ID: 693D30BEE3329055
42 changed files with 239 additions and 90 deletions

1
.gitignore vendored
View File

@ -15,3 +15,4 @@ pocasi.txt
test.txt
timecalc.conf
focus.txt
dist/*

View File

@ -1,4 +1,61 @@
mvn clean package
#mv target/*jar-with-all-dependencies*.jar C:/Users/Robert/Desktop/rv
mv target/*.jar C:/Users/Robert/Desktop/rv
rm -r target
#!/bin/bash
MVN_ARG=$1
replace () {
INPUT=$1
OLD=$2
NEW=$3
OUTPUT=$(echo $INPUT | sed "s/$OLD/$NEW/")
echo "$OUTPUT"
}
replaceInFile() {
INPUT=$1
OLD=$2
NEW=$3
echo INPUT=$INPUT
echo OLD=$OLD
echo NEW=$NEW
sed -i 's/$OLD/$NEW/g' $INPUT
cat $INPUT
}
echo ... 1. Building
mvn clean install $MVN_ARG
#Use mvn clean install -o to build offline
if [ $? -eq 0 ]
then
echo "Build was finished"
else
echo "Build failed. Exiting"
exit
fi
echo ... 2. Deleting dist directory
rm ./dist/*.jar
echo ... 3. Detecting version
cd modules/time-calc-app/target
VERSION=`ls time-calc-app-*-jar-with-all-dependencies.jar`
VERSION=`replace $VERSION "-jar-with-all-dependencies.jar" ""`
VERSION=`replace $VERSION "time-calc-app-" ""`
ORIG_VERSION=$VERSION
BUILD_TIMESTAMP=`date +'%Y%m%d_%H%M%S'`
if [[ `ls time-calc-app-*-jar-with-all-dependencies.jar` == *"SNAPSHOT"* ]];
then
VERSION=`echo $VERSION-$BUILD_TIMESTAMP`
else
echo "Release is in progress."
fi
echo version=$VERSION
cd ../../..
mkdir dist
echo $VERSION>./dist/VERSION
echo ... 4. Moving new jar file to dist directory
mv ./modules/time-calc-app/target/time-calc-app-$ORIG_VERSION-jar-with-all-dependencies.jar ./dist/time-calc-$VERSION.jar
rm ./modules/time-calc-app/target/time-calc-app-$ORIG_VERSION.jar
cp ./dist/time-calc-$VERSION.jar C:/Users/Robert/Desktop/rv

View File

@ -0,0 +1,55 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<relativePath>./../../pom.xml</relativePath>
<groupId>org.nanoboot.utils</groupId>
<artifactId>time-calc</artifactId>
<version>0.1.0-SNAPSHOT</version>
</parent>
<artifactId>time-calc-app</artifactId>
<name>time-calc-app</name>
<description>time-calc-app</description>
<packaging>jar</packaging>
<build>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<archive>
<manifest>
<mainClass>org.nanoboot.utils.timecalc.main.Main</mainClass>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
</manifest>
<manifestEntries>
<Build-Date>${timestamp}</Build-Date>
</manifestEntries>
</archive>
<!-- <descriptorRefs>-->
<!-- <descriptorRef>jar-with-dependencies</descriptorRef>-->
<!-- </descriptorRefs>-->
<descriptors>
<descriptor>./src/main/resources/install.xml</descriptor>
</descriptors>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@ -6,7 +6,7 @@ import java.util.HashSet;
import java.util.Set;
/**
* @author Robert
* @author pc00289
* @since 21.02.2024
*/
public class ComponentRegistry {

View File

@ -5,7 +5,7 @@ import javax.swing.Timer;
import java.awt.Color;
/**
* @author Robert
* @author pc00289
* @since 21.02.2024
*/
public class TimeCalcButton extends JButton {

View File

@ -5,7 +5,7 @@ import java.awt.Component;
import java.awt.HeadlessException;
/**
* @author Robert
* @author pc00289
* @since 21.02.2024
*/
public class TimeCalcWindow extends JFrame {

View File

@ -1,7 +1,7 @@
package org.nanoboot.utils.timecalc.gui.progress;
/**
* @author Robert
* @author pc00289
* @since 21.02.2024
*/
public class DayBattery extends Battery{

View File

@ -3,7 +3,7 @@ package org.nanoboot.utils.timecalc.gui.progress;
import org.nanoboot.utils.timecalc.utils.TimeHM;
/**
* @author Robert
* @author pc00289
* @since 21.02.2024
*/
public class HourBattery extends Battery{

View File

@ -1,7 +1,7 @@
package org.nanoboot.utils.timecalc.gui.progress;
/**
* @author Robert
* @author pc00289
* @since 21.02.2024
*/
public class MonthBattery extends Battery{

View File

@ -20,7 +20,7 @@ import java.util.HashSet;
import java.util.Set;
/**
* @author Robert
* @author pc00289
* @since 21.02.2024
*/
public class WalkingHumanProgressAsciiArt extends JTextPane {

View File

@ -3,7 +3,7 @@ package org.nanoboot.utils.timecalc.gui.progress;
import org.nanoboot.utils.timecalc.utils.TimeHM;
/**
* @author Robert
* @author pc00289
* @since 21.02.2024
*/
public class WeekBattery extends Battery{

View File

@ -6,7 +6,7 @@ import org.nanoboot.utils.timecalc.utils.Utils;
import javax.swing.JOptionPane;
/**
* @author Robert
* @author pc00289
* @since 21.02.2024
*/
public class AboutButton extends TimeCalcButton {

View File

@ -8,7 +8,7 @@ import javax.swing.JOptionPane;
import java.io.IOException;
/**
* @author Robert
* @author pc00289
* @since 31.01.2024
*/
public class Main {

View File

@ -1,7 +1,7 @@
package org.nanoboot.utils.timecalc.main;
/**
* @author Robert
* @author pc00289
* @since 21.02.2024
*/
public class TimeCalcException extends RuntimeException{

View File

@ -1,7 +1,7 @@
package org.nanoboot.utils.timecalc.utils;
/**
* @author pc00289
* @author Robert
* @since 16.02.2024
*/
public class BooleanHolder {

View File

@ -1,7 +1,7 @@
package org.nanoboot.utils.timecalc.utils;
/**
* @author Robert
* @author pc00289
* @since 21.02.2024
*/
public class Constants {

View File

@ -6,7 +6,7 @@ import java.time.format.DateTimeFormatter;
import java.util.Locale;
/**
* @author Robert
* @author pc00289
* @since 21.02.2024
*/
public class DateFormats {

View File

@ -3,7 +3,7 @@ package org.nanoboot.utils.timecalc.utils;
import java.io.File;
/**
* @author Robert
* @author pc00289
* @since 21.02.2024
*/
public class FileConstants {

View File

@ -4,7 +4,7 @@ import java.text.DecimalFormat;
import java.text.NumberFormat;
/**
* @author Robert
* @author pc00289
* @since 21.02.2024
*/
public class NumberFormats {

View File

@ -0,0 +1,15 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<relativePath>./../../pom.xml</relativePath>
<groupId>org.nanoboot.utils</groupId>
<artifactId>time-calc</artifactId>
<version>0.1.0-SNAPSHOT</version>
</parent>
<artifactId>time-calc-swing</artifactId>
<packaging>jar</packaging>
</project>

View File

@ -0,0 +1 @@

View File

@ -0,0 +1 @@

View File

@ -0,0 +1 @@

154
pom.xml
View File

@ -1,83 +1,82 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/POM/4.0.0"
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.nanoboot.utils</groupId>
<artifactId>time-calc</artifactId>
<version>0.1.0-SNAPSHOT</version>
<name>time-calc</name>
<description>time-calc</description>
<packaging>jar</packaging>
<packaging>pom</packaging>
<name>Time Calc</name>
<description>Tool to track time</description>
<properties>
<time-calc.version>0.1.0-SNAPSHOT</time-calc.version>
<java.version>1.8</java.version>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<lib.dir>${basedir}/lib</lib.dir>
<maven.build.timestamp.format>yyyy-MM-dd'T'HH:mm:ss</maven.build.timestamp.format>
<timestamp>${maven.build.timestamp}</timestamp>
<lombok.version>1.18.22</lombok.version>
<checkstyle.config.location>src/main/resources/sun_checks.xml</checkstyle.config.location>
<checkstyle.skip>true</checkstyle.skip><!-- TODO : to be removed -->
</properties>
<developers>
<developer>
<id>robertvokac</id>
<name>Robert Vokáč</name>
<roles>
<role>developer</role>
</roles>
</developer>
</developers>
<modules>
<!-- <module>modules/time-calc-entity</module>-->
<!-- <module>modules/time-calc-utils</module>-->
<!-- <module>modules/time-calc-persistence-api</module>-->
<!-- <module>modules/time-calc-persistence-impl-mock</module>-->
<!-- <module>modules/time-calc-persistence-impl-sqlite</module>-->
<!-- <module>modules/time-calc-swing</module>-->
<module>modules/time-calc-app</module>
</modules>
<dependencies>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>${lombok.version}</version>
<scope>provided</scope>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<!-- <dependency>-->
<!-- <groupId>private.dme</groupId>-->
<!-- <artifactId>jfreechart</artifactId>-->
<!-- <version>1.5.3</version>-->
<!-- <scope>system</scope>-->
<!-- <systemPath>${lib.dir}/jfreechart-1.5.3.jar</systemPath>-->
<!-- </dependency>-->
</dependencies>
</dependencyManagement>
<build>
<!-- <finalName>time-calc</finalName>-->
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.6.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<mainClass>org.nanoboot.utils.timecalc.main.Main</mainClass>
</manifest>
</archive>
</configuration>
<!-- Here come other details
...
-->
</plugin>
<!-- <plugin>-->
<!-- <artifactId>maven-assembly-plugin</artifactId>-->
<!-- <configuration>-->
<!-- <archive>-->
<!-- <manifest>-->
<!-- <mainClass>Main</mainClass>-->
<!-- <addDefaultImplementationEntries>true</addDefaultImplementationEntries>-->
<!-- </manifest>-->
<!-- <manifestEntries>-->
<!-- <Build-Date>${timestamp}</Build-Date>-->
<!-- </manifestEntries>-->
<!-- </archive>-->
<!-- &lt;!&ndash; <descriptorRefs>&ndash;&gt;-->
<!-- &lt;!&ndash; <descriptorRef>jar-with-dependencies</descriptorRef>&ndash;&gt;-->
<!-- &lt;!&ndash; </descriptorRefs>&ndash;&gt;-->
<!-- <descriptors>-->
<!-- <descriptor>./src/main/resources/install.xml</descriptor>-->
<!-- </descriptors>-->
<!-- </configuration>-->
<!-- <executions>-->
<!-- <execution>-->
<!-- <id>make-assembly</id> &lt;!&ndash; this is used for inheritance merges &ndash;&gt;-->
<!-- <phase>package</phase> &lt;!&ndash; bind to the packaging phase &ndash;&gt;-->
<!-- <goals>-->
<!-- <goal>single</goal>-->
<!-- </goals>-->
<!-- </execution>-->
<!-- </executions>-->
<!-- </plugin>-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
@ -96,14 +95,37 @@
<target>${maven.compiler.target}</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>3.2.0</version>
<executions>
<execution>
<id>validate</id>
<phase>validate</phase>
<configuration>
<consoleOutput>true</consoleOutput>
<failsOnError>true</failsOnError>
</configuration>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.20</version>
<scope>provided</scope>
</dependency>
</dependencies>
</project>
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.4.1</version>
<configuration>
</configuration>
</plugin>
</plugins>
</reporting>
</project>

View File

@ -1,4 +0,0 @@
clock.colorful=false
clock.hands.long=false
jokes.visible=true
battery.waves.enabled=false