Skip to content

Commit

Permalink
Merge pull request #1 from ThatCraws/feature/1-initial-implementation
Browse files Browse the repository at this point in the history
Initial implementation. Minimal command-line based application
  • Loading branch information
ThatCraws authored Mar 18, 2024
2 parents 458e337 + b3a9388 commit f65459f
Show file tree
Hide file tree
Showing 17 changed files with 1,145 additions and 4 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ name: Java CI with Maven
on:
push:
branches: [ "?/*" ]
pull_request:
branches: [ "main" ]
#pull_request:
# branches: [ "main" ]

jobs:
build:
Expand All @@ -31,5 +31,5 @@ jobs:
run: mvn -B package --file pom.xml

# Optional: Uploads the full dependency graph to GitHub to improve the quality of Dependabot alerts this repository can receive
- name: Update dependency graph
uses: advanced-security/maven-dependency-submission-action@571e99aab1055c2e71a1e2309b9691de18d6b7d6
#- name: Update dependency graph
# uses: advanced-security/maven-dependency-submission-action@571e99aab1055c2e71a1e2309b9691de18d6b7d6
21 changes: 21 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "java",
"name": "Current File",
"request": "launch",
"mainClass": "${file}"
},
{
"type": "java",
"name": "TimeplaterApplication",
"request": "launch",
"mainClass": "de.esterlino.TimeplaterApplication",
"projectName": "timeplater"
}
]
}
79 changes: 79 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
<?xml version="1.0" encoding="UTF-8"?>
<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>de.esterlino</groupId>
<artifactId>timeplater</artifactId>
<version>0.1.0-SNAPSHOT</version>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>17</java.version>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
</properties>

<dependencies>

<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>5.2.5</version>
</dependency>

<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.9.2</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.6.0</version>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<mainClass>de.esterlino.timeplater.TimeplaterApplication</mainClass>
</manifest>
</archive>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.12.4</version>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.6.3</version>

<configuration>
<show>private</show>
</configuration>
</plugin>
</plugins>
</build>
</project>
30 changes: 30 additions & 0 deletions src/main/java/de/esterlino/timeplater/TimeplaterApplication.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package de.esterlino.timeplater;

import javax.swing.JFrame;
import javax.swing.SwingUtilities;
import javax.swing.WindowConstants;

import de.esterlino.timeplater.worktimes.ouputter.MailTemplateWorkWeekOutputter;
import de.esterlino.timeplater.worktimes.supplier.ExcelWorkWeekSupplier;
import de.esterlino.timeplater.worktimes.supplier.ExcelWorkbookInitializationException;

public class TimeplaterApplication {

public static void main(String[] args) {
if (args.length < 2) {
System.err.println("Too few arguments. Please enter: inputFile calendarWeek [outputFile]");
return;
}

ExcelWorkWeekSupplier supplier = null;
try {
supplier = new ExcelWorkWeekSupplier(args[0]);
} catch (ExcelWorkbookInitializationException e) {
e.printStackTrace(System.err);
return;
}

MailTemplateWorkWeekOutputter outputter = new MailTemplateWorkWeekOutputter(args.length >= 3 ? args[2] : "output.txt");
outputter.createOutput(supplier.supplyWorkWeek(Integer.parseInt(args[1])));
}
}
Loading

0 comments on commit f65459f

Please sign in to comment.