root/lang/javascript/dollar-mod.js/dolmod/trunk/scripts/ar.sh @ 29022

Revision 29022, 1.3 kB (checked in by lieutar, 6 years ago)

added new features.

  • Property svn:executable set to *
Line 
1#! /bin/sh
2
3ARNAME=$1
4shift;
5
6DIR=`cat $ARNAME`
7
8if test -z $DIR; then
9    echo $ARNAME is empty file >&2
10    exit 1;
11fi
12
13PROJECT=`echo $DIR|sed -e 's/-[^\/]*$//'`
14AR=$DIR.ar.js;
15TAR=$DIR.tar
16ZIP=$DIR.tar.gz;
17
18ar_js(){
19    propfile=$1;
20    shift;
21    cat $propfile | js `dirname $0`/js/ar.js
22}
23
24ar_sh(){
25    echo "\$mod.beginArchive('$PROJECT');"
26    find lib -name '*.js'\
27        |grep -v '.ar.js$'\
28        |grep -v '/site/'\
29        |grep -v '/my/'\
30        |grep -v 'dollar-mod.js$'\
31        |grep -v '\.m4\.js'\
32        |grep -v '\.inc\.js'\
33        |grep -v '\.s\.js'\
34        |grep -v '\.t\.js'\
35        >ar.srcs
36    cat ar.srcs |xargs cat|dolmod drop-comments
37    echo "\$mod.endArchive('$PROJECT');"
38}
39
40ARCMD=ar_sh
41
42echo PROJECT .... $PROJECT
43echo ARCHIVE .... $AR
44echo MODULE ARCHIVE BY ..... $ARCMD
45echo
46
47mkdir $DIR;
48mkdir $DIR/lib
49mkdir $DIR/m4lib
50$ARCMD > $DIR/lib/$AR;
51cp DEPENDS $DIR
52if test -f coMake.mk ; then
53    make -f coMake.mk archive WORKDIR=$DIR
54fi
55
56for f in `find lib -type f -name '*.js' |grep -v '/m4lib/'\
57                |grep -e '\.m4\.inc\.js'`;do
58    dir=`dirname $f`
59    if ! test -d $DIR/m4$dir ; then mkdir -p $DIR/m4$dir; fi
60    echo $DIR/m4$f
61    cp $f $DIR/m4$f
62done
63
64find  $DIR -type d -name '.svn'|xargs rm -rf
65find  $DIR -type d -name '.git'|xargs rm -rf
66tar -cvzf $ZIP $DIR
67
68rm -fr $DIR
Note: See TracBrowser for help on using the browser.