Skip to content
Snippets Groups Projects
Commit 9cc429a6 authored by LUDMANN Pierre's avatar LUDMANN Pierre
Browse files

fix build and usage + test day5

parent 04f2befc
No related branches found
No related tags found
No related merge requests found
Pipeline #16093 failed
......@@ -12,13 +12,14 @@ Requirements
Build and use
-----
mvn test -Day=1
mvn test -Day=10
mvn test
```bash
mvn verify -Day=1
mvn verify -Day=10
mvn verify
```
When no day is given, it assumes today.
From IntelliJ, you may run `mvn test` via the Maven panel.
From IntelliJ, you may run `mvn verify` via the Maven panel.
Access the Maven panel via its button on the right top bar,
or via View>Tool Windows.
......
......@@ -32,7 +32,7 @@
<version>3.1.1</version>
<executions>
<execution>
<phase>test</phase>
<phase>verify</phase>
<goals>
<goal>java</goal>
</goals>
......
......@@ -10,6 +10,10 @@ import static java.lang.Thread.currentThread;
abstract class Day {
List<String> input;
Day() {
}
Day(String inputName) {
try (BufferedReader reader = new BufferedReader(new InputStreamReader(
Objects.requireNonNull(currentThread().getContextClassLoader()
......@@ -23,10 +27,4 @@ abstract class Day {
abstract String part1();
abstract String part2();
// public static void main(String[] args) {
//final Day today = new Day("1");
//System.out.println(part1());
//System.out.println(part2());
}
......@@ -18,7 +18,7 @@ public class Main {
(Day) Class.forName(Main.class.getPackageName() + ".Day" + day)
.getDeclaredConstructor(String.class)
.newInstance("day" + day + ".input");
System.out.println(today.part1());
System.out.println(today.part2());
System.out.printf("Part 1: %s\n", today.part1());
System.out.printf("Part 2: %s\n", today.part2());
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment