Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added targets for 'run' and 'test'.

  • Loading branch information...
commit 55f35a5e828ae3ba43dc5f985507fba20fbb4229 1 parent c3cbca7
@davehunt davehunt authored
Showing with 41 additions and 15 deletions.
  1. +10 −13 README.md
  2. +31 −2 build.xml
View
23 README.md
@@ -11,24 +11,19 @@ Continuous Integration
How to build
------------
-Before you can test or build the extension you will have to init the [Add-ons SDK](https://github.com/mozilla/addon-sdk) submodule. After it has been done, activate
-it's environment:
+Before you can test or build the extension you will have to init the [Add-ons SDK](https://github.com/mozilla/addon-sdk) submodule.
git submodule update --init
- cd addon-sdk
- source bin/activate
- cd ..
To run tests against the extension:
- cd extension
- cfx test
-
+ ant test
To manually test the extension:
- cd extension
- cfx run
+ ant run
+
+To specify the Firefox binary include `-Dbinary=path/to/firefox` on the command line.
To build simply run `ant` and the default build script/target will be invoked:
@@ -42,7 +37,9 @@ To build for release (no build number in filename):
ant release
-You can also build directly using `cfx`:
+You can also use the Add-ons SDK directly using `cfx`:
- cd extension
- cfx xpi
+ cd addon-sdk
+ source bin/activate
+ cd ../extension
+ cfx docs
View
33 build.xml
@@ -7,6 +7,11 @@
<format property="build.number" pattern="yyyyMMddHHmm"/>
</tstamp>
+ <condition property="cfx.binary" value="-b ${binary}">
+ <isset property="binary"/>
+ </condition>
+ <property name="cfx.binary" value=""/>
+
<target name="release" depends="version"
description="Builds a release version">
<property name="xpi.filename" value="${ant.project.name}-${build.version}.xpi"/>
@@ -46,10 +51,34 @@
<target name="build">
<property name="build.filename" value="extension/${ant.project.name}.xpi"/>
<delete file="${build.filename}"/>
- <exec executable="cfx" dir="extension">
- <arg value="xpi"/>
+ <exec executable="/bin/sh" dir="addon-sdk">
+ <arg value="-c"/>
+ <arg value="source bin/activate;cd ../extension;cfx xpi"/>
</exec>
<echo>build.filename: ${build.filename}</echo>
</target>
+ <target name="run">
+ <exec executable="/bin/sh" dir="addon-sdk">
+ <arg value="-c"/>
+ <arg value="source bin/activate;cd ../extension;cfx run ${cfx.binary}"/>
+ </exec>
+ </target>
+
+ <target name="test">
+ <exec executable="/bin/sh"
+ dir="addon-sdk"
+ resultproperty="test.result">
+ <arg value="-c"/>
+ <arg value="source bin/activate;cd ../extension;cfx test ${cfx.binary}"/>
+ </exec>
+ <fail message="Tests failed!">
+ <condition>
+ <not>
+ <equals arg1="${test.result}" arg2="0"/>
+ </not>
+ </condition>
+ </fail>
+ </target>
+
</project>
Please sign in to comment.
Something went wrong with that request. Please try again.