Skip to content

Commit 12cfd9a

Browse files
committed
build(project): Convert the workspace to a Gradle project
This helps import the project into an IDE and to start the game.
1 parent 01906c5 commit 12cfd9a

File tree

246 files changed

+583
-69
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

246 files changed

+583
-69
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
# Build target
55
out
6+
build
67
target
78
tag
89

.idea/runConfigurations/XSwing.xml

Lines changed: 25 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/runConfigurations/XSwingNoSplash.xml

Lines changed: 25 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 42 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,49 @@ Pay attention: One stack can only take up to eight balls.
3939
 <kbd>F2</kbd>: Toggle Fullscreen
4040
 <kbd>S</kbd>: Change game size (experimental)
4141

42+
To use the app, you need at least a Java 1.8 JRE.
43+
You can get it for any platform [here](https://adoptium.net/temurin/releases/).
44+
45+
## 🎮 Start
46+
The game needs an installed Java runtime environment (JRE) with at least 8.
47+
You can get it for any platform [here](https://adoptium.net/temurin/releases/?version=8).
48+
For example on Windows choose:
49+
* Operating System: `Windows`
50+
* Architecture: `x64`
51+
* Package Type: `JRE`
52+
* Version: `8 - LTS`
53+
And download the `.msi` installer.
54+
55+
If the `.jar` wile type is linked with the `java`, you can simply start the game by opening the `XSwingPlus.jar`.
56+
Otherwise, start the game with console:
57+
```shell
58+
java -jar XSwingPlus.jar
59+
```
60+
4261
## 🚀 Setup
43-
All dependencies are included. Add the `lib` folder to _Libraries_.
44-
In addition to the `.jar` archives, you also have to set the native library location:
45-
_Configure project library_ > _Native Library Locations_ > `$PROJECT_DIR$`
62+
To start developing, import the workspace als [Gradle](https://gradle.org) project in your IDE.
63+
All dependencies are included in the `lib` folder. They should be automatically referenced by Gradle.
64+
To start the game simply run the Gradle task:
65+
```shell
66+
gradle run
67+
```
68+
This will compile the game and start the game with splash Screen (class `xswing.start.XSwingWithOptions`).
69+
If you use [IntelliJ IDEA](https://www.jetbrains.com/idea/) you can also use the predefined run configurations:
70+
*`XSwing`
71+
*`XSwingNoSplash`
72+
73+
## 📦 Package
74+
You can build the game for distribution wich wil generate a runnable jar which includes all dependencies,
75+
resources and natives.
76+
```shell
77+
gradle shadowJar
78+
```
79+
This will packe the game to the output folder: `build\libs\`.
80+
81+
> 💡 Keep in mind, that the game not only needs the resources in the `res` folder, but also the
82+
> native [LWJGL](https://www.lwjgl.org) bindings for your platform
83+
> (`.ddl` for Windows, `.so` Linux and `.jnilib` for Mac).
84+
> The `shadowJar` will copy all natives for all platforms to the build dir for you!
4685
4786
## 📜 Licence
4887
This remake is a free fan project. _Software 2000_ is not involved in any way.

build.gradle.kts

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
2+
3+
plugins {
4+
// Apply the application plugin to add support for building an application in Java.
5+
application
6+
7+
id("com.github.johnrengelman.shadow") version "7.1.2"
8+
}
9+
10+
repositories {
11+
flatDir {
12+
dirs("lib")
13+
}
14+
}
15+
16+
dependencies {
17+
implementation(":gson:2.2.4")
18+
implementation(":ixbm:")
19+
implementation(":jinput:")
20+
implementation(":jnlp:")
21+
implementation(":jogg:0.0.7")
22+
implementation(":jorbis:0.0.15")
23+
implementation(":lwjgl:")
24+
implementation(":lwjgl:debug")
25+
implementation(":lwjgl:util")
26+
implementation(":nifty:1.1")
27+
implementation(":nifty-default-controls:1.1")
28+
implementation(":slick:")
29+
implementation(":tinylinepp:")
30+
implementation(":xpp3:1.1.4c:")
31+
32+
testImplementation(":junit:4.13.1")
33+
testImplementation(":junit-benchmarks:0.7.0")
34+
testImplementation(":hamcrest-core:1.3")
35+
}
36+
37+
application {
38+
// The main class for the application.
39+
mainClass.set("xswing.start.XSwingWithOptions")
40+
}
41+
42+
// Output to build/libs/XSwingPlus.jar
43+
tasks.withType<ShadowJar> {
44+
archiveClassifier.set("")
45+
46+
copy {
47+
into("$buildDir/libs/")
48+
with(copySpec {
49+
from(".") {
50+
include("res/**")
51+
}
52+
})
53+
}
54+
copy {
55+
into("$buildDir/libs/")
56+
with(copySpec {
57+
from(".") {
58+
include("*.dll")
59+
include("*.so")
60+
include("*.jnilib")
61+
include("README.md")
62+
include("config.json")
63+
}
64+
})
65+
}
66+
}
67+

gradle/wrapper/gradle-wrapper.jar

61.9 KB
Binary file not shown.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
distributionBase=GRADLE_USER_HOME
2+
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
4+
networkTimeout=10000
5+
validateDistributionUrl=true
6+
zipStoreBase=GRADLE_USER_HOME
7+
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)