Build with an arbitrary configuration.
This commit is contained in:
+17
-5
@@ -8,15 +8,15 @@
|
|||||||
<property name="ol.home" location=".."/>
|
<property name="ol.home" location=".."/>
|
||||||
<property name="plovr.jar" location="${ol.home}/bin/plovr.jar"/>
|
<property name="plovr.jar" location="${ol.home}/bin/plovr.jar"/>
|
||||||
<property name="main.json" location="${ol.home}/main.json"/>
|
<property name="main.json" location="${ol.home}/main.json"/>
|
||||||
<property name="api.json" location="${ol.home}/api.json"/>
|
<property name="build.json" location="${ol.home}/api.json"/>
|
||||||
|
|
||||||
<target name="usage">
|
<target name="usage">
|
||||||
<echo>
|
<echo>
|
||||||
Available commands:
|
Available commands:
|
||||||
|
|
||||||
serve - Run the library server
|
serve - Run the library server
|
||||||
api - Builds the optimized file with public api
|
build - Builds a minified version of the library or an application
|
||||||
doc - Build the reference docs
|
doc - Generate the reference docs
|
||||||
</echo>
|
</echo>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
@@ -36,10 +36,22 @@
|
|||||||
</java>
|
</java>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="api" depends="deps">
|
<target name="checkpath">
|
||||||
|
<condition property="build.json.set">
|
||||||
|
<isset property="build.json"/>
|
||||||
|
</condition>
|
||||||
|
<fail message="Missing build config." unless="build.json.set"/>
|
||||||
|
<property name="build.json.fullpath" location="${build.json}"/>
|
||||||
|
<condition property="build.json.exists">
|
||||||
|
<available file="${build.json.fullpath}" type="file"/>
|
||||||
|
</condition>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="build" depends="deps, checkpath">
|
||||||
|
<fail message="Build config '${build.json.fullpath}' doesn't exist." unless="build.json.exists"/>
|
||||||
<java jar="${plovr.jar}" fork="true">
|
<java jar="${plovr.jar}" fork="true">
|
||||||
<arg value="build"/>
|
<arg value="build"/>
|
||||||
<arg value="${api.json}"/>
|
<arg value="${build.json}"/>
|
||||||
</java>
|
</java>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
|
|||||||
@@ -36,4 +36,9 @@ else
|
|||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
ant -e -f "$OL_HOME/bin/build.xml" -Dol.home="$OL_HOME" $1
|
ANT_ARGS=""
|
||||||
|
if [ $# -gt 1 ]; then
|
||||||
|
ANT_ARGS=-Dbuild.json="$2"
|
||||||
|
fi
|
||||||
|
|
||||||
|
ant -e -f "$OL_HOME/bin/build.xml" -Dbasedir=. -Dol.home="$OL_HOME" $1 $ANT_ARGS
|
||||||
|
|||||||
+4
-1
@@ -15,4 +15,7 @@ popd
|
|||||||
set COMMAND="%~1"
|
set COMMAND="%~1"
|
||||||
if "%~1" == "" set COMMAND="usage"
|
if "%~1" == "" set COMMAND="usage"
|
||||||
|
|
||||||
ant -e -f %OL_HOME%\bin\build.xml -Dol.home=%OL_HOME% -Dbasedir=. %COMMAND%
|
set ANT_ARGS=
|
||||||
|
if "%~2" == "" set ANT_ARGS="-Dbuild.json=%~2"
|
||||||
|
|
||||||
|
ant -e -f %OL_HOME%\bin\build.xml -Dol.home=%OL_HOME% -Dbasedir=. %COMMAND% %ANT_ARGS%
|
||||||
|
|||||||
Reference in New Issue
Block a user