Skip to content

Commit 44448d6

Browse files
authored
Merge pull request #90 from Project516/release
Release
2 parents 8331c6e + ea6ac80 commit 44448d6

13 files changed

Lines changed: 1313 additions & 1114 deletions

File tree

LICENSE

Lines changed: 674 additions & 674 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 366 additions & 181 deletions
Large diffs are not rendered by default.

app/src/main/resources/version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
rolling
1+
0.1.3

debian-package/DEBIAN/control

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
<<<<<<< HEAD
12
Package: numberguessinggame
2-
Version: 1.0.0
3+
Version: 0.1.3
34
Section: games
45
Priority: optional
56
Architecture: all
@@ -9,3 +10,16 @@ Description: A simple number guessing game
910
A simple number guessing game where you try to guess a randomly
1011
generated number. The game will tell you if your guess is too high
1112
or too low until you find the correct number.
13+
=======
14+
Package: numberguessinggame
15+
Version: 1.0.0
16+
Section: games
17+
Priority: optional
18+
Architecture: all
19+
Depends: default-jre | java8-runtime
20+
Maintainer: project516 <project516.progress139@slmail.me>
21+
Description: A simple number guessing game
22+
A simple number guessing game where you try to guess a randomly
23+
generated number. The game will tell you if your guess is too high
24+
or too low until you find the correct number.
25+
>>>>>>> parent of ad04a2e (readme fix)

gradle.properties

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
org.gradle.configuration-cache=true
2-
org.gradle.parallel=true
3-
org.gradle.caching=true
4-
org.gradle.daemon=true
1+
org.gradle.configuration-cache=true
2+
org.gradle.parallel=true
3+
org.gradle.caching=true
4+
org.gradle.daemon=true

package-deb.sh

Lines changed: 50 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,50 @@
1-
#!/bin/sh
2-
# Script to create a Debian package (.deb) for Number Guessing Game
3-
# This package can be installed on Debian-based Linux distributions (Ubuntu, Mint, etc.)
4-
# Usage: ./package-deb.sh
5-
# Output: numberguessinggame.deb
6-
7-
# Exit immediately if any command fails
8-
set -e
9-
10-
echo "Building Number Guessing Game Debian package..."
11-
12-
# Clean up any previous build artifacts
13-
echo "Cleaning up previous builds..."
14-
rm -rf debian-package/usr/share/games/numberguessinggame/*
15-
rm -f numberguessinggame.deb
16-
17-
# Build the application using Gradle
18-
echo "Building application..."
19-
20-
./gradlew build
21-
22-
# Copy the compiled JAR file to the package directory
23-
echo "Copying files to package directory..."
24-
cp app/build/libs/app-all.jar debian-package/usr/share/games/numberguessinggame/game.jar
25-
26-
# Copy documentation files
27-
cp README.md debian-package/usr/share/games/numberguessinggame/README.md
28-
cp LICENSE debian-package/usr/share/games/numberguessinggame/LICENSE
29-
30-
# Set correct permissions for Debian package
31-
echo "Setting file permissions..."
32-
chmod 755 debian-package/DEBIAN
33-
chmod 755 debian-package/DEBIAN/postinst
34-
chmod 755 debian-package/usr/games/numberguessinggame
35-
36-
# Build the .deb package using dpkg-deb
37-
echo "Building .deb package..."
38-
dpkg-deb --build debian-package numberguessinggame.deb
39-
40-
# Display success message with installation instructions
41-
echo ""
42-
echo "✓ Debian package created: numberguessinggame.deb"
43-
echo ""
44-
echo "To install, run:"
45-
echo " sudo apt install ./numberguessinggame.deb"
46-
echo " sudo apt install -f # to install any missing dependencies"
47-
echo ""
48-
echo "After installation, run the game with:"
49-
echo " numberguessinggame"
50-
echo ""
1+
#!/bin/sh
2+
# Script to create a Debian package (.deb) for Number Guessing Game
3+
# This package can be installed on Debian-based Linux distributions (Ubuntu, Mint, etc.)
4+
# Usage: ./package-deb.sh
5+
# Output: numberguessinggame.deb
6+
7+
# Exit immediately if any command fails
8+
set -e
9+
10+
echo "Building Number Guessing Game Debian package..."
11+
12+
# Clean up any previous build artifacts
13+
echo "Cleaning up previous builds..."
14+
rm -rf debian-package/usr/share/games/numberguessinggame/*
15+
rm -f numberguessinggame.deb
16+
17+
# Build the application using Gradle
18+
echo "Building application..."
19+
20+
./gradlew build
21+
22+
# Copy the compiled JAR file to the package directory
23+
echo "Copying files to package directory..."
24+
cp app/build/libs/app-all.jar debian-package/usr/share/games/numberguessinggame/game.jar
25+
26+
# Copy documentation files
27+
cp README.md debian-package/usr/share/games/numberguessinggame/README.md
28+
cp LICENSE debian-package/usr/share/games/numberguessinggame/LICENSE
29+
30+
# Set correct permissions for Debian package
31+
echo "Setting file permissions..."
32+
chmod 755 debian-package/DEBIAN
33+
chmod 755 debian-package/DEBIAN/postinst
34+
chmod 755 debian-package/usr/games/numberguessinggame
35+
36+
# Build the .deb package using dpkg-deb
37+
echo "Building .deb package..."
38+
dpkg-deb --build debian-package numberguessinggame.deb
39+
40+
# Display success message with installation instructions
41+
echo ""
42+
echo "✓ Debian package created: numberguessinggame.deb"
43+
echo ""
44+
echo "To install, run:"
45+
echo " sudo apt install ./numberguessinggame.deb"
46+
echo " sudo apt install -f # to install any missing dependencies"
47+
echo ""
48+
echo "After installation, run the game with:"
49+
echo " numberguessinggame"
50+
echo ""

package-linux.sh

Lines changed: 72 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,72 @@
1-
#!/bin/sh
2-
# Script to create a Linux package with bundled JRE for Number Guessing Game
3-
# This creates a self-contained package that doesn't require Java to be installed
4-
# Output: NumberGuessingGame-linux.tar.xz
5-
6-
# Exit immediately if any command fails
7-
set -e
8-
9-
echo "Building Number Guessing Game for Linux with bundled JRE..."
10-
11-
# Configuration
12-
PACKAGE_NAME="NumberGuessingGame-linux"
13-
JRE_DIR="jre-linux"
14-
ADOPTIUM_BASE_URL="https://api.adoptium.net/v3/binary/latest/8/ga"
15-
16-
# Clean up any previous builds
17-
rm -rf ${PACKAGE_NAME}
18-
rm -rf ${JRE_DIR}
19-
rm -f ${PACKAGE_NAME}.tar.xz
20-
rm -f ${PACKAGE_NAME}.tar.gz
21-
22-
# Build the application using Gradle
23-
echo "Building application..."
24-
./gradlew build
25-
26-
# Download JRE for Linux from Eclipse Adoptium
27-
echo "Downloading JRE for Linux..."
28-
mkdir -p ${JRE_DIR}
29-
curl -L "${ADOPTIUM_BASE_URL}/linux/x64/jre/hotspot/normal/eclipse?project=jdk" -o ${JRE_DIR}/jre-linux.tar.gz
30-
31-
# Extract the downloaded JRE
32-
echo "Extracting JRE..."
33-
cd ${JRE_DIR}
34-
tar -xzf jre-linux.tar.gz
35-
JRE_EXTRACTED=$(ls -d jdk* 2>/dev/null || ls -d jre* 2>/dev/null)
36-
cd ..
37-
38-
# Create package directory structure
39-
echo "Creating package structure..."
40-
mkdir -p ${PACKAGE_NAME}
41-
cp app/build/libs/app-all.jar ${PACKAGE_NAME}/game.jar
42-
cp README.md ${PACKAGE_NAME}/README.txt
43-
cp LICENSE ${PACKAGE_NAME}/LICENSE
44-
45-
# Copy the JRE into the package
46-
echo "Copying JRE into package..."
47-
cp -r ${JRE_DIR}/${JRE_EXTRACTED} ${PACKAGE_NAME}/jre
48-
49-
# Create a shell script that uses the bundled JRE
50-
cat > ${PACKAGE_NAME}/run.sh << 'EOF'
51-
#!/bin/sh
52-
53-
# Get the directory where the script is located
54-
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
55-
56-
"${SCRIPT_DIR}/jre/bin/java" -jar "${SCRIPT_DIR}/game.jar"
57-
EOF
58-
59-
# Make the run script executable
60-
chmod +x ${PACKAGE_NAME}/run.sh
61-
62-
# Create the final tar.xz archive with maximum compression
63-
echo "Creating tar.xz archive..."
64-
tar -cJf ${PACKAGE_NAME}.tar.xz ${PACKAGE_NAME}/
65-
66-
# Clean up temporary directories
67-
rm -rf ${PACKAGE_NAME}
68-
rm -rf ${JRE_DIR}
69-
70-
echo ""
71-
echo "✓ Linux package with bundled JRE created: ${PACKAGE_NAME}.tar.xz"
72-
echo ""
1+
#!/bin/sh
2+
# Script to create a Linux package with bundled JRE for Number Guessing Game
3+
# This creates a self-contained package that doesn't require Java to be installed
4+
# Output: NumberGuessingGame-linux.tar.xz
5+
6+
# Exit immediately if any command fails
7+
set -e
8+
9+
echo "Building Number Guessing Game for Linux with bundled JRE..."
10+
11+
# Configuration
12+
PACKAGE_NAME="NumberGuessingGame-linux"
13+
JRE_DIR="jre-linux"
14+
ADOPTIUM_BASE_URL="https://api.adoptium.net/v3/binary/latest/8/ga"
15+
16+
# Clean up any previous builds
17+
rm -rf ${PACKAGE_NAME}
18+
rm -rf ${JRE_DIR}
19+
rm -f ${PACKAGE_NAME}.tar.xz
20+
rm -f ${PACKAGE_NAME}.tar.gz
21+
22+
# Build the application using Gradle
23+
echo "Building application..."
24+
./gradlew build
25+
26+
# Download JRE for Linux from Eclipse Adoptium
27+
echo "Downloading JRE for Linux..."
28+
mkdir -p ${JRE_DIR}
29+
curl -L "${ADOPTIUM_BASE_URL}/linux/x64/jre/hotspot/normal/eclipse?project=jdk" -o ${JRE_DIR}/jre-linux.tar.gz
30+
31+
# Extract the downloaded JRE
32+
echo "Extracting JRE..."
33+
cd ${JRE_DIR}
34+
tar -xzf jre-linux.tar.gz
35+
JRE_EXTRACTED=$(ls -d jdk* 2>/dev/null || ls -d jre* 2>/dev/null)
36+
cd ..
37+
38+
# Create package directory structure
39+
echo "Creating package structure..."
40+
mkdir -p ${PACKAGE_NAME}
41+
cp app/build/libs/app-all.jar ${PACKAGE_NAME}/game.jar
42+
cp README.md ${PACKAGE_NAME}/README.txt
43+
cp LICENSE ${PACKAGE_NAME}/LICENSE
44+
45+
# Copy the JRE into the package
46+
echo "Copying JRE into package..."
47+
cp -r ${JRE_DIR}/${JRE_EXTRACTED} ${PACKAGE_NAME}/jre
48+
49+
# Create a shell script that uses the bundled JRE
50+
cat > ${PACKAGE_NAME}/run.sh << 'EOF'
51+
#!/bin/sh
52+
53+
# Get the directory where the script is located
54+
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
55+
56+
"${SCRIPT_DIR}/jre/bin/java" -jar "${SCRIPT_DIR}/game.jar"
57+
EOF
58+
59+
# Make the run script executable
60+
chmod +x ${PACKAGE_NAME}/run.sh
61+
62+
# Create the final tar.xz archive with maximum compression
63+
echo "Creating tar.xz archive..."
64+
tar -cJf ${PACKAGE_NAME}.tar.xz ${PACKAGE_NAME}/
65+
66+
# Clean up temporary directories
67+
rm -rf ${PACKAGE_NAME}
68+
rm -rf ${JRE_DIR}
69+
70+
echo ""
71+
echo "✓ Linux package with bundled JRE created: ${PACKAGE_NAME}.tar.xz"
72+
echo ""

0 commit comments

Comments
 (0)