lucene/contrib/javascript/build.xml

118 lines
3.7 KiB
XML
Raw Normal View History

<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<project name="solrjs" default="dist" basedir=".">
<!-- our current version -->
<property name="version" value="1.4-dev"/>
<!-- a filelist for the core js files in correct order -->
<filelist id="src_core" dir="src/core" >
<file name="Core.js"/>
<file name="QueryItem.js"/>
<file name="Manager.js"/>
<file name="AbstractWidget.js"/>
<file name="AbstractServerSideWidget.js"/>
<file name="AbstractClientSideWidget.js"/>
</filelist>
<!-- a fileset for the server side widget files -->
<fileset id="src_serverside" dir="src/serverside" >
<include name="*.js"/>
</fileset>
<!-- a fileset for the client side widget files -->
<fileset id="src_clientside" dir="src/clientside" >
<include name="*.js"/>
</fileset>
<!-- create dist -->
<target name="clean">
<delete dir="dist" quiet="true"/>
<delete dir="doc" quiet="true"/>
</target>
<target name="create-dist-folder" depends="clean">
<mkdir dir="dist" />
</target>
<!-- create a single js file -->
<target name="concat" depends="create-dist-folder">
<concat destfile="dist/solrjs-${version}.js" fixlastline="true">
<filelist refid="src_core"/>
<fileset refid="src_serverside"/>
<fileset refid="src_clientside"/>
</concat>
</target>
<target name="dist" depends="concat,docs">
<jar destfile="dist/solrjs-${version}-templates.jar">
<fileset dir="src/templates" >
<include name="*.vm"/>
</fileset>
</jar>
</target>
<!-- create docs -->
<target name="docs">
<delete dir="dist/doc"/>
<mkdir dir="dist/doc"/>
<java jar="lib/jsdoc/jsdoc-toolkit/jsrun.jar" fork="true" failonerror="true">
<arg value="lib/jsdoc/jsdoc-toolkit/app/run.js"/>
<arg value="-r=4" />
<arg value="src/" />
<arg value="-t=lib/jsdoc/jsdoc-toolkit/templates/jsdoc"/>
<arg value="-d=dist/doc"/>
<arg value="-p"/>
</java>
</target>
<!-- import current solr.war to example -->
<target name="example-init" depends="dist">
<copy file="../../dist/apache-solr-${version}.war" tofile="example/testsolr/webapps/solr.war"/>
<copy todir="example/testsolr/solr/lib" overwrite="true">
<fileset dir="../velocity/src/main/solr/lib/"/>
</copy>
<copy file="dist/solrjs-${version}-templates.jar" todir="example/testsolr/solr/lib"/>
</target>
<!-- start server
<target name="example-start">
<java jar="example/testsolr/start.jar" fork="true" failonerror="true" dir="example/testsolr/" />
</target>
-->
<!-- import testdata (server has to be online)
<target name="example-import">
<java jar="example/testdata/reutersimporter.jar" fork="true" failonerror="true" dir="example/testdata/">
<arg value="http://localhost:8983/solr/"/>
<arg value="." />
</java>
</target>
-->
<target name="example" depends="build"/>
<!-- do nothing for now, required for generate maven artifacts -->
<target name="build"/>
<target name="javadoc"/>
<target name="test"/> <!-- TODO: Tests would be nice :) -->
</project>