Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,348 changes: 674 additions & 674 deletions LICENSE

Large diffs are not rendered by default.

547 changes: 366 additions & 181 deletions README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion app/src/main/resources/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
rolling
0.1.3
16 changes: 15 additions & 1 deletion debian-package/DEBIAN/control
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<<<<<<< HEAD
Package: numberguessinggame
Version: 1.0.0
Version: 0.1.3
Section: games
Priority: optional
Architecture: all
Expand All @@ -9,3 +10,16 @@ Description: A simple number guessing game
A simple number guessing game where you try to guess a randomly
generated number. The game will tell you if your guess is too high
or too low until you find the correct number.
=======
Package: numberguessinggame
Version: 1.0.0
Section: games
Priority: optional
Architecture: all
Depends: default-jre | java8-runtime
Maintainer: project516 <project516.progress139@slmail.me>
Description: A simple number guessing game
A simple number guessing game where you try to guess a randomly
generated number. The game will tell you if your guess is too high
or too low until you find the correct number.
>>>>>>> parent of ad04a2e (readme fix)
8 changes: 4 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
org.gradle.configuration-cache=true
org.gradle.parallel=true
org.gradle.caching=true
org.gradle.daemon=true
org.gradle.configuration-cache=true
org.gradle.parallel=true
org.gradle.caching=true
org.gradle.daemon=true
100 changes: 50 additions & 50 deletions package-deb.sh
Original file line number Diff line number Diff line change
@@ -1,50 +1,50 @@
#!/bin/sh
# Script to create a Debian package (.deb) for Number Guessing Game
# This package can be installed on Debian-based Linux distributions (Ubuntu, Mint, etc.)
# Usage: ./package-deb.sh
# Output: numberguessinggame.deb
# Exit immediately if any command fails
set -e
echo "Building Number Guessing Game Debian package..."
# Clean up any previous build artifacts
echo "Cleaning up previous builds..."
rm -rf debian-package/usr/share/games/numberguessinggame/*
rm -f numberguessinggame.deb
# Build the application using Gradle
echo "Building application..."
./gradlew build
# Copy the compiled JAR file to the package directory
echo "Copying files to package directory..."
cp app/build/libs/app-all.jar debian-package/usr/share/games/numberguessinggame/game.jar
# Copy documentation files
cp README.md debian-package/usr/share/games/numberguessinggame/README.md
cp LICENSE debian-package/usr/share/games/numberguessinggame/LICENSE
# Set correct permissions for Debian package
echo "Setting file permissions..."
chmod 755 debian-package/DEBIAN
chmod 755 debian-package/DEBIAN/postinst
chmod 755 debian-package/usr/games/numberguessinggame
# Build the .deb package using dpkg-deb
echo "Building .deb package..."
dpkg-deb --build debian-package numberguessinggame.deb
# Display success message with installation instructions
echo ""
echo "✓ Debian package created: numberguessinggame.deb"
echo ""
echo "To install, run:"
echo " sudo apt install ./numberguessinggame.deb"
echo " sudo apt install -f # to install any missing dependencies"
echo ""
echo "After installation, run the game with:"
echo " numberguessinggame"
echo ""
#!/bin/sh
# Script to create a Debian package (.deb) for Number Guessing Game
# This package can be installed on Debian-based Linux distributions (Ubuntu, Mint, etc.)
# Usage: ./package-deb.sh
# Output: numberguessinggame.deb

# Exit immediately if any command fails
set -e

echo "Building Number Guessing Game Debian package..."

# Clean up any previous build artifacts
echo "Cleaning up previous builds..."
rm -rf debian-package/usr/share/games/numberguessinggame/*
rm -f numberguessinggame.deb

# Build the application using Gradle
echo "Building application..."

./gradlew build

# Copy the compiled JAR file to the package directory
echo "Copying files to package directory..."
cp app/build/libs/app-all.jar debian-package/usr/share/games/numberguessinggame/game.jar

# Copy documentation files
cp README.md debian-package/usr/share/games/numberguessinggame/README.md
cp LICENSE debian-package/usr/share/games/numberguessinggame/LICENSE

# Set correct permissions for Debian package
echo "Setting file permissions..."
chmod 755 debian-package/DEBIAN
chmod 755 debian-package/DEBIAN/postinst
chmod 755 debian-package/usr/games/numberguessinggame

# Build the .deb package using dpkg-deb
echo "Building .deb package..."
dpkg-deb --build debian-package numberguessinggame.deb

# Display success message with installation instructions
echo ""
echo "✓ Debian package created: numberguessinggame.deb"
echo ""
echo "To install, run:"
echo " sudo apt install ./numberguessinggame.deb"
echo " sudo apt install -f # to install any missing dependencies"
echo ""
echo "After installation, run the game with:"
echo " numberguessinggame"
echo ""
144 changes: 72 additions & 72 deletions package-linux.sh
Original file line number Diff line number Diff line change
@@ -1,72 +1,72 @@
#!/bin/sh
# Script to create a Linux package with bundled JRE for Number Guessing Game
# This creates a self-contained package that doesn't require Java to be installed
# Output: NumberGuessingGame-linux.tar.xz
# Exit immediately if any command fails
set -e
echo "Building Number Guessing Game for Linux with bundled JRE..."
# Configuration
PACKAGE_NAME="NumberGuessingGame-linux"
JRE_DIR="jre-linux"
ADOPTIUM_BASE_URL="https://api.adoptium.net/v3/binary/latest/8/ga"
# Clean up any previous builds
rm -rf ${PACKAGE_NAME}
rm -rf ${JRE_DIR}
rm -f ${PACKAGE_NAME}.tar.xz
rm -f ${PACKAGE_NAME}.tar.gz
# Build the application using Gradle
echo "Building application..."
./gradlew build
# Download JRE for Linux from Eclipse Adoptium
echo "Downloading JRE for Linux..."
mkdir -p ${JRE_DIR}
curl -L "${ADOPTIUM_BASE_URL}/linux/x64/jre/hotspot/normal/eclipse?project=jdk" -o ${JRE_DIR}/jre-linux.tar.gz
# Extract the downloaded JRE
echo "Extracting JRE..."
cd ${JRE_DIR}
tar -xzf jre-linux.tar.gz
JRE_EXTRACTED=$(ls -d jdk* 2>/dev/null || ls -d jre* 2>/dev/null)
cd ..
# Create package directory structure
echo "Creating package structure..."
mkdir -p ${PACKAGE_NAME}
cp app/build/libs/app-all.jar ${PACKAGE_NAME}/game.jar
cp README.md ${PACKAGE_NAME}/README.txt
cp LICENSE ${PACKAGE_NAME}/LICENSE
# Copy the JRE into the package
echo "Copying JRE into package..."
cp -r ${JRE_DIR}/${JRE_EXTRACTED} ${PACKAGE_NAME}/jre
# Create a shell script that uses the bundled JRE
cat > ${PACKAGE_NAME}/run.sh << 'EOF'
#!/bin/sh
# Get the directory where the script is located
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
"${SCRIPT_DIR}/jre/bin/java" -jar "${SCRIPT_DIR}/game.jar"
EOF
# Make the run script executable
chmod +x ${PACKAGE_NAME}/run.sh
# Create the final tar.xz archive with maximum compression
echo "Creating tar.xz archive..."
tar -cJf ${PACKAGE_NAME}.tar.xz ${PACKAGE_NAME}/
# Clean up temporary directories
rm -rf ${PACKAGE_NAME}
rm -rf ${JRE_DIR}
echo ""
echo "✓ Linux package with bundled JRE created: ${PACKAGE_NAME}.tar.xz"
echo ""
#!/bin/sh
# Script to create a Linux package with bundled JRE for Number Guessing Game
# This creates a self-contained package that doesn't require Java to be installed
# Output: NumberGuessingGame-linux.tar.xz

# Exit immediately if any command fails
set -e

echo "Building Number Guessing Game for Linux with bundled JRE..."

# Configuration
PACKAGE_NAME="NumberGuessingGame-linux"
JRE_DIR="jre-linux"
ADOPTIUM_BASE_URL="https://api.adoptium.net/v3/binary/latest/8/ga"

# Clean up any previous builds
rm -rf ${PACKAGE_NAME}
rm -rf ${JRE_DIR}
rm -f ${PACKAGE_NAME}.tar.xz
rm -f ${PACKAGE_NAME}.tar.gz

# Build the application using Gradle
echo "Building application..."
./gradlew build

# Download JRE for Linux from Eclipse Adoptium
echo "Downloading JRE for Linux..."
mkdir -p ${JRE_DIR}
curl -L "${ADOPTIUM_BASE_URL}/linux/x64/jre/hotspot/normal/eclipse?project=jdk" -o ${JRE_DIR}/jre-linux.tar.gz

# Extract the downloaded JRE
echo "Extracting JRE..."
cd ${JRE_DIR}
tar -xzf jre-linux.tar.gz
JRE_EXTRACTED=$(ls -d jdk* 2>/dev/null || ls -d jre* 2>/dev/null)
cd ..

# Create package directory structure
echo "Creating package structure..."
mkdir -p ${PACKAGE_NAME}
cp app/build/libs/app-all.jar ${PACKAGE_NAME}/game.jar
cp README.md ${PACKAGE_NAME}/README.txt
cp LICENSE ${PACKAGE_NAME}/LICENSE

# Copy the JRE into the package
echo "Copying JRE into package..."
cp -r ${JRE_DIR}/${JRE_EXTRACTED} ${PACKAGE_NAME}/jre

# Create a shell script that uses the bundled JRE
cat > ${PACKAGE_NAME}/run.sh << 'EOF'
#!/bin/sh

# Get the directory where the script is located
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"

"${SCRIPT_DIR}/jre/bin/java" -jar "${SCRIPT_DIR}/game.jar"
EOF

# Make the run script executable
chmod +x ${PACKAGE_NAME}/run.sh

# Create the final tar.xz archive with maximum compression
echo "Creating tar.xz archive..."
tar -cJf ${PACKAGE_NAME}.tar.xz ${PACKAGE_NAME}/

# Clean up temporary directories
rm -rf ${PACKAGE_NAME}
rm -rf ${JRE_DIR}

echo ""
echo "✓ Linux package with bundled JRE created: ${PACKAGE_NAME}.tar.xz"
echo ""
Loading
Loading