OSDN Git Service

add daily-build script
authormzp <mzpppp@gmail.com>
Wed, 19 Aug 2009 22:10:14 +0000 (07:10 +0900)
committermzp <mzpppp@gmail.com>
Wed, 19 Aug 2009 22:10:14 +0000 (07:10 +0900)
scripts/Makefile [new file with mode: 0644]
scripts/daily-build.sh [new file with mode: 0755]

diff --git a/scripts/Makefile b/scripts/Makefile
new file mode 100644 (file)
index 0000000..1e4a4c8
--- /dev/null
@@ -0,0 +1,84 @@
+# ------------------------------
+# macro
+# ------------------------------
+ROOT :=$(PWD)
+SRC  :=$(ROOT)/src
+DEST :=$(ROOT)/dest
+SUMMARY := $(ROOT)/summary.log
+BUILD := $(ROOT)/build.log
+UNIT := $(ROOT)/unittent.log
+INTEGRATE := $(ROOT)/intergate.log
+
+define check_prog
+       @/bin/echo -n "checking $1 ... "
+       @if which $1 > /dev/null; then \
+         /bin/echo "ok"; \
+        else \
+         /bin/echo "not found"; \
+         exit 1; \
+        fi
+endef
+
+define check_file
+       /bin/echo -n "checking $1 ... "; \
+       if test -e $1; then \
+         /bin/echo "ok"; \
+       else \
+         /bin/echo "not found"; \
+         exit 1; \
+       fi
+endef
+
+# ------------------------------
+.PHONY: check build unit integrate swf web all code clean
+
+all : web
+
+check:
+       $(call check_prog,git)
+       $(call check_prog,ocaml)
+       $(call check_prog,ocamlfind)
+       $(call check_prog,omake)
+       $(call check_prog,avmplus)
+       $(call check_prog,swfmill)
+
+code: $(SRC)
+
+$(SRC):
+       rm -rf $(SRC)
+       git clone --depth 1 git://github.com/mzp/scheme-abc.git $(SRC)
+
+build: check $(SRC)
+       cd $(SRC) && \
+       git clean -fx && \
+       omake config PREFIX=$(DEST) && \
+       omake all | tee $(BUILD)
+
+unit: build
+       cd $(SRC) && \
+       omake check-detail && \
+       mv unittest.log $(UNIT)
+
+integrate: build
+       cd $(SRC) && \
+       omake integrate && \
+       mv integrate.log $(INTEGRATE)
+
+swf: check
+       cd $(SRC) && \
+       omake install && \
+       $(call check_file,$(DEST)/bin/habc) | tee swf.log ; \
+       $(call check_file,$(DEST)/bin/habc-scm) | tee swf.log ; \
+       $(call check_file,$(DEST)/bin/habc-xml) | tee swf.log ; \
+       $(call check_file,$(DEST)/lib/habc/std.ho) | tee swf.log ; \
+       $(call check_file,$(DEST)/lib/habc/stub.stub.ho) | tee swf.log ; \
+       $(call check_file,$(DEST)/lib/habc/flash.stub.ho) | tee swf.log; \
+       $(call check_file,$(DEST)/share/template.xml) | tee swf.log; \
+       $(call check_file,$(DEST)/share/example) | tee swf.log
+
+web: unit integrate swf
+
+clean:
+       rm -rf $(SRC)
+       rm -rf $(DEST)
+       rm -f *.log
\ No newline at end of file
diff --git a/scripts/daily-build.sh b/scripts/daily-build.sh
new file mode 100755 (executable)
index 0000000..9467597
--- /dev/null
@@ -0,0 +1,106 @@
+#!/bin/sh
+
+# ------------------------------
+# config
+# ------------------------------
+dest=$PWD/dest
+src=$PWD/src
+
+# ------------------------------
+# function
+# ------------------------------
+function check(){
+    cmd=$1
+    /bin/echo -n "cheking $1 ... "
+    if which $1 > /dev/null; then
+       /bin/echo "ok"
+    else
+       /bin/echo "not found"
+       exit 1
+    fi
+}
+
+function exists(){
+    /bin/echo -n "check $1 ... "
+    if [[ -e $1 ]]; then
+       echo "ok"
+    else
+       echo "not found"
+       exit 1
+    fi
+}
+
+trap 'exit 1' 2
+
+echo ------------------------------
+echo cleanup
+echo ------------------------------
+rm -rf $dest
+rm -f summary.log
+rm -f unittest.log
+rm -f integrate.log
+rm -f build.log
+
+echo ------------------------------
+echo check
+echo ------------------------------
+check git
+check ocaml
+check ocamlfind
+check omake
+check avmplus
+check swfmill
+
+echo ------------------------------
+echo check out
+echo ------------------------------
+if [[ $SKIP -ne 1 ]]; then
+    rm -rf $src
+    git clone --depth 1 git://github.com/mzp/scheme-abc.git $src
+    cd $src
+else
+    cd $src
+    echo "pull"
+    git pull
+fi
+
+echo ------------------------------
+echo build
+echo ------------------------------
+git clean -fx
+omake config PREFIX=$dest
+omake all
+echo "build:$?" >> summary.log
+
+echo ------------------------------
+echo unit test
+echo ------------------------------
+omake check-detail
+echo "unittest:$?" >> summary.log
+mv unittest.log ..
+
+echo ------------------------------
+echo integrate test
+echo ------------------------------
+omake integrate
+echo "integrate:$?" >> summary.log
+mv integrate.log ..
+
+echo ------------------------------
+echo swf test
+echo ------------------------------
+omake install
+
+cd $dest
+exists bin/habc     | tee swf.log
+exists bin/habc-scm | tee -a swf.log
+exists bin/habc-xml | tee -a swf.log
+exists bin/habc-xml | tee -a swf.log
+
+exists lib/habc/std.ho | tee -a swf.log
+exists lib/habc/stub.stub.ho | tee -a swf.log
+exists lib/habc/flash.stub.ho | tee -a swf.log
+
+echo ------------------------------
+echo make webpage
+echo ------------------------------