Skip to content

Commit ddc0715

Browse files
chore: make project multi module maven setup
1 parent 01ac110 commit ddc0715

28 files changed

Lines changed: 1218 additions & 20 deletions

File tree

.github/workflows/ci.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,18 @@ jobs:
2828
run: |
2929
curl -L https://github.com/gituser12981u2/javaWhitelist/releases/latest/download/javaWhitelist.jar -o javaWhitelist.jar
3030
31-
- name: Run whitelist checker
31+
- name: Run whitelist checker
3232
run: |
33-
java -jar javaWhitelist.jar src/main/java
33+
set -euo pipefail
34+
SRC_DIRS=$(find . -type d -path '*/src/main/java' | sort)
35+
if [ -z "$SRC_DIRS" ]; then
36+
echo "No src/main/java directories found; skipping."
37+
exit 0
38+
fi
39+
while IFS= read -r d; do
40+
echo "javaWhitelist $d"
41+
java -jar javaWhitelist.jar "$d"
42+
done <<< "$SRC_DIRS"
3443
3544
- name: Verify (format check + checkstyle + compile)
3645
run: mvn -B -ntp verify

Makefile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
.PHONY: compile run fmt lint clean
2+
3+
compile:
4+
cd $(module) && mvn -DskipTests compile
5+
6+
run: compile
7+
mkdir -p $(module)/run
8+
cd $(module)/run && mvn -f ../pom.xml exec:java
9+
10+
fmt:
11+
mvn spotless:apply
12+
13+
lint:
14+
mvn checkstyle:check
15+
16+
clean:
17+
mvn clean

README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,19 @@
2020
- **P3 Program Linting** (02/27-03/05)
2121
- **C3 OOP It!** (03/06-03/12)
2222

23-
Each P/C has its **own README.md** with its specifications in `src/main/java/<P#/C#>`
23+
Each P/C has its **own README.md** with its specifications in `<P#/C#>/README.md`
24+
25+
## Running
26+
27+
Use
28+
```bash
29+
make run module=<p#/c#>-<name>
30+
```
31+
32+
Example:
33+
```bash
34+
make run module=p0-stonks
35+
```
2436

2537
## Pre-commit
2638

src/main/java/Creative Project 0 Warm-Up/README.md renamed to c0-warmup/README.md

File renamed without changes.

c0-warmup/pom.xml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0"
2+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
4+
https://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
7+
<parent>
8+
<groupId>edu.uw.cse.122</groupId>
9+
<artifactId>cse122</artifactId>
10+
<version>1.0.0</version>
11+
<relativePath>../pom.xml</relativePath>
12+
</parent>
13+
14+
<artifactId>c0-warmup</artifactId>
15+
<packaging>jar</packaging>
16+
17+
<build>
18+
<plugins>
19+
<plugin>
20+
<groupId>org.codehaus.mojo</groupId>
21+
<artifactId>exec-maven-plugin</artifactId>
22+
<configuration>
23+
<mainClass>MusicBox</mainClass>
24+
</configuration>
25+
</plugin>
26+
</plugins>
27+
</build>
28+
</project>
File renamed without changes.

c1-todo/README.md

Whitespace-only changes.

c1-todo/pom.xml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0"
2+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
4+
https://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
7+
<parent>
8+
<groupId>edu.uw.cse.122</groupId>
9+
<artifactId>cse122</artifactId>
10+
<version>1.0.0</version>
11+
<relativePath>../pom.xml</relativePath>
12+
</parent>
13+
14+
<artifactId>c1-todo</artifactId>
15+
<packaging>jar</packaging>
16+
17+
<build>
18+
<plugins>
19+
<plugin>
20+
<groupId>org.codehaus.mojo</groupId>
21+
<artifactId>exec-maven-plugin</artifactId>
22+
<configuration>
23+
<mainClass>TodoListManager</mainClass>
24+
</configuration>
25+
</plugin>
26+
</plugins>
27+
</build>
28+
</project>

src/main/java/Creative Project 1 Todo/todo.txt renamed to c1-todo/run/todo.txt

File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)