Skip to content

Commit

Permalink
fixed build process so developers can have local setting for unit tes…
Browse files Browse the repository at this point in the history
…ts while run code run can use defaults
  • Loading branch information
thatcher committed Feb 4, 2010
1 parent 43b4aec commit cefe441
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 27 deletions.
24 changes: 17 additions & 7 deletions build.xml
Expand Up @@ -4,7 +4,7 @@
<description>Builds, tests, and runs the project Env.</description>
<tstamp/>
<property file="build.properties"/>

<echo message="{"/>
<echo message=" 'BUILD_PROPERTIES': {"/>
<echo message=" 'PROJECT': '${PROJECT}',"/>
Expand Down Expand Up @@ -41,7 +41,10 @@
<property name="DIST_DIR"
location="${PREFIX}/"
description="Folder for concatenated, min, lite and packed target" />


<available property='HAS_LOCAL'
file='${BASEDIR}/local_settings.js' />

<echo message=" 'ENVIRONMENT':{"/>
<echo message=" 'BASEDIR': '${BASEDIR}',"/>
<echo message=" 'SRC_DIR': '${SRC_DIR}',"/>
Expand All @@ -50,7 +53,8 @@
<echo message=" 'PREFIX': '${PREFIX}',"/>
<echo message=" 'DOCS_DIR': '${DOCS_DIR}',"/>
<echo message=" 'TEST_DIR': '${TEST_DIR}',"/>
<echo message=" 'DIST_DIR': '${DIST_DIR}'"/>
<echo message=" 'DIST_DIR': '${DIST_DIR}',"/>
<echo message=" 'HAS_LOCAL': '${HAS_LOCAL}'"/>
<echo message=" },"/>


Expand Down Expand Up @@ -85,14 +89,20 @@
<echo message=" }"/>
<echo message=" }"/>


<!-- BUILD TARGETS -->
<target name="all" depends="concat"/>

<target name="rhino">
<ant antfile="rhino/build.xml" target="all" inheritAll="false"/>
</target>



<target name='local-settings' unless='${HAS_LOCAL}'>
<copy file="${BASEDIR}/settings.js"
tofile="${BASEDIR}/local_settings.js"
overwrite='false'/>
</target>

<!-- BUILD ENV PLATFORM BINDINGS -->
<target name="env-platforms" depends='core-env, rhino-env-spec'/>
Expand Down Expand Up @@ -501,7 +511,7 @@

<!-- TEST XHR SPECIFICATION -->
<target name='xhr-spec'
depends='xhr'
depends='xhr, local-settings'
description='Test XMLHttpRequest Specs'>
<echo message=""/>
<echo message="Executing XMLHttpRequest Spec"/>
Expand Down Expand Up @@ -586,7 +596,7 @@

<!-- TEST WINDOW SPECIFICATION -->
<target name='window-spec'
depends='window'
depends='window, local-settings'
description='Test Window Specs'>
<echo message=""/>
<echo message="Executing Window Spec"/>
Expand Down
15 changes: 0 additions & 15 deletions local_settings.js

This file was deleted.

4 changes: 1 addition & 3 deletions settings.js
Expand Up @@ -6,9 +6,7 @@
* as not to commit your local settings back to the repo.
*/

var SETTINGS = {

var SETTINGS = {
BASE_URI : 'file:///mnt/repos/thatcher/env-js/',
AJAX_BASE: 'http://github.com/thatcher/env-js/raw/master/'

};
2 changes: 1 addition & 1 deletion test/specs/window/spec.js
Expand Up @@ -23,7 +23,7 @@ try{
_load('dist/parser.js');
_load('dist/xhr.js');
_load('dist/window.js');
_load('settings.js');
_load('local_settings.js');

document.async = false;

Expand Down
2 changes: 1 addition & 1 deletion test/specs/xhr/spec.js
Expand Up @@ -42,7 +42,7 @@ _load('dist/html.js');
_load('dist/timer.js');
_load('dist/parser.js');
_load('dist/xhr.js');
_load('settings.js');
_load('local_settings.js');

module('xhr');

Expand Down

0 comments on commit cefe441

Please sign in to comment.