Skip to content

Commit

Permalink
[make][s]: add a make and manifest files for building consolidated an…
Browse files Browse the repository at this point in the history
…d minified versions of ckanjs.
  • Loading branch information
rufuspollock committed Aug 30, 2011
1 parent a0c2814 commit 9abbd5a
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -3,3 +3,4 @@ configlocal.js
sandbox/*
css/ckan
.*.swp
build/*
47 changes: 47 additions & 0 deletions make
@@ -0,0 +1,47 @@
#!/bin/bash
#
# this is the make script
# it requires installation of node.js with the following
# modules installed:
#
# - jshint, for checking the js syntax
# - uglify-js, for js minification
# - markdown-js, for translation of readme.md to index.html
#
# Usage:
# just run ./make and be happy
#

set -e
BUILD=build
OUTFILE=$BUILD/ckanjs.js
MINFILE=$BUILD/ckanjs.min.js

echo "Checking JS files"
while read LINE
do
echo Skipping $LINE
# jshint $LINE
done < manifest

echo "Combining JS files"
DATE=`date +%s`
TMP=tmp_$DATE
TMPFILE=$TMP/tmp.js
mkdir $TMP
touch $TMPFILE

while read LINE
do
cat $LINE >> $TMPFILE
done < manifest

mkdir -p $BUILD
cp $TMPFILE $OUTFILE

echo "Compressing JS files"
uglifyjs -o $MINFILE $TMPFILE

# remove temporary folder
rm -Rf $TMP

13 changes: 13 additions & 0 deletions manifest
@@ -0,0 +1,13 @@
lib/client.js
lib/model.js
lib/templates.js
lib/view.js
lib/ui.js
lib/template/dataset-form.js
lib/template/dataset-view.js
lib/template/resource-form.js
lib/template/resource-upload.js
lib/template/resource-view.js
lib/view/dataset-listing.js
lib/view/resource-create.js
lib/view/resource-upload.js

0 comments on commit 9abbd5a

Please sign in to comment.