Skip to content

Commit

Permalink
update build script
Browse files Browse the repository at this point in the history
  • Loading branch information
digitalgust committed Dec 15, 2020
1 parent 0503e85 commit 5810a00
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 4 deletions.
2 changes: 1 addition & 1 deletion binary/build_jar.bat
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@echo off
echo Requirement: jar javac
echo Requirement: jdk1.8 jar javac

set JAR=jar
set JAVAC=javac
Expand Down
10 changes: 7 additions & 3 deletions binary/build_jar.sh
Original file line number Diff line number Diff line change
@@ -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/
Expand Down
34 changes: 34 additions & 0 deletions mobile/build_jar.bat
Original file line number Diff line number Diff line change
@@ -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
31 changes: 31 additions & 0 deletions mobile/build_jar.sh
Original file line number Diff line number Diff line change
@@ -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"

0 comments on commit 5810a00

Please sign in to comment.