diff --git a/binary/build_jar.bat b/binary/build_jar.bat index 16e22af5..63d44bbe 100755 --- a/binary/build_jar.bat +++ b/binary/build_jar.bat @@ -1,5 +1,5 @@ @echo off -echo Requirement: jar javac +echo Requirement: jdk1.8 jar javac set JAR=jar set JAVAC=javac diff --git a/binary/build_jar.sh b/binary/build_jar.sh index 9e324a43..4f0f3a3a 100755 --- a/binary/build_jar.sh +++ b/binary/build_jar.sh @@ -1,13 +1,17 @@ -echo "Requirement: jar javac " +echo "Requirement: jdk1.8 jar javac " + +JAVAC=javac +JAR=jar + function build_jar(){ rm -rf $3/$1 mkdir classes find $2/java -name "*.java" >source.txt - javac -cp lib/*:libex/* -encoding "utf-8" -d classes @source.txt + ${JAVAC} -cp lib/*:libex/* -encoding "utf-8" -d classes @source.txt cp -R $2/resource/* classes/ - jar cf $1 -C classes ./ + ${JAR} cf $1 -C classes ./ rm -rf source.txt rm -rf classes mv $1 $3/ diff --git a/mobile/build_jar.bat b/mobile/build_jar.bat new file mode 100755 index 00000000..e995453c --- /dev/null +++ b/mobile/build_jar.bat @@ -0,0 +1,34 @@ +@echo off +echo Requirement: jdk1.8 jar javac + +set JAR=jar +set JAVAC=javac + +mkdir assets +mkdir assets\resfiles + +echo build assets\resfiles\minijvm_rt.jar +call :build_jar minijvm_rt.jar ..\minijvm\java\src\main assets\resfiles + +echo build assets\resfiles\glfw_gui.jar +call :build_jar glfm_gui.jar .\java\glfm_gui\src\main assets\resfiles + +echo build assets\resfiles\minijvm_test.jar +call :build_jar ExApp.jar .\java\ExApp\src\main assets\resfiles + +echo completed. +pause +goto :eof + + +:build_jar + del /Q/S/F %3\%1 + md classes + dir /S /B %2\java\*.java > source.txt + %JAVAC% -cp assets\resfiles\*.jar -encoding "utf-8" -d classes @source.txt + xcopy /E %2\resource\* classes\ + %JAR% cf %1 -C classes .\ + del /Q/S source.txt + rd /Q/S classes\ + move /Y %1 %3\ +goto :eof \ No newline at end of file diff --git a/mobile/build_jar.sh b/mobile/build_jar.sh new file mode 100755 index 00000000..9142278e --- /dev/null +++ b/mobile/build_jar.sh @@ -0,0 +1,31 @@ + +echo "Requirement: jdk1.8 jar javac " + +JAVAC=javac +JAR=jar + +function build_jar(){ + rm -rf $3/$1 + mkdir classes + find $2/java -name "*.java" >source.txt + ${JAVAC} -cp assets/resfiles/*.jar -encoding "utf-8" -d classes @source.txt + cp -R $2/resource/* classes/ + ${JAR} cf $1 -C classes ./ + rm -rf source.txt + rm -rf classes + mv $1 $3/ +} + +mkdir lib +mkdir libex + +echo "build assets/resfiles/minijvm_rt.jar" +$(build_jar minijvm_rt.jar ../minijvm/java/src/main assets/resfiles) + +echo "build assets/resfiles/glfm_gui.jar" +$(build_jar glfm_gui.jar ./java/glfm_gui/src/main assets/resfiles) + +echo "build assets/resfiles/ExApp.jar" +$(build_jar ExApp.jar ./java/ExApp/src/main assets/resfiles) + +echo "completed"