Removal of Gradle until needed, adds extra overhead.

This commit is contained in:
Marwolf
2018-08-14 06:18:13 -04:00
parent 0b2b6df94e
commit 80720289b5
5 changed files with 59 additions and 47 deletions

View File

@@ -117,7 +117,7 @@ if [ "$install" == "1" ]; then
echo "sudo ufw enable"
echo ""
echo ""
echo "Do you have Oracle Java JDK 8 and Gradle installed already? It is required for this."
echo "Do you have Oracle Java JDK 8 and Ant installed already? It is required for this."
echo ""
echo "${RED}1${NC} - Install for me!"
echo "${RED}2${NC} - Im all set"
@@ -130,7 +130,7 @@ if [ "$install" == "1" ]; then
# Ubuntu Java ===================================================>
if [ "$java" == "1" ]; then
sudo apt-get remove openjdk-6-jre default-jre default-jre-headless -y
sudo add-apt-repository ppa:webupd8team/java -y && sudo apt update && sudo apt install gradle ant oracle-java8-set-default openjfx -y
sudo add-apt-repository ppa:webupd8team/java -y && sudo apt update && sudo apt install ant oracle-java8-set-default openjfx -y
else
continue
fi
@@ -159,7 +159,7 @@ if [ "$install" == "1" ]; then
firewall-cmd --reload
echo ""
echo ""
echo "Do you have Oracle Java JDK 8 and Gradle installed already? It is required for this."
echo "Do you have Oracle Java JDK 8 and Ant installed already? It is required for this."
echo ""
echo "${RED}1${NC} - Install for me!"
echo "${RED}2${NC} - Im all set"
@@ -171,7 +171,7 @@ if [ "$install" == "1" ]; then
# Fedora Java ===================================================>
if [ "$java" == "1" ]; then
sudo dnf -y install gradle ant openjfx
sudo dnf -y install ant openjfx
wget --no-cookies \
--no-check-certificate \
--header "Cookie: oraclelicense=accept-securebackup-cookie" \
@@ -259,7 +259,7 @@ if [ "$install" == "1" ]; then
firewall-cmd --reload
echo ""
echo ""
echo "Do you have Oracle Java JDK 8 and Gradle installed already? It is required for this."
echo "Do you have Oracle Java JDK 8 and Ant installed already? It is required for this."
echo ""
echo "${RED}1${NC} - Install for me!"
echo "${RED}2${NC} - Im all set"
@@ -271,7 +271,7 @@ if [ "$install" == "1" ]; then
# CentOS 7 Java ===================================================>
if [ "$java" == "1" ]; then
sudo dnf -y install gradle ant openjfx
sudo dnf -y install ant openjfx
wget --no-cookies \
--no-check-certificate \
--header "Cookie: oraclelicense=accept-securebackup-cookie" \
@@ -355,7 +355,7 @@ if [ "$install" == "1" ]; then
brew install unzip wget git curl zip screen
echo ""
echo ""
echo "Do you have Oracle Java JDK 8 and Gradle installed already? It is required for this."
echo "Do you have Oracle Java JDK 8 and Ant installed already? It is required for this."
echo ""
echo "${RED}1${NC} - Install for me!"
echo "${RED}2${NC} - Im all set"
@@ -368,7 +368,7 @@ if [ "$install" == "1" ]; then
# Mac Java ===================================================>
if [ "$java" == "1" ]; then
brew tap AdoptOpenJDK/openjdk
brew install adoptopenjdk-openjdk8 gradle ant openjfx
brew install adoptopenjdk-openjdk8 ant openjfx
fi
# Mac Java <===================================================
@@ -438,7 +438,7 @@ if [ "$install" == "1" ]; then
echo ""
echo ""
echo "Do you have Oracle Java JDK 8 and Gradle installed already? It is required for this. If it fails, install manually."
echo "Do you have Oracle Java JDK 8 and Ant installed already? It is required for this. If it fails, install manually."
echo ""
echo "${RED}1${NC} - Install for me!"
echo "${RED}2${NC} - Im all set"
@@ -451,7 +451,7 @@ if [ "$install" == "1" ]; then
# Other OS Java ===================================================>
if [ "$java" == "1" ]; then
sudo apt-get remove openjdk-6-jre default-jre default-jre-headless -y
sudo add-apt-repository ppa:webupd8team/java -y && sudo apt update && sudo apt install gradle ant oracle-java8-set-default openjfx -y
sudo add-apt-repository ppa:webupd8team/java -y && sudo apt update && sudo apt install ant oracle-java8-set-default openjfx -y
else
continue
fi

View File

@@ -59,9 +59,9 @@ goto doinstall
:installjava
echo:
echo Installing Oracle Java JDK 8 and Gradle.
echo Installing Oracle Java JDK 8 and Ant.
echo:
choco install -y jdk8 gradle ant
choco install -y jdk8 ant
echo:
echo:
goto askdocker

View File

@@ -14,22 +14,28 @@ sudo make start-single-player
echo ""
echo ""
# Compile the game server and client
echo "Compiling the game client."
echo ""
#sudo ant -f Game/client/build.xml compile
sudo gradle -b Game/client/build.gradle compile
echo ""
echo ""
echo "Compiling the game server."
echo ""
#sudo ant -f Game/server/build.xml compile
sudo gradle -b Game/server/build.gradle compile
echo ""
echo ""
cd Game
if git diff --name-only | grep -o '[a-zA-Z0-9]*.java' > /dev/null; then
# Compile the game server and client
echo "Compiling the game client."
echo ""
sudo ant -f "client/build.xml" compile
#sudo gradle -b "client/build.gradle" compile
echo ""
echo ""
echo "Compiling the game server."
echo ""
sudo ant -f "server/build.xml" compile
#sudo gradle -b "server/build.gradle" compile
echo ""
echo ""
fi
cd ../
#Create game cache
echo "Removing old then extracting a fresh client cache to your home folder."
echo "Removing old cache if exists and then extracting a fresh client cache to your home folder."
echo ""
sudo rm -rf ~/OpenRSC
mkdir ~/OpenRSC
@@ -37,28 +43,34 @@ unzip -o Game/client/cache.zip -d ~/OpenRSC >/dev/null
echo ""
echo ""
#Import fresh version of config database
echo "Importing a fresh openrsc_config.sql database."
echo ""
sudo docker exec -i $(sudo docker-compose ps -q mysqldb) mysql -u"root" -p"root" < Game/Databases/openrsc_config.sql 2>/dev/null
echo ""
echo ""
cd Game
if git diff --name-only | grep -o '[a-zA-Z0-9]*.sql' > /dev/null; then
#Generate updated cache files, copies them to cache folder overwriting existing
echo "Generating cache .dat files from current config database and copying to client cache in your home folder."
echo ""
sudo ant -f Game/server/build.xml npcs items objects > /dev/null
yes | cp -rf Game/server/npcs.dat ~/OpenRSC/npcs.dat
yes | cp -rf Game/server/objects.dat ~/OpenRSC/objects.dat
yes | cp -rf Game/server/items.dat ~/OpenRSC/items.dat
echo ""
echo ""
#Import fresh version of config database
echo "Importing a fresh openrsc_config.sql database."
echo ""
sudo docker exec -i $(sudo docker-compose ps -q mysqldb) mysql -u"root" -p"root" < Game/Databases/openrsc_config.sql 2>/dev/null
echo ""
echo ""
#Generate updated cache files, copies them to cache folder overwriting existing
echo "Generating cache .dat files from current config database and copying to client cache in your home folder."
echo ""
sudo ant -f Game/server/build.xml npcs items objects > /dev/null
yes | cp -rf Game/server/npcs.dat ~/OpenRSC/npcs.dat
yes | cp -rf Game/server/objects.dat ~/OpenRSC/objects.dat
yes | cp -rf Game/server/items.dat ~/OpenRSC/items.dat
echo ""
echo ""
fi
cd ../
# Run the game client in a new window
echo "Launching the game client."
echo ""
#ant -f Game/client/build.xml runclient &
java -jar Game/client/Open_RSC_Client.jar &
ant -f Game/client/build.xml runclient &
#java -jar Game/client/Open_RSC_Client.jar &
echo ""
echo ""

View File

@@ -17,12 +17,12 @@ echo:
REM Compile the game server and client:
echo Compiling the game client.
echo:
echo:
call ant -f Game/client/build.xml compile
echo:
echo:
echo Compiling the game server.
echo:
echo:
call ant -f Game/server/build.xml compile
echo:
echo:
@@ -45,7 +45,7 @@ echo:
REM Generate updated cache files, copies them to cache folder overwriting existing:
echo Generating cache .dat files from current config database and copying to client cache in your home folder.
echo:
echo:
call sudo ant -f Game/server/build.xml npcs items objects > NULL
xcopy /y "Game/server/npcs.dat" "%HOMEPATH%/OpenRSC/npcs.dat"
xcopy /y "Game/server/objects.dat" "%HOMEPATH%/OpenRSC/objects.dat"

View File

@@ -8,4 +8,4 @@ echo ""
echo "Console output is being saved to gameserver.log"
echo ""
cd Game/server
java -jar Open_RSC_Server.jar > ../../gameserver.log
java -jar "Open_RSC_Server.jar" > ../../gameserver.log