diff --git a/build/build.sh b/build/build.sh new file mode 100755 index 0000000..ce955a5 --- /dev/null +++ b/build/build.sh @@ -0,0 +1,20 @@ +#!/bin/sh +echo "beginning ng-annotate defs-build" +rm -rf es5 +mkdir es5 + +declare -a files=(ng-annotate.js ng-annotate-main.js run-tests.js) +for i in ${files[@]} +do + echo "building $i with defs" + defs ../$i > es5/$i +done + +cp ng-annotate es5/ + +cd es5 + +echo "running tests (in es5 mode i.e. without --harmony)" +cp -r ../../tests . +/usr/bin/env node run-tests.js +echo "done self-build" diff --git a/build/clean.sh b/build/clean.sh new file mode 100755 index 0000000..f922ec7 --- /dev/null +++ b/build/clean.sh @@ -0,0 +1,4 @@ +#!/bin/sh +echo "cleaning build files" +rm -rf es5 browser npm +echo "done cleaning" diff --git a/build/defs-config.json b/build/defs-config.json new file mode 120000 index 0000000..9e007f5 --- /dev/null +++ b/build/defs-config.json @@ -0,0 +1 @@ +../defs-config.json \ No newline at end of file diff --git a/build/ng-annotate b/build/ng-annotate new file mode 100755 index 0000000..107f0d5 --- /dev/null +++ b/build/ng-annotate @@ -0,0 +1,2 @@ +#!/usr/bin/env node +require("./ng-annotate"); diff --git a/build/prepare.sh b/build/prepare.sh new file mode 100755 index 0000000..acced18 --- /dev/null +++ b/build/prepare.sh @@ -0,0 +1,11 @@ +#!/bin/sh +cd .. +rm -rf build/npm +mkdir build/npm +git archive master -o build/npm/ng-annotate.tar --prefix=ng-annotate/ +cd build/npm +tar xf ng-annotate.tar && rm ng-annotate.tar +cd ng-annotate/build +./build.sh +cd ../.. +tar czf ng-annotate.tgz ng-annotate && rm -rf ng-annotate diff --git a/defs-config.json b/defs-config.json index ee8f952..c6abf36 100644 --- a/defs-config.json +++ b/defs-config.json @@ -2,6 +2,5 @@ "environments": ["node"], "disallowVars": true, "disallowDuplicated": true, - "disallowUnknownReferences": true, - "stats": true + "disallowUnknownReferences": true } diff --git a/ng-annotate b/ng-annotate-harmony similarity index 100% rename from ng-annotate rename to ng-annotate-harmony diff --git a/package.json b/package.json index 390265f..d35e80d 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "ng-annotate", "version": "0.2.0", "description": "add, remove and rebuild angularjs dependency injection annotations", - "main": "ng-annotate-main.js", + "main": "build/es5/ng-annotate-main.js", "repository": { "type": "git", "url": "https://github.com/olov/ng-annotate.git" @@ -34,7 +34,7 @@ "scripts": { "test": "node --harmony run-tests" }, - "bin": "./ng-annotate", + "bin": "./build/es5/ng-annotate", "author": "Olov Lassus ", "license": "MIT" }