Introduce JLink and move classes to correct package
This commit is contained in:
parent
eacfcd0547
commit
4c49f939ee
@ -1 +1 @@
|
|||||||
UltimateTicTacToe
|
ultimate-tictactoe
|
@ -1,7 +1,7 @@
|
|||||||
<component name="ProjectRunConfigurationManager">
|
<component name="ProjectRunConfigurationManager">
|
||||||
<configuration default="false" name="Run" type="Application" factoryName="Application">
|
<configuration default="false" name="Run" type="Application" factoryName="Application">
|
||||||
<option name="MAIN_CLASS_NAME" value="de.icaotix.ultimatetictactoe.Main" />
|
<option name="MAIN_CLASS_NAME" value="de.icaotix.ultimatetictactoe.Main" />
|
||||||
<module name="UltimateTicTacToe.main" />
|
<module name="ultimate-tictactoe.main" />
|
||||||
<extension name="coverage">
|
<extension name="coverage">
|
||||||
<pattern>
|
<pattern>
|
||||||
<option name="PATTERN" value="de.icaotix.ultimatetictactoe.*" />
|
<option name="PATTERN" value="de.icaotix.ultimatetictactoe.*" />
|
||||||
|
11
build.gradle
11
build.gradle
@ -1,5 +1,6 @@
|
|||||||
plugins {
|
plugins {
|
||||||
id 'java'
|
id 'java'
|
||||||
|
id 'org.beryx.jlink' version '2.24.4'
|
||||||
}
|
}
|
||||||
|
|
||||||
group 'de.icaotix.ultimatetictactoe'
|
group 'de.icaotix.ultimatetictactoe'
|
||||||
@ -14,6 +15,16 @@ dependencies {
|
|||||||
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.1'
|
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.1'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
jlink {
|
||||||
|
options = ['--strip-debug', '--compress', '2', '--no-header-files', '--no-man-pages']
|
||||||
|
launcher{
|
||||||
|
name = 'Ultimate TicTacToe'
|
||||||
|
jvmArgs = ['-Dlog4j.configurationFile=./log4j2.xml']
|
||||||
|
noConsole = true
|
||||||
|
}
|
||||||
|
mainClass = "de.icaotix.ultimatetictactoe.Main"
|
||||||
|
}
|
||||||
|
|
||||||
test {
|
test {
|
||||||
useJUnitPlatform()
|
useJUnitPlatform()
|
||||||
}
|
}
|
@ -1,2 +1,2 @@
|
|||||||
rootProject.name = 'UltimateTicTacToe'
|
rootProject.name = 'ultimate-tictactoe'
|
||||||
|
|
||||||
|
@ -1,20 +1,17 @@
|
|||||||
package ultimatetictactoe;
|
package de.icaotix.ultimatetictactoe;
|
||||||
|
|
||||||
import ultimatetictactoe.view.UltimateTicTacToeView;
|
import de.icaotix.ultimatetictactoe.view.UltimateTicTacToeView;
|
||||||
import ultimatetictactoe.viewmodel.UltimateTicTacToePanelViewModel;
|
import de.icaotix.ultimatetictactoe.viewmodel.UltimateTicTacToePanelViewModel;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
|
|
||||||
public class Main {
|
public class Main {
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
|
|
||||||
|
|
||||||
SwingUtilities.invokeLater(() -> {
|
SwingUtilities.invokeLater(() -> {
|
||||||
final UltimateTicTacToePanelViewModel ultimateTicTacToePanelViewModel = new UltimateTicTacToePanelViewModel();
|
final UltimateTicTacToePanelViewModel ultimateTicTacToePanelViewModel = new UltimateTicTacToePanelViewModel();
|
||||||
new UltimateTicTacToeView(ultimateTicTacToePanelViewModel);
|
new UltimateTicTacToeView(ultimateTicTacToePanelViewModel);
|
||||||
ultimateTicTacToePanelViewModel.prepareNextMove();
|
ultimateTicTacToePanelViewModel.prepareNextMove();
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,4 +1,4 @@
|
|||||||
package ultimatetictactoe.model;
|
package de.icaotix.ultimatetictactoe.model;
|
||||||
|
|
||||||
public enum CellState {
|
public enum CellState {
|
||||||
X("X"),
|
X("X"),
|
@ -1,4 +1,4 @@
|
|||||||
package ultimatetictactoe.model;
|
package de.icaotix.ultimatetictactoe.model;
|
||||||
|
|
||||||
public enum GameState {
|
public enum GameState {
|
||||||
X_WON("X won"),
|
X_WON("X won"),
|
@ -0,0 +1,6 @@
|
|||||||
|
package de.icaotix.ultimatetictactoe.model;
|
||||||
|
|
||||||
|
public enum Player {
|
||||||
|
X,
|
||||||
|
O
|
||||||
|
}
|
@ -1,4 +1,4 @@
|
|||||||
package ultimatetictactoe.model;
|
package de.icaotix.ultimatetictactoe.model;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
@ -1,4 +1,4 @@
|
|||||||
package ultimatetictactoe.model;
|
package de.icaotix.ultimatetictactoe.model;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
@ -1,6 +1,6 @@
|
|||||||
package ultimatetictactoe.view;
|
package de.icaotix.ultimatetictactoe.view;
|
||||||
|
|
||||||
import ultimatetictactoe.viewmodel.TicTacToePanelViewModel;
|
import de.icaotix.ultimatetictactoe.viewmodel.TicTacToePanelViewModel;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import java.awt.*;
|
import java.awt.*;
|
@ -1,8 +1,8 @@
|
|||||||
package ultimatetictactoe.view;
|
package de.icaotix.ultimatetictactoe.view;
|
||||||
|
|
||||||
import ultimatetictactoe.model.Player;
|
import de.icaotix.ultimatetictactoe.model.Player;
|
||||||
import ultimatetictactoe.viewmodel.TicTacToePanelViewModel;
|
import de.icaotix.ultimatetictactoe.viewmodel.TicTacToePanelViewModel;
|
||||||
import ultimatetictactoe.viewmodel.UltimateTicTacToePanelViewModel;
|
import de.icaotix.ultimatetictactoe.viewmodel.UltimateTicTacToePanelViewModel;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import java.awt.*;
|
import java.awt.*;
|
@ -1,4 +1,4 @@
|
|||||||
package ultimatetictactoe.viewmodel;
|
package de.icaotix.ultimatetictactoe.viewmodel;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.function.BiConsumer;
|
import java.util.function.BiConsumer;
|
@ -1,9 +1,10 @@
|
|||||||
package ultimatetictactoe.viewmodel;
|
package de.icaotix.ultimatetictactoe.viewmodel;
|
||||||
|
|
||||||
import ultimatetictactoe.model.GameState;
|
|
||||||
import ultimatetictactoe.model.Player;
|
import de.icaotix.ultimatetictactoe.model.GameState;
|
||||||
import ultimatetictactoe.model.TicTacToeGame;
|
import de.icaotix.ultimatetictactoe.model.Player;
|
||||||
import ultimatetictactoe.model.UltimateTicTacToe;
|
import de.icaotix.ultimatetictactoe.model.TicTacToeGame;
|
||||||
|
import de.icaotix.ultimatetictactoe.model.UltimateTicTacToe;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
3
src/main/java/module-info.java
Normal file
3
src/main/java/module-info.java
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
module ultimate.tictactoe.main {
|
||||||
|
requires java.desktop;
|
||||||
|
}
|
@ -1,6 +0,0 @@
|
|||||||
package ultimatetictactoe.model;
|
|
||||||
|
|
||||||
public enum Player {
|
|
||||||
X,
|
|
||||||
O
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user