Add build tool, modern ui, update libraries
Ursprung
0837752495
Commit
21e087bb0d
@ -1,2 +0,0 @@
|
|||||||
# Default ignored files
|
|
||||||
/workspace.xml
|
|
||||||
@ -1,3 +0,0 @@
|
|||||||
<component name="ProjectDictionaryState">
|
|
||||||
<dictionary name="smoser" />
|
|
||||||
</component>
|
|
||||||
@ -1,10 +0,0 @@
|
|||||||
<component name="InspectionProjectProfileManager">
|
|
||||||
<profile version="1.0">
|
|
||||||
<option name="myName" value="Project Default" />
|
|
||||||
<inspection_tool class="SpellCheckingInspection" enabled="false" level="TYPO" enabled_by_default="false">
|
|
||||||
<option name="processCode" value="true" />
|
|
||||||
<option name="processLiterals" value="true" />
|
|
||||||
<option name="processComments" value="true" />
|
|
||||||
</inspection_tool>
|
|
||||||
</profile>
|
|
||||||
</component>
|
|
||||||
@ -1,14 +0,0 @@
|
|||||||
<component name="libraryTable">
|
|
||||||
<library name="lib">
|
|
||||||
<CLASSES>
|
|
||||||
<root url="jar://$PROJECT_DIR$/lib/pdfbox-app-2.0.2.jar!/" />
|
|
||||||
<root url="jar://$PROJECT_DIR$/lib/jgrapht-core-0.9.2.jar!/" />
|
|
||||||
<root url="jar://$PROJECT_DIR$/lib/jgraphx-2.0.0.1.jar!/" />
|
|
||||||
<root url="jar://$PROJECT_DIR$/lib/itext-2.1.7.jar!/" />
|
|
||||||
<root url="jar://$PROJECT_DIR$/lib/jgrapht-ext-0.9.2.jar!/" />
|
|
||||||
<root url="jar://$PROJECT_DIR$/lib/jgraph-5.13.0.0.jar!/" />
|
|
||||||
</CLASSES>
|
|
||||||
<JAVADOC />
|
|
||||||
<SOURCES />
|
|
||||||
</library>
|
|
||||||
</component>
|
|
||||||
@ -1,6 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_10" project-jdk-name="10" project-jdk-type="JavaSDK">
|
|
||||||
<output url="file://$PROJECT_DIR$/out" />
|
|
||||||
</component>
|
|
||||||
</project>
|
|
||||||
@ -1,8 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="ProjectModuleManager">
|
|
||||||
<modules>
|
|
||||||
<module fileurl="file://$PROJECT_DIR$/DungeonGenerator.iml" filepath="$PROJECT_DIR$/DungeonGenerator.iml" />
|
|
||||||
</modules>
|
|
||||||
</component>
|
|
||||||
</project>
|
|
||||||
@ -1,124 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="Palette2">
|
|
||||||
<group name="Swing">
|
|
||||||
<item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
|
||||||
<default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
|
|
||||||
</item>
|
|
||||||
<item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
|
||||||
<default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
|
|
||||||
</item>
|
|
||||||
<item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
|
||||||
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
|
|
||||||
</item>
|
|
||||||
<item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.png" removable="false" auto-create-binding="false" can-attach-label="true">
|
|
||||||
<default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
|
|
||||||
</item>
|
|
||||||
<item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
|
||||||
<default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
|
|
||||||
<initial-values>
|
|
||||||
<property name="text" value="Button" />
|
|
||||||
</initial-values>
|
|
||||||
</item>
|
|
||||||
<item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
|
||||||
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
|
|
||||||
<initial-values>
|
|
||||||
<property name="text" value="RadioButton" />
|
|
||||||
</initial-values>
|
|
||||||
</item>
|
|
||||||
<item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
|
||||||
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
|
|
||||||
<initial-values>
|
|
||||||
<property name="text" value="CheckBox" />
|
|
||||||
</initial-values>
|
|
||||||
</item>
|
|
||||||
<item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
|
||||||
<default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
|
|
||||||
<initial-values>
|
|
||||||
<property name="text" value="Label" />
|
|
||||||
</initial-values>
|
|
||||||
</item>
|
|
||||||
<item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
|
||||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
|
|
||||||
<preferred-size width="150" height="-1" />
|
|
||||||
</default-constraints>
|
|
||||||
</item>
|
|
||||||
<item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
|
||||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
|
|
||||||
<preferred-size width="150" height="-1" />
|
|
||||||
</default-constraints>
|
|
||||||
</item>
|
|
||||||
<item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
|
||||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
|
|
||||||
<preferred-size width="150" height="-1" />
|
|
||||||
</default-constraints>
|
|
||||||
</item>
|
|
||||||
<item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
|
||||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
|
||||||
<preferred-size width="150" height="50" />
|
|
||||||
</default-constraints>
|
|
||||||
</item>
|
|
||||||
<item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
|
||||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
|
||||||
<preferred-size width="150" height="50" />
|
|
||||||
</default-constraints>
|
|
||||||
</item>
|
|
||||||
<item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
|
||||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
|
||||||
<preferred-size width="150" height="50" />
|
|
||||||
</default-constraints>
|
|
||||||
</item>
|
|
||||||
<item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
|
||||||
<default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
|
|
||||||
</item>
|
|
||||||
<item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
|
||||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
|
||||||
<preferred-size width="150" height="50" />
|
|
||||||
</default-constraints>
|
|
||||||
</item>
|
|
||||||
<item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
|
||||||
<default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
|
|
||||||
<preferred-size width="150" height="50" />
|
|
||||||
</default-constraints>
|
|
||||||
</item>
|
|
||||||
<item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
|
||||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
|
||||||
<preferred-size width="150" height="50" />
|
|
||||||
</default-constraints>
|
|
||||||
</item>
|
|
||||||
<item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
|
||||||
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
|
|
||||||
<preferred-size width="200" height="200" />
|
|
||||||
</default-constraints>
|
|
||||||
</item>
|
|
||||||
<item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
|
||||||
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
|
|
||||||
<preferred-size width="200" height="200" />
|
|
||||||
</default-constraints>
|
|
||||||
</item>
|
|
||||||
<item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
|
||||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
|
|
||||||
</item>
|
|
||||||
<item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
|
||||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
|
|
||||||
</item>
|
|
||||||
<item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
|
||||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
|
|
||||||
</item>
|
|
||||||
<item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
|
||||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
|
|
||||||
</item>
|
|
||||||
<item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
|
||||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
|
|
||||||
<preferred-size width="-1" height="20" />
|
|
||||||
</default-constraints>
|
|
||||||
</item>
|
|
||||||
<item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
|
||||||
<default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
|
|
||||||
</item>
|
|
||||||
<item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
|
||||||
<default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
|
|
||||||
</item>
|
|
||||||
</group>
|
|
||||||
</component>
|
|
||||||
</project>
|
|
||||||
@ -1,6 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="VcsDirectoryMappings">
|
|
||||||
<mapping directory="" vcs="Git" />
|
|
||||||
</component>
|
|
||||||
</project>
|
|
||||||
@ -0,0 +1,70 @@
|
|||||||
|
plugins {
|
||||||
|
id 'java'
|
||||||
|
id 'application'
|
||||||
|
}
|
||||||
|
|
||||||
|
group = 'eu.smoser'
|
||||||
|
version = '1.0'
|
||||||
|
|
||||||
|
java {
|
||||||
|
sourceCompatibility = JavaVersion.VERSION_11
|
||||||
|
targetCompatibility = JavaVersion.VERSION_11
|
||||||
|
}
|
||||||
|
|
||||||
|
repositories {
|
||||||
|
mavenCentral()
|
||||||
|
flatDir {
|
||||||
|
dirs 'lib'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
implementation files('lib/flatlaf-3.4.1.jar')
|
||||||
|
implementation files('lib/itext-2.1.7.jar')
|
||||||
|
implementation files('lib/jgraph-5.13.0.0.jar')
|
||||||
|
implementation files('lib/jgrapht-core-0.9.2.jar')
|
||||||
|
implementation files('lib/jgrapht-ext-0.9.2.jar')
|
||||||
|
implementation files('lib/jgraphx-2.0.0.1.jar')
|
||||||
|
implementation files('lib/pdfbox-app-2.0.33.jar')
|
||||||
|
}
|
||||||
|
|
||||||
|
sourceSets {
|
||||||
|
main {
|
||||||
|
java {
|
||||||
|
srcDirs = ['src']
|
||||||
|
}
|
||||||
|
resources {
|
||||||
|
srcDirs = ['src', 'resources']
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
application {
|
||||||
|
mainClass = 'eu.smoser.dungeongenerator.main.DungeonGeneratorUI'
|
||||||
|
}
|
||||||
|
|
||||||
|
jar {
|
||||||
|
manifest {
|
||||||
|
attributes(
|
||||||
|
'Main-Class': 'eu.smoser.dungeongenerator.main.DungeonGeneratorUI',
|
||||||
|
'Class-Path': configurations.runtimeClasspath.files.collect { 'lib/' + it.name }.join(' ')
|
||||||
|
)
|
||||||
|
}
|
||||||
|
from {
|
||||||
|
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
|
||||||
|
}
|
||||||
|
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
||||||
|
archiveBaseName = 'DungeonGenerator'
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.register('buildJar') {
|
||||||
|
dependsOn jar
|
||||||
|
doLast {
|
||||||
|
println "JAR created: build/libs/DungeonGenerator-${version}.jar"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.withType(JavaCompile).configureEach {
|
||||||
|
options.encoding = 'UTF-8'
|
||||||
|
}
|
||||||
|
|
||||||
@ -0,0 +1,101 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# Build script for DungeonGenerator
|
||||||
|
# Usage: ./build.sh [clean|jar|run]
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
PROJECT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||||
|
BUILD_DIR="$PROJECT_DIR/build/classes"
|
||||||
|
JAR_FILE="$PROJECT_DIR/DungeonGenerator.jar"
|
||||||
|
LIB_DIR="$PROJECT_DIR/lib"
|
||||||
|
SRC_DIR="$PROJECT_DIR/src"
|
||||||
|
RESOURCES_DIR="$PROJECT_DIR/resources"
|
||||||
|
|
||||||
|
# All library JARs
|
||||||
|
LIBS=$(find "$LIB_DIR" -name "*.jar" | tr '\n' ':')
|
||||||
|
|
||||||
|
clean() {
|
||||||
|
echo "Cleaning build directory..."
|
||||||
|
rm -rf "$PROJECT_DIR/build"
|
||||||
|
rm -f "$JAR_FILE"
|
||||||
|
rm -f "$PROJECT_DIR/sources.txt"
|
||||||
|
echo "Clean complete."
|
||||||
|
}
|
||||||
|
|
||||||
|
compile() {
|
||||||
|
echo "Compiling sources..."
|
||||||
|
mkdir -p "$BUILD_DIR"
|
||||||
|
|
||||||
|
# Find all Java files
|
||||||
|
find "$SRC_DIR" -name "*.java" > "$PROJECT_DIR/sources.txt"
|
||||||
|
|
||||||
|
# Compile
|
||||||
|
javac -cp "$LIBS" -d "$BUILD_DIR" @"$PROJECT_DIR/sources.txt"
|
||||||
|
|
||||||
|
# Copy resources
|
||||||
|
cp -r "$RESOURCES_DIR"/* "$BUILD_DIR/" 2>/dev/null || true
|
||||||
|
cp "$SRC_DIR/version.properties" "$BUILD_DIR/" 2>/dev/null || true
|
||||||
|
|
||||||
|
echo "Compilation complete."
|
||||||
|
}
|
||||||
|
|
||||||
|
create_jar() {
|
||||||
|
compile
|
||||||
|
|
||||||
|
echo "Creating JAR..."
|
||||||
|
mkdir -p "$BUILD_DIR/META-INF"
|
||||||
|
|
||||||
|
# Create manifest
|
||||||
|
LIB_CLASSPATH=$(find "$LIB_DIR" -name "*.jar" -exec basename {} \; | sed 's/^/lib\//' | tr '\n' ' ')
|
||||||
|
cat > "$BUILD_DIR/META-INF/MANIFEST.MF" << EOF
|
||||||
|
Manifest-Version: 1.0
|
||||||
|
Main-Class: eu.smoser.dungeongenerator.main.DungeonGeneratorUI
|
||||||
|
Class-Path: $LIB_CLASSPATH
|
||||||
|
|
||||||
|
EOF
|
||||||
|
|
||||||
|
# Create JAR
|
||||||
|
cd "$BUILD_DIR"
|
||||||
|
jar cfm "$JAR_FILE" META-INF/MANIFEST.MF .
|
||||||
|
cd "$PROJECT_DIR"
|
||||||
|
|
||||||
|
echo "JAR created: $JAR_FILE"
|
||||||
|
}
|
||||||
|
|
||||||
|
run_app() {
|
||||||
|
if [ ! -f "$JAR_FILE" ]; then
|
||||||
|
create_jar
|
||||||
|
fi
|
||||||
|
echo "Running DungeonGenerator..."
|
||||||
|
java -jar "$JAR_FILE"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Main
|
||||||
|
case "${1:-jar}" in
|
||||||
|
clean)
|
||||||
|
clean
|
||||||
|
;;
|
||||||
|
compile)
|
||||||
|
compile
|
||||||
|
;;
|
||||||
|
jar)
|
||||||
|
create_jar
|
||||||
|
;;
|
||||||
|
run)
|
||||||
|
run_app
|
||||||
|
;;
|
||||||
|
all)
|
||||||
|
clean
|
||||||
|
create_jar
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Usage: $0 [clean|compile|jar|run|all]"
|
||||||
|
echo " clean - Remove build artifacts"
|
||||||
|
echo " compile - Compile Java sources"
|
||||||
|
echo " jar - Create executable JAR (default)"
|
||||||
|
echo " run - Build and run the application"
|
||||||
|
echo " all - Clean and build JAR"
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
Binäre Datei nicht angezeigt.
Binäre Datei nicht angezeigt.
Binäre Datei nicht angezeigt.
@ -0,0 +1,2 @@
|
|||||||
|
rootProject.name = 'DungeonGenerator'
|
||||||
|
|
||||||
@ -0,0 +1,16 @@
|
|||||||
|
/opt/DungeonGenerator/src/eu/smoser/dungeongenerator/dungeon/Exit.java
|
||||||
|
/opt/DungeonGenerator/src/eu/smoser/dungeongenerator/dungeon/objects/ADungeonObject.java
|
||||||
|
/opt/DungeonGenerator/src/eu/smoser/dungeongenerator/dungeon/objects/Enemy.java
|
||||||
|
/opt/DungeonGenerator/src/eu/smoser/dungeongenerator/dungeon/objects/Encounters.java
|
||||||
|
/opt/DungeonGenerator/src/eu/smoser/dungeongenerator/dungeon/objects/Magic.java
|
||||||
|
/opt/DungeonGenerator/src/eu/smoser/dungeongenerator/dungeon/objects/Treasure.java
|
||||||
|
/opt/DungeonGenerator/src/eu/smoser/dungeongenerator/dungeon/objects/Trap.java
|
||||||
|
/opt/DungeonGenerator/src/eu/smoser/dungeongenerator/dungeon/objects/Special.java
|
||||||
|
/opt/DungeonGenerator/src/eu/smoser/dungeongenerator/dungeon/Room.java
|
||||||
|
/opt/DungeonGenerator/src/eu/smoser/dungeongenerator/dungeon/Dungeon.java
|
||||||
|
/opt/DungeonGenerator/src/eu/smoser/dungeongenerator/util/Dice.java
|
||||||
|
/opt/DungeonGenerator/src/eu/smoser/dungeongenerator/util/Counter.java
|
||||||
|
/opt/DungeonGenerator/src/eu/smoser/dungeongenerator/main/DungeonGeneratorUI.java
|
||||||
|
/opt/DungeonGenerator/src/eu/smoser/dungeongenerator/main/EncounterGenerator.java
|
||||||
|
/opt/DungeonGenerator/src/eu/smoser/dungeongenerator/main/AGenerator.java
|
||||||
|
/opt/DungeonGenerator/src/eu/smoser/dungeongenerator/main/TreasureGenerator.java
|
||||||
Laden…
In neuem Issue referenzieren