-
Notifications
You must be signed in to change notification settings - Fork 3
Refactor: Modularize architecture #34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,13 @@ | ||
| #!/bin/sh | ||
| # build script for Unix-like systems | ||
| # Use: ./build — fast incremental build (no tests, no fat jar) | ||
| # ./build release — full clean build with fat jar (for releases) | ||
|
|
||
| # ensure Maven wrapper is executable | ||
| chmod +x ./mvnw | ||
|
|
||
| ./mvnw clean package | ||
| if [ "$1" = "release" ]; then | ||
| ./mvnw clean package -Prelease | ||
| else | ||
| ./mvnw package -DskipTests | ||
| fi |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -29,26 +29,32 @@ | |
| </plugin> | ||
| <plugin> | ||
| <groupId>org.apache.maven.plugins</groupId> | ||
| <artifactId>maven-assembly-plugin</artifactId> | ||
| <version>3.4.2</version> | ||
| <artifactId>maven-jar-plugin</artifactId> | ||
| <configuration> | ||
| <archive> | ||
| <manifest> | ||
| <mainClass>io.github.compilerstuck.Control.MainController</mainClass> | ||
| </manifest> | ||
| </archive> | ||
| </configuration> | ||
| </plugin> | ||
|
|
||
| <plugin> | ||
| <groupId>org.apache.maven.plugins</groupId> | ||
| <artifactId>maven-dependency-plugin</artifactId> | ||
| <executions> | ||
| <execution> | ||
| <id>copy-dependencies</id> | ||
| <phase>package</phase> | ||
| <goals> | ||
| <goal>single</goal> | ||
| <goal>copy-dependencies</goal> | ||
| </goals> | ||
| <configuration> | ||
| <archive> | ||
| <manifest> | ||
| <mainClass> | ||
| io.github.compilerstuck.Control.MainController | ||
| </mainClass> | ||
| </manifest> | ||
| </archive> | ||
| <appendAssemblyId>true</appendAssemblyId> | ||
| <descriptorRefs> | ||
| <descriptorRef>jar-with-dependencies</descriptorRef> | ||
| </descriptorRefs> | ||
| <outputDirectory>${project.build.directory}/dependency</outputDirectory> | ||
| <includeScope>runtime</includeScope> | ||
| <overWriteReleases>false</overWriteReleases> | ||
| <overWriteSnapshots>false</overWriteSnapshots> | ||
| <overWriteIfNewer>true</overWriteIfNewer> | ||
| </configuration> | ||
| </execution> | ||
| </executions> | ||
|
|
@@ -66,6 +72,43 @@ | |
| </plugin> | ||
| </plugins> | ||
| </build> | ||
|
|
||
| <profiles> | ||
| <profile> | ||
| <id>release</id> | ||
| <build> | ||
| <plugins> | ||
| <plugin> | ||
| <groupId>org.apache.maven.plugins</groupId> | ||
| <artifactId>maven-assembly-plugin</artifactId> | ||
| <version>3.4.2</version> | ||
| <executions> | ||
| <execution> | ||
| <phase>package</phase> | ||
| <goals> | ||
| <goal>single</goal> | ||
| </goals> | ||
| <configuration> | ||
| <archive> | ||
| <manifest> | ||
| <mainClass> | ||
| io.github.compilerstuck.Control.MainController | ||
| </mainClass> | ||
| </manifest> | ||
| </archive> | ||
| <appendAssemblyId>true</appendAssemblyId> | ||
| <descriptorRefs> | ||
| <descriptorRef>jar-with-dependencies</descriptorRef> | ||
| </descriptorRefs> | ||
| </configuration> | ||
|
Comment on lines
+99
to
+103
|
||
| </execution> | ||
| </executions> | ||
| </plugin> | ||
| </plugins> | ||
| </build> | ||
| </profile> | ||
| </profiles> | ||
|
|
||
| <dependencies> | ||
| <dependency> | ||
| <groupId>com.github.66-m</groupId> <!-- micycle1 fork --> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| java -jar ./target/sorting-visualizer.jar | ||
| java -cp ".\target\sorting-visualizer.jar;.\target\dependency\*" io.github.compilerstuck.Control.MainController |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| java -jar .\target\sorting-visualizer.jar fullscreen | ||
| java -cp ".\target\sorting-visualizer.jar;.\target\dependency\*" io.github.compilerstuck.Control.MainController fullscreen |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| java -jar .\target\sorting-visualizer.jar portrait | ||
| java -cp ".\target\sorting-visualizer.jar;.\target\dependency\*" io.github.compilerstuck.Control.MainController portrait |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The main build now produces a thin
target/sorting-visualizer.jarplus copied dependencies, but the JAR manifest doesn’t include aClass-Path, sojava -jar target/sorting-visualizer.jarwill not find runtime deps unless users use the provided-cp ... dependency/*launch pattern. If you want the jar to remain runnable viajava -jar, consider adding aClass-Pathmanifest entry (pointing atdependency/*) or using a shading/assembly approach for the default build.