2017-08-10 23:46:34 +00:00
|
|
|
.PHONY: all
|
2018-03-29 04:31:36 +00:00
|
|
|
all: duktape nashorn rhinojs swift goja
|
2017-08-10 23:46:34 +00:00
|
|
|
|
|
|
|
.PHONY: base
|
|
|
|
base:
|
|
|
|
if [ ! -e sheetjs.xlsx ]; then node ../../tests/write.js; fi
|
2018-02-14 20:06:35 +00:00
|
|
|
if [ ! -e xlsx.full.min.js ]; then cp ../../dist/xlsx.full.min.js .; fi
|
2018-03-13 02:51:54 +00:00
|
|
|
if [ ! -e shim.min.js ]; then cp ../../dist/shim.min.js .; fi
|
2017-08-10 23:46:34 +00:00
|
|
|
|
2018-03-13 02:51:54 +00:00
|
|
|
.PHONY: duk
|
|
|
|
duk: base
|
2017-09-12 20:02:06 +00:00
|
|
|
bash ./duktape.sh
|
|
|
|
gcc -std=c99 -Wall -osheetjs.duk sheetjs.duk.c duktape.c -lm
|
2018-03-13 02:51:54 +00:00
|
|
|
|
|
|
|
.PHONY: duktape
|
|
|
|
duktape: duk ## duktape demo
|
|
|
|
for ext in xlsx xlsb biff8.xls xml.xls; do ./sheetjs.duk sheetjs.$$ext; done
|
2017-08-10 23:46:34 +00:00
|
|
|
|
|
|
|
.PHONY: nashorn
|
|
|
|
nashorn: base ## nashorn demo
|
|
|
|
jjs nashorn.js
|
2017-09-05 05:26:50 +00:00
|
|
|
|
|
|
|
.PHONY: swift
|
|
|
|
swift: base ## swift demo
|
2018-02-14 20:06:35 +00:00
|
|
|
swiftc SheetJSCore.swift main.swift -o SheetJSSwift
|
|
|
|
./SheetJSSwift
|
2017-09-05 05:26:50 +00:00
|
|
|
|
2018-03-29 04:31:36 +00:00
|
|
|
.PHONY: goja
|
|
|
|
goja: base ## goja demo
|
|
|
|
if [ ! -e xlsx.core.min.js ]; then cp ../../dist/xlsx.core.min.js .; fi
|
|
|
|
go build goja.go
|
|
|
|
for ext in xlsx xlsb biff8.xls xml.xls; do ./goja sheetjs.$$ext; done
|
|
|
|
|
2017-09-12 20:02:06 +00:00
|
|
|
.PHONY: chakra
|
|
|
|
chakra: base ## Chakra demo
|
|
|
|
node -pe "fs.writeFileSync('payload.js', 'var payload = \"' + fs.readFileSync('sheetjs.xlsx').toString('base64') + '\";')"
|
2018-02-14 20:06:35 +00:00
|
|
|
cat global.js xlsx.full.min.js payload.js chakra.js > xlsx.chakra.js
|
2017-09-12 20:02:06 +00:00
|
|
|
chakra ./xlsx.chakra.js
|
|
|
|
|
2017-09-05 05:26:50 +00:00
|
|
|
.PHONY: rhinojs ## rhino demo
|
|
|
|
rhinojs: base SheetJSRhino.class
|
2018-02-14 20:06:35 +00:00
|
|
|
for ext in xlsx xlsb biff8.xls xml.xls; do java -cp .:SheetJS.jar:rhino.jar SheetJSRhino sheetjs.$$ext; done
|
2017-09-05 05:26:50 +00:00
|
|
|
|
|
|
|
RHDEPS=$(filter-out SheetJSRhino.class,$(patsubst %.java,%.class,$(wildcard com/sheetjs/*.java)))
|
|
|
|
$(RHDEPS): %.class: %.java rhino.jar
|
|
|
|
javac -cp .:SheetJS.jar:rhino.jar $*.java
|
|
|
|
|
|
|
|
SheetJSRhino.class: $(RHDEPS)
|
2018-02-14 20:06:35 +00:00
|
|
|
jar -cf SheetJS.jar $^ xlsx.full.min.js
|
2017-09-05 05:26:50 +00:00
|
|
|
javac -cp .:SheetJS.jar:rhino.jar SheetJSRhino.java
|
|
|
|
|
|
|
|
rhino.jar:
|
2018-02-28 10:41:49 +00:00
|
|
|
if [ ! -e rhino ]; then git clone --depth=1 https://github.com/mozilla/rhino; fi
|
2018-02-14 20:06:35 +00:00
|
|
|
#if [ ! -e rhino/build/rhino*/js.jar ]; then cd rhino; ant jar; fi
|
|
|
|
#cp rhino/build/rhino*/js.jar rhino.jar
|
|
|
|
if [ ! -e rhino/buildGradle/libs/rhino*.jar ]; then cd rhino; ./gradlew jar; fi
|
|
|
|
cp rhino/buildGradle/libs/rhino*.jar rhino.jar
|
2017-09-05 05:26:50 +00:00
|
|
|
|
|
|
|
.PHONY: clean
|
|
|
|
clean:
|
|
|
|
rm SheetJS.jar *.class com/sheetjs/*.class
|