From 171aa9e3e4dc45c84f0e7aa93530d6766ebd2281 Mon Sep 17 00:00:00 2001 From: Marwolf Date: Sat, 11 Aug 2018 13:00:44 -0400 Subject: [PATCH] Gradle conversion, script cleanup --- Run_Production_Linux_Game_Server.sh | 9 ++++++--- Setup_Linux_Mac.sh | 20 ++++++++++---------- Start_Single_Player_Game_Linux_Mac.sh | 15 ++++++++++----- ant_launcher.sh | 3 ++- 4 files changed, 28 insertions(+), 19 deletions(-) diff --git a/Run_Production_Linux_Game_Server.sh b/Run_Production_Linux_Game_Server.sh index de8dd68..d5977dd 100755 --- a/Run_Production_Linux_Game_Server.sh +++ b/Run_Production_Linux_Game_Server.sh @@ -12,14 +12,16 @@ echo "" echo "Compiling the game server." echo "" echo "" -sudo ant -f Game/server/build.xml compile +#sudo ant -f Game/server/build.xml compile +sudo gradle -b Game/server/build.gradle compile echo "" echo "" # Client echo "Compiling the game client." echo "" -sudo ant -f "Game/client/build.xml" compile +#sudo ant -f "Game/client/build.xml" compile +sudo gradle -b Game/client/build.gradle compile echo "" echo "" echo "Compressing jar into zip" @@ -39,7 +41,8 @@ echo "" # Launcher echo "Compiling the game launcher." echo "" -sudo ant -f "Game/Launcher/build.xml" +#sudo ant -f "Game/Launcher/build.xml" jar +sudo gradle -b Game/Launcher/build.gradle jar echo "" echo "" echo "Copying result to Website/downloads/" diff --git a/Setup_Linux_Mac.sh b/Setup_Linux_Mac.sh index d775493..f0a7ba1 100755 --- a/Setup_Linux_Mac.sh +++ b/Setup_Linux_Mac.sh @@ -108,7 +108,7 @@ if [ "$install" == "1" ]; then echo "sudo ufw enable" echo "" echo "" - echo "Do you have Oracle Java JDK 8 and Apache Ant installed already? It is required for this." + echo "Do you have Oracle Java JDK 8 and Gradle installed already? It is required for this." echo "" echo "${RED}1${NC} - Install for me!" echo "${RED}2${NC} - Im all set" @@ -118,7 +118,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 ant oracle-java8-set-default -y + sudo add-apt-repository ppa:webupd8team/java -y && sudo apt update && sudo apt install gradle ant oracle-java8-set-default -y else continue fi @@ -147,7 +147,7 @@ if [ "$install" == "1" ]; then firewall-cmd --reload echo "" echo "" - echo "Do you have Oracle Java JDK 8 and Apache Ant installed already? It is required for this." + echo "Do you have Oracle Java JDK 8 and Gradle installed already? It is required for this." echo "" echo "${RED}1${NC} - Install for me!" echo "${RED}2${NC} - Im all set" @@ -156,7 +156,7 @@ if [ "$install" == "1" ]; then # Fedora Java ===================================================> if [ "$java" == "1" ]; then - sudo dnf -y install ant + sudo dnf -y install gradle ant wget --no-cookies \ --no-check-certificate \ --header "Cookie: oraclelicense=accept-securebackup-cookie" \ @@ -241,7 +241,7 @@ if [ "$install" == "1" ]; then firewall-cmd --reload echo "" echo "" - echo "Do you have Oracle Java JDK 8 and Apache Ant installed already? It is required for this." + echo "Do you have Oracle Java JDK 8 and Gradle installed already? It is required for this." echo "" echo "${RED}1${NC} - Install for me!" echo "${RED}2${NC} - Im all set" @@ -250,7 +250,7 @@ if [ "$install" == "1" ]; then # CentOS 7 Java ===================================================> if [ "$java" == "1" ]; then - sudo dnf -y install ant + sudo dnf -y install gradle ant wget --no-cookies \ --no-check-certificate \ --header "Cookie: oraclelicense=accept-securebackup-cookie" \ @@ -328,7 +328,7 @@ if [ "$install" == "1" ]; then brew install unzip wget git curl zip screen echo "" echo "" - echo "Do you have Oracle Java JDK 8 and Apache Ant installed already? It is required for this." + echo "Do you have Oracle Java JDK 8 and Gradle installed already? It is required for this." echo "" echo "${RED}1${NC} - Install for me!" echo "${RED}2${NC} - Im all set" @@ -338,7 +338,7 @@ if [ "$install" == "1" ]; then # Mac Java ===================================================> if [ "$java" == "1" ]; then brew tap AdoptOpenJDK/openjdk - brew install adoptopenjdk-openjdk8 + brew install adoptopenjdk-openjdk8 gradle ant fi # Mac Java <=================================================== @@ -402,7 +402,7 @@ if [ "$install" == "1" ]; then echo "" echo "" - echo "Do you have Oracle Java JDK 8 and Apache Ant installed already? It is required for this. If it fails, install manually." + echo "Do you have Oracle Java JDK 8 and Gradle 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" @@ -412,7 +412,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 ant oracle-java8-set-default -y + sudo add-apt-repository ppa:webupd8team/java -y && sudo apt update && sudo apt install gradle ant oracle-java8-set-default -y else continue fi diff --git a/Start_Single_Player_Game_Linux_Mac.sh b/Start_Single_Player_Game_Linux_Mac.sh index a9b567a..31ef762 100755 --- a/Start_Single_Player_Game_Linux_Mac.sh +++ b/Start_Single_Player_Game_Linux_Mac.sh @@ -17,12 +17,14 @@ echo "" # Compile the game server and client echo "Compiling the game client." echo "" -sudo ant -f Game/client/build.xml compile +#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 ant -f Game/server/build.xml compile +sudo gradle -b Game/server/build.gradle compile echo "" echo "" @@ -31,7 +33,7 @@ echo "Removing old then extracting a fresh client cache to your home folder." echo "" sudo rm -rf ~/OpenRSC mkdir ~/OpenRSC -unzip -o Game/client/cache.zip -d ~/OpenRSC +unzip -o Game/client/cache.zip -d ~/OpenRSC >/dev/null echo "" echo "" @@ -55,12 +57,15 @@ echo "" # Run the game client in a new window echo "Launching the game client." echo "" -ant -f Game/client/build.xml runclient & +#ant -f Game/client/build.xml runclient & +java -jar Game/client/Open_RSC_Client.jar & echo "" echo "" # Run the game server in the current window echo "Launching the game server." echo "" -ant -f Game/server/build.xml runserver +#ant -f Game/server/build.xml runserver +cd Game/server +java -jar Open_RSC_Server.jar echo "" diff --git a/ant_launcher.sh b/ant_launcher.sh index b46e569..5518951 100755 --- a/ant_launcher.sh +++ b/ant_launcher.sh @@ -7,4 +7,5 @@ echo "CTRL + A + D to detach the screen so this continues in the background." echo "" echo "Console output is being saved to gameserver.log" echo "" -ant -f Game/server/build.xml runserver > gameserver.log +cd Game/server +java -jar Open_RSC_Server.jar > gameserver.log