aboutsummaryrefslogtreecommitdiffstats
path: root/infrastructure/bin
diff options
context:
space:
mode:
authorAlexander Sulfrian <alexander@sulfrian.net>2010-06-08 09:01:43 +0200
committerAlexander Sulfrian <alexander@sulfrian.net>2010-06-08 09:01:43 +0200
commitd1fa08fdc9cb11dccee76d668ff85df30458c295 (patch)
tree1d19df6405103577d872902486792e8c23bce711 /infrastructure/bin
parentd7c5ad7d6263fd1baf9bfdbaa4c50b70ef2fbdb2 (diff)
parent70d1f9d6fcaefe611e778b8dbf3bafea8934aa08 (diff)
downloadetherpad-d1fa08fdc9cb11dccee76d668ff85df30458c295.tar.gz
etherpad-d1fa08fdc9cb11dccee76d668ff85df30458c295.tar.xz
etherpad-d1fa08fdc9cb11dccee76d668ff85df30458c295.zip
Merge remote branch 'upstream/master'
Conflicts: etherpad/src/etherpad/control/pro/admin/pro_admin_control.js etherpad/src/etherpad/control/pro/pro_main_control.js etherpad/src/etherpad/control/pro_help_control.js etherpad/src/etherpad/globals.js etherpad/src/etherpad/legacy_urls.js etherpad/src/etherpad/pne/pne_utils.js etherpad/src/etherpad/pro/pro_utils.js etherpad/src/main.js etherpad/src/plugins/fileUpload/templates/fileUpload.ejs etherpad/src/plugins/testplugin/templates/page.ejs etherpad/src/static/css/pad2_ejs.css etherpad/src/static/css/pro-help.css etherpad/src/static/img/jun09/pad/protop.gif etherpad/src/static/js/store.js etherpad/src/themes/default/templates/framed/framedheader-pro.ejs etherpad/src/themes/default/templates/main/home.ejs etherpad/src/themes/default/templates/pro-help/main.ejs etherpad/src/themes/default/templates/pro-help/pro-help-template.ejs infrastructure/com.etherpad/licensing.scala trunk/etherpad/src/etherpad/collab/ace/contentcollector.js trunk/etherpad/src/etherpad/collab/ace/linestylefilter.js trunk/etherpad/src/static/css/home-opensource.css trunk/etherpad/src/static/js/ace.js trunk/etherpad/src/static/js/linestylefilter_client.js trunk/etherpad/src/templates/email/eepnet_license_info.ejs trunk/etherpad/src/templates/pad/pad_body2.ejs trunk/etherpad/src/templates/pad/pad_content.ejs trunk/etherpad/src/templates/pad/padfull_body.ejs trunk/etherpad/src/templates/pro/admin/pne-license-manager.ejs
Diffstat (limited to 'infrastructure/bin')
-rwxr-xr-xinfrastructure/bin/classpath.sh21
-rwxr-xr-xinfrastructure/bin/comp.sh199
-rwxr-xr-xinfrastructure/bin/compilecache.sh66
-rwxr-xr-xinfrastructure/bin/jscomp.sh23
-rwxr-xr-xinfrastructure/bin/makejar.sh74
-rwxr-xr-xinfrastructure/bin/makesars.sh23
-rwxr-xr-xinfrastructure/bin/run.sh20
7 files changed, 426 insertions, 0 deletions
diff --git a/infrastructure/bin/classpath.sh b/infrastructure/bin/classpath.sh
new file mode 100755
index 0000000..b1d297c
--- /dev/null
+++ b/infrastructure/bin/classpath.sh
@@ -0,0 +1,21 @@
+#!/bin/bash
+
+# Copyright 2009 Google Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS-IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+CP="./"
+for f in `ls lib/*.jar`; do
+ CP="${CP}:${f}"
+done
+echo $CP
diff --git a/infrastructure/bin/comp.sh b/infrastructure/bin/comp.sh
new file mode 100755
index 0000000..5f65c2f
--- /dev/null
+++ b/infrastructure/bin/comp.sh
@@ -0,0 +1,199 @@
+#!/bin/bash -e
+
+# Copyright 2009 Google Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS-IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+source bin/compilecache.sh
+
+rm -rf build
+mkdir build
+
+if [ "$1" == "clearcache" ]; then
+ echo "CLEARING BUILD CACHE"
+ rm -rf buildcache
+ mkdir -p buildcache
+ shift;
+fi
+
+if [ -z "$CC" ]; then
+ CC=fsc
+fi
+echo compiling with \'$CC\'...
+
+CP=`bin/classpath.sh`
+CP="build/:${CP}"
+
+if [ -z "$OBFUSC" ]; then
+ OBFUSC=0
+else
+ echo obfuscation on...
+fi
+
+#THRIFTFILES=`echo net.appjet.fancypants/{storage/KeyValueStore,DebugLog,LtpLog}.thrift`
+#THRIFTFILES=`find gen-java/net/appjet/fancypants -name '*.java'`
+#function genthrift {
+# echo "generating thrift..."
+# rm -rf gen-java
+# for a in $THRIFTFILES; do
+# thrift -java $a
+# done
+
+# echo "compiling thrift..."
+# CP="${CP}:gen-java/"
+# javac \
+# -classpath $CP \
+# -target 1.5 \
+# -d $1 \
+# $THRIFTFILES
+#}
+#cacheonfiles thrift "$THRIFTFILES" genthrift
+
+ARGS=$@
+
+COMMONFILES=`find net.appjet.common -name '*.java'`
+COMMONSCALAFILES=`find net.appjet.common -name '*.scala'`
+function gencommon {
+ echo "compiling common..."
+ javac \
+ -cp $CP \
+ -d $1 \
+ -target 1.5 \
+ $COMMONFILES
+ $CC \
+ -classpath $CP \
+ -d $1 \
+ -target:jvm-1.5 \
+ $ARGS \
+ $COMMONSCALAFILES
+}
+cacheonfiles common "$COMMONFILES $COMMONSCALAFILES" gencommon
+
+SARSFILES=`find net.appjet.common.sars -name '*.scala'`
+function gensars {
+ echo "compiling sars..."
+ $CC \
+ -classpath $CP \
+ -d $1 \
+ -target:jvm-1.5 \
+ $ARGS \
+ $SARSFILES
+}
+cacheonfiles sars "$SARSFILES" gensars
+
+CLIFILES=`find net.appjet.common.cli -name '*.scala'`
+function gencli {
+ echo "compiling cli..."
+ $CC \
+ -classpath $CP \
+ -d $1 \
+ -target:jvm-1.5 \
+ $ARGS \
+ $CLIFILES
+ echo "done with cli"
+}
+cacheonfiles cli "$CLIFILES" gencli
+
+BODYLOCKFILES=`find net.appjet.bodylock -name '*.scala'`
+function genbodylock {
+ echo "compiling rhino abstraction..."
+ $CC \
+ -classpath build:$CP \
+ -d $1 \
+ -target:jvm-1.5 \
+ $ARGS \
+ $BODYLOCKFILES
+}
+cacheonfiles bodylock "$BODYLOCKFILES" genbodylock
+
+APPSERVERFILES=`find net.appjet.oui -name '*.scala'`
+APPSERVERJAVAFILES=`find net.appjet.oui -name '*.java'`
+function genappserver {
+ echo "compiling appserver source..."
+ javac \
+ -cp $CP \
+ -d $1 \
+ -target 1.5 \
+ $APPSERVERJAVAFILES
+ $CC \
+ -classpath $CP \
+ -d $1 \
+ -target:jvm-1.5 \
+ $ARGS \
+ $APPSERVERFILES
+}
+cacheonfiles appserver "$APPSERVERFILES $APPSERVERJAVAFILES" genappserver
+
+AJSTDLIBFILES=`find net.appjet.ajstdlib -name '*.scala'`
+AJSTDLIBJAVAFILES=`find net.appjet.ajstdlib -name '*.java'`
+function genajstdlib {
+ echo "compiling ajstdlib..."
+ mkdir -p $1
+ if [ ! -z "$AJSTDLIBJAVAFILES" ]; then
+ javac \
+ -cp $CP \
+ -d $1 \
+ -target 1.5 \
+ $AJSTDLIBJAVAFILES
+ fi
+ $CC \
+ -classpath $CP \
+ -d $1 \
+ -target:jvm-1.5 \
+ $ARGS \
+ $AJSTDLIBFILES
+}
+cacheonfiles ajstdlib "$AJSTDLIBFILES $AJSTDLIBJAVAFILES" genajstdlib
+
+EPFILES=`find com.etherpad -name '*.scala'`
+function genetherpad {
+ echo "compilng etherpad..."
+ $CC \
+ -classpath $CP \
+ -d $1 \
+ -target:jvm-1.5 \
+ $ARGS \
+ $EPFILES
+}
+cacheonfiles etherpad "$EPFILES" genetherpad
+
+OOSERVICEFILES=`find com.etherpad.openofficeservice -name '*.scala'`
+function genooservice {
+ echo "compiling ooservice..."
+ $CC \
+ -classpath $CP \
+ -d $1 \
+ -target:jvm-1.5 \
+ $ARGS \
+ $OOSERVICEFILES
+}
+cacheonfiles ooservice "$OOSERVICEFILES" genooservice
+
+echo "copying files..."
+cp net.appjet.ajstdlib/streaming-client.js build/net/appjet/ajstdlib/
+if [ $OBFUSC ] ; then
+ echo obfuscating...
+ scala -classpath $CP:. net.appjet.bodylock.compressor \
+ build/net/appjet/ajstdlib/streaming-client.js
+fi
+
+cp net.appjet.ajstdlib/streaming-iframe.html build/net/appjet/ajstdlib/
+mkdir -p build/net/appjet/ajstdlib/modules
+
+echo "building javascript classfiles..."
+scala -classpath $CP net.appjet.bodylock.Compiler \
+ -destination=build/net/appjet/ajstdlib/ \
+ -cutPrefix=framework-src \
+ `find framework-src -name '*.js'`
+
+echo "done."
diff --git a/infrastructure/bin/compilecache.sh b/infrastructure/bin/compilecache.sh
new file mode 100755
index 0000000..6e42a50
--- /dev/null
+++ b/infrastructure/bin/compilecache.sh
@@ -0,0 +1,66 @@
+#!/bin/bash
+
+# Copyright 2009 Google Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS-IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+CP_CMD="cp -R -u"
+if [ `uname` == "Darwin" ]; then
+ CP_CMD="/bin/cp -R -n"
+elif [ `uname` == "SunOS" ]; then
+ CP_CMD="cp -R" #Solaris cp does not have '-u'
+fi
+
+function cacheonfiles {
+ NAME=$1; FILES=$2; FUNC=$3; NOCOPY=1;
+ if [ -z "$4" ]; then
+ NOCOPY=0
+ fi
+ REBUILD=0
+ BPATH=buildcache/$NAME
+ FILETEST=$BPATH/t
+ if [ ! -f $FILETEST ]; then
+ REBUILD=1
+ else
+ for a in $FILES; do
+ if [ $FILETEST -ot $a ]; then
+ echo $a has changed, rebuilding $NAME
+ REBUILD=1
+ fi
+ done
+ fi
+ if [ $REBUILD -eq 1 ]; then
+ if [ -d $BPATH ]; then
+ rm -rf $BPATH
+ fi
+ mkdir -p $BPATH
+ $FUNC $BPATH
+ pushd $BPATH >> /dev/null
+ touch t
+ popd >> /dev/null
+ else
+ echo using cached $NAME...
+ fi
+ if [ $NOCOPY -ne 1 ]; then
+ for a in $BPATH/*; do
+ if [ -d $a ]; then
+ $CP_CMD $a build/
+ elif [ -f $a ]; then
+ cp $a build/
+ else
+ echo unknown file type $a
+ exit 1
+ fi
+ done
+ fi
+}
diff --git a/infrastructure/bin/jscomp.sh b/infrastructure/bin/jscomp.sh
new file mode 100755
index 0000000..3f5bc51
--- /dev/null
+++ b/infrastructure/bin/jscomp.sh
@@ -0,0 +1,23 @@
+#!/bin/bash -e
+
+# Copyright 2009 Google Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS-IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+rm -rf buildjs
+mkdir buildjs
+
+bin/comp.sh
+CLASSPATH=`bin/classpath.sh`
+
+scala -cp $CLASSPATH:build net.appjet.bodylock.Compiler -destination buildjs $@
diff --git a/infrastructure/bin/makejar.sh b/infrastructure/bin/makejar.sh
new file mode 100755
index 0000000..46b4609
--- /dev/null
+++ b/infrastructure/bin/makejar.sh
@@ -0,0 +1,74 @@
+#!/bin/bash -e
+
+# Copyright 2009 Google Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS-IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+if [ -z "$JAR" ]; then
+ JAR=jar
+else
+ echo "using JAR $JAR..."
+fi
+
+cp ${MYSQL_CONNECTOR_JAR} lib/
+
+source bin/compilecache.sh
+
+if [ "$1" == "clearcache" ]; then
+ echo "CLEARING BUILD CACHE"
+ rm -rf buildcache
+ shift;
+fi
+
+TMPSTORE=/tmp/ajbuild-tmpstore-`date +%s`
+
+JARFILES=`echo $SCALA_LIBRARY_JAR lib/*.jar lib/manifest`
+function genjar {
+ echo "unzipping JARs..."
+ pushd $1 >> /dev/null
+ $JAR xf $SCALA_LIBRARY_JAR
+ rm -rf META-INF
+ for a in ../../lib/*.jar; do
+ $JAR xf $a
+ rm -rf META-INF/{MANIFEST.MF,NOTICE{,.txt},LICENSE{,.txt},INDEX.LIST,SUN_MICR.{RSA,SF},maven}
+ done
+
+ echo "making cached JAR...."
+ $JAR -cfm appjet.jar ../../lib/manifest .
+ mv appjet.jar /tmp/appjet.jar
+ rm -rf *
+ mv /tmp/appjet.jar ./
+
+ popd >> /dev/null
+}
+cacheonfiles JAR "$JARFILES" genjar 1
+
+echo "compiling..."
+bin/comp.sh $@
+
+pushd build >> /dev/null
+
+echo "copying cached JAR..."
+cp ../buildcache/JAR/appjet.jar ./
+
+echo "making JAR..."
+mv appjet.jar /tmp/appjet.jar
+$JAR -uf /tmp/appjet.jar . #META-INF com javax org net uk v scala dojox
+mv /tmp/appjet.jar ./
+
+echo "cleaning up..."
+rm -rf $TMPSTORE
+
+popd >> /dev/null
+
+echo "done."
diff --git a/infrastructure/bin/makesars.sh b/infrastructure/bin/makesars.sh
new file mode 100755
index 0000000..541b04a
--- /dev/null
+++ b/infrastructure/bin/makesars.sh
@@ -0,0 +1,23 @@
+#!/bin/bash -e
+
+# Copyright 2009 Google Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS-IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+echo "compiling..."
+bin/comp.sh $@
+
+echo "building build/appjet-sars.jar..."
+jar cMf build/appjet-sars.jar -C build `echo build/net/appjet/common/sars/*.class | cut -d/ -f 2-`
+
+echo "done."
diff --git a/infrastructure/bin/run.sh b/infrastructure/bin/run.sh
new file mode 100755
index 0000000..cf918d4
--- /dev/null
+++ b/infrastructure/bin/run.sh
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+# Copyright 2009 Google Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS-IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+CP=`bin/classpath.sh`
+
+JAVA_OPTS="-d64 -server -Xmx12288m -Xloggc:/appjet/log/appserver/jvm-gc.log -XX:MaxPermSize=256m" scala -cp build:$CP net.appjet.oui.main -devMode -ajstdlibHome framework-src/modules -listenSars 8081 $@
+