xowa_get_and_make.sh 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. # == OVERVIEW ==
  2. # * REQUIREMENTS
  3. # ** Java JDK 1.7 (or higher): https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
  4. # ** Apache Ant 1.9.13 (or higher): https://ant.apache.org/bindownload.cgi
  5. # ** A ROOT_DIR directory on your file-system
  6. # ** (Windows) cygwin: https://www.cygwin.com/
  7. #
  8. # * PROCESS
  9. # ** Copy-paste this file to a plain-text file; EX: /cygdrive/c/xowa_dev/xowa_get_and_make.sh
  10. # ** Adjust these environment variables to your system: PLAT_NAME, ROOT_DIR, ANT_BINARY, JAVA_HOME
  11. # ** cd to your ROOT_DIR
  12. # ** Run the file using "sh xowa_get_and_make.sh"
  13. # ** Run the xowa_dev.jar
  14. # *** (Windows) java -jar xowa_dev.jar
  15. # *** (Linux) SWT_GTK3=0 && java -jar xowa_dev.jar
  16. # *** (Mac OS X) java -Xmx256m -d64 -XstartOnFirstThread -jar xowa_dev.jar
  17. # == ENVIRONMENT VARIABLES ==
  18. JAVA_JDK_VERSION=1.8
  19. # PLAT_NAME must be one of the following: windows_64,linux_64,macosx_64
  20. PLAT_NAME=windows_64
  21. # ROOT_DIR should be created beforehand, and should be in "/" format
  22. ROOT_DIR=c:/xowa_dev
  23. # these directories MUST be changed to wherever they exist on your system
  24. ANT_BINARY=/cygdrive/c/dev/apache_ant/bin/ant
  25. export JAVA_HOME=/cygdrive/c/dev/java/jdk_1_8_x64
  26. # == REMOVE PREVIOUS ARTIFACTS ==
  27. rm -rf ./master
  28. rm -rf ./src
  29. rm -rf ./dev
  30. rm -rf ./bin
  31. rm -rf ./file
  32. rm -rf ./user
  33. rm -rf ./wiki
  34. rm -rf ./xowa_dev.jar
  35. # == DOWNLOAD XOWA SOURCE ==
  36. # get src and unzip
  37. curl -LO https://api.github.com/repos/gnosygnu/xowa/tarball/master
  38. mkdir src
  39. # unzip; note that "strip 1" removes container folder EX: gnosygnu-123456
  40. tar -zxf master -C ./src --strip 1
  41. # == REORGANIZE DOWNLOAD FILES ==
  42. # move /res/ to /root/ folder
  43. mv src/res/* .
  44. # needed for Windows only (cygwin defaults to non-execute permissions)
  45. chmod -R 755 ./bin/$PLAT_NAME/xulrunner
  46. # remove test files
  47. find ./src -type f -name '*Test.java' -delete
  48. find ./src -type f -name '*_tst.java' -delete
  49. find ./src -type f -name '*_fxt.java' -delete
  50. find ./src -type f -name '*_mok.java' -delete
  51. # == BUILD XOWA ==
  52. $ANT_BINARY -v -buildfile ./dev/make/ant/xowa_compile.xml -Droot_dir=$ROOT_DIR -Djdk=$JAVA_JDK_VERSION
  53. $ANT_BINARY -v -buildfile ./dev/make/ant/xowa_make_jar.xml -Droot_dir=$ROOT_DIR -Dplat_name=$PLAT_NAME -Dxowa_jar_path=$ROOT_DIR/xowa_dev.jar