-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.sh
28 lines (21 loc) · 868 Bytes
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
PKG_NAME=`grep -o ' packageName \"\(.*\)\"' src/package.ent | awk '{print $2}' | sed 's/"//g'`
VERSION=`grep -o ' packageVersion \"\(.*\)\"' src/package.ent | awk '{print $2}' | sed 's/"//g'`
# Create the dist directory if needed
if [[ ! -d dist ]]
then mkdir -p dist/package
else
rm dist/package/*.*
fi
# Copy files
cp src/*.css dist/package/
cp src/*.js dist/package/
cp src/*.html dist/package/
cp src/lang/*.xml dist/package/
# Copy the Value Converters to the dist/ folder
cp src/*.cs dist/
# Transform the package.xml file
xsltproc --novalid --xinclude --output dist/package/package.xml lib/packager.xslt src/package.xml
# Transform the manifest.xml file
xsltproc --novalid --xinclude --output dist/package/package.manifest lib/manifester.xslt src/manifest.xml
# Build the ZIP file
zip -j "dist/${PKG_NAME}-${VERSION}.zip" dist/package/* -x \*.DS_Store