jqplot / build.xml

Chris Leonello 1517e56 
Chris Leonello 81ccd33 




cleonello 4ccbfbf 
Chris Leonello 81ccd33 



cleonello db0781a 
Chris Leonello 81ccd33 

Chris Leonello 0e897f3 
Chris Leonello 81ccd33 
Chris Leonello adfc4b6 
Chris Leonello 0e897f3 
Chris Leonello 81ccd33 

cleonello 9692a88 

Chris Leonello 5372d3e 

cleonello 4ccbfbf 
cleonello 9692a88 

Chris Leonello 81ccd33 



Chris Leonello f439201 
Chris Leonello 81ccd33 
Chris Leonello f439201 
Chris Leonello 81ccd33 

cleonello 9692a88 





Chris Leonello 2cfa244 
Chris Leonello 5372d3e 




Chris Leonello adfc4b6 
Chris Leonello 81ccd33 





















Chris Leonello 5372d3e 
cleonello 9692a88 








Chris Leonello 5372d3e 


Chris Leonello f439201 


cleonello c52520e 
cleonello 98f5de9 
cleonello 2677355 
cleonello 9463bae 
cleonello 8230b32 
cleonello 4ccbfbf 
cleonello 7414f23 
Chris Leonello 5372d3e 

cleonello 8230b32 







Chris Leonello 5372d3e 



cleonello 98f5de9 
cleonello e22d3fb 
cleonello 98f5de9 

Chris Leonello 5372d3e 
Chris Leonello 81ccd33 

Chris Leonello 1517e56 
Chris Leonello 5372d3e 












Chris Leonello f439201 











Chris Leonello 5372d3e 













Chris Leonello 81ccd33 
cleonello 7414f23 
cleonello 4ccbfbf 

























cleonello 7414f23 

cleonello 9463bae 
cleonello dba4d91 
cleonello 7414f23 
cleonello 4b41340 
cleonello 7414f23 

cleonello 4b41340 
cleonello 7414f23 


Chris Leonello 81ccd33 
Chris Leonello 1517e56 
Chris Leonello f439201 
Chris Leonello 2cfa244 


















cleonello 4ccbfbf 





Chris Leonello 81ccd33 


Chris Leonello f235718 
Chris Leonello 0e897f3 
cleonello 9692a88 

Chris Leonello 2cfa244 



cleonello 9692a88 
Chris Leonello 2cfa244 









cleonello db0781a 






cleonello 98f5de9 
cleonello db0781a 


Chris Leonello f235718 
cleonello 9692a88 

Chris Leonello 2cfa244 
Chris Leonello 81ccd33 

Chris Leonello 1517e56 
Chris Leonello 0e897f3 

cleonello 4ccbfbf 
Chris Leonello 81ccd33 

cleonello 9692a88 
Chris Leonello 81ccd33 


<project name="jqPlot" default="all" basedir=".">
    
    <!-- directories for building -->
    <property description="Source directory" name="SRC_DIR" value="src"  />
    <property description="Build, work, temporary directory" name="BUILD_DIR" value="build" />
    <property description="Directory for distributable files" name="DIST_DIR" value="dist" />
    <property description="Directory for web site files" name="WEB_DIR" value="web" />

    <!-- Files names for distribution -->
    <property name="JQPLOT" value="jquery.jqplot.js" />
	  <loadfile property="version" srcfile="version.txt" /> 
	  <property file="dist.props" />
	  
	  <!-- misc. properties -->
    <property description="YUICompressor" name="YUICompressor" value="extras/yuicompressor-2.4.2.jar" />
	  <loadfile description="Version to build" property="version" srcfile="version.txt" />
	  <loadfile description="Copyright and license" property="copyright" srcfile="copyright.txt" />
	  <property description="NaturalDocs" name="ND" value="extras/NaturalDocs/NaturalDocs" />

    <!-- MAIN -->
    
    <target name="build" description="create and populate build area for making distribution">
        <echo message="Building jqPlot" />
        <mkdir dir="${BUILD_DIR}" />
        <mkdir dir="${BUILD_DIR}/plugins" />
        <mkdir dir="${BUILD_DIR}/images" />
        
        <!-- stip out top level closures, concat everything, and wrap in a closure. -->
        <!-- copy all needed files from src to build -->
        <copy todir="${BUILD_DIR}">
          <fileset dir="${SRC_DIR}">
            <include name="*" />
            <exclude name="jquery.jqplot.js" />
            <exclude name="jsl.conf" />
          </fileset>
        </copy>
        <copy todir="${BUILD_DIR}/images">
          <fileset dir="${SRC_DIR}/images">
          </fileset>
        </copy>
        <replace file="${BUILD_DIR}/jqPlotOptions.txt" token="{{{" value="(code)" />
        <replace file="${BUILD_DIR}/jqPlotOptions.txt" token="}}}" value="(end)" />
        <replaceregexp match="@VERSION" replace="${version}" file="${BUILD_DIR}/jqplot.core.js" />
        <copy todir="${BUILD_DIR}/plugins">
          <fileset dir="${SRC_DIR}/plugins" includes="*" />
        </copy>
                
        <!-- remove appropriate opening and closing of closures -->
        <replaceregexp match=".*?\(function\(\$\) \{" replace="" flags="s">
          <fileset dir="${BUILD_DIR}">
            <include name="jqplot.*.js" />
            <exclude name="jqplot.core.js" />
          </fileset>
        </replaceregexp>
        <replaceregexp match="\}\)\(jQuery\)\;(?!.*\}\)\(jQuery\)\;)" replace="">
          <fileset dir="${BUILD_DIR}">
            <include name="jqplot.*.js" />
            <exclude name="jqplot.sprintf.js" />
          </fileset>
        </replaceregexp>
        
        <!-- now cat all files together to make one jqplot source file -->
        <concat destfile="${BUILD_DIR}/${JQPLOT}">
            <fileset dir="${BUILD_DIR}" includes="jqplot.core.js" />
            <fileset dir="${BUILD_DIR}">
              <include name="jqplot.*.js" />
              <exclude name="jqplot.core.js" />
              <exclude name="jqplot.sprintf.js" />
            </fileset>
            <fileset dir="${BUILD_DIR}" includes="jqplot.sprintf.js" />
        </concat>
        
    </target>

    <target name="dist" depends="build" description="Build uncompressed jqplot for creating distributions and web site.">
        <echo message="Creating jqPlot distribution" />
        
        <mkdir dir="${DIST_DIR}" />
        <mkdir dir="${DIST_DIR}/plugins" />
        <mkdir dir="${DIST_DIR}/images" />
        
        <!-- now copy files to dist dir. -->
        <copy todir="${DIST_DIR}">
          <fileset dir="${BUILD_DIR}" includes="${JQPLOT}" />
          <fileset dir="${BUILD_DIR}" includes="jquery.jqplot.css" />
          <fileset dir="${BUILD_DIR}" includes="excanvas.js" />
          <fileset dir="${BUILD_DIR}" includes="excanvas.min.js" />
          <fileset dir="" includes="*.php" />
          <fileset dir="" includes="style.css" />
          <fileset dir="" includes="README.txt" />
          <fileset dir="" includes="copyright.txt" />
          <fileset dir="" includes="test*.html" />
          <fileset dir="${SRC_DIR}" includes="*.txt" />
          <fileset dir="tests" includes="jquery*.js" />
        </copy>
        
        <replaceregexp match='src="\./src/' replace='src="\./' flags="g">
          <fileset dir="${DIST_DIR}" includes="test*.html" />
        </replaceregexp>
        
        <replaceregexp match='href="\./src/' replace='href="\./' flags="g">
          <fileset dir="${DIST_DIR}" includes="test*.html" />
        </replaceregexp>
        
        <copy todir="${DIST_DIR}/plugins">
          <fileset dir="${BUILD_DIR}/plugins" includes="*" />
        </copy>
        
        <copy todir="${DIST_DIR}/images">
          <fileset dir="./images" includes="*.jpg *.png" />
        </copy>
        
        <echo message="jqPlot built." />
    </target>

    <target name="min" depends="dist" description="Minify sources with YUI compressor.">
        <echo message="Building minified sources with YUI Compressor" />
    		<apply executable="java" parallel="false" verbose="true" dest="${DIST_DIR}">
    			<fileset dir="${DIST_DIR}">
    				<include name="jquery.jqplot.js" />
    			</fileset>
    			<arg line="-jar" />
    			<arg path="${YUICompressor}" />
    			<arg value="--charset" />
    			<arg value="ANSI" />
    			<arg value="-o" />
    			<targetfile />
    			<mapper type="glob" from="jquery.jqplot.js" to="jquery.jqplot.min.js" />
    		</apply>
    		<apply executable="java" parallel="false" verbose="true" dest="${DIST_DIR}">
    			<fileset dir="${DIST_DIR}">
    				<include name="jquery.jqplot.css" />
    			</fileset>
    			<arg line="-jar" />
    			<arg path="${YUICompressor}" />
    			<arg value="--charset" />
    			<arg value="ANSI" />
    			<arg value="-o" />
    			<targetfile />
    			<mapper type="glob" from="jquery.jqplot.css" to="jquery.jqplot.min.css" />
    		</apply>
    		<apply executable="java" parallel="false" verbose="true" dest="${DIST_DIR}/plugins">
    			<fileset dir="${DIST_DIR}/plugins">
    				<include name="jqplot.*.js" />
    				<exclude name="jqplot.*.min.js" />
    			</fileset>
    			<arg line="-jar" />
    			<arg path="${YUICompressor}" />
    			<arg value="--charset" />
    			<arg value="ANSI" />
    			<arg value="-o" />
    			<targetfile />
    			<mapper type="glob" from="jqplot.*.js" to="jqplot.*.min.js" />
    		</apply>
        <echo message="Minified sources built." />
    </target>
    
    <target name="web" depends="dist, min, docs, tests" description="Create jqPlot.com web site">
        <echo message="Building web site" />
        <mkdir dir="${WEB_DIR}" />
        <copy todir="${WEB_DIR}">
          <fileset dir="${DIST_DIR}">
            <include name="jquery*.js" />
            <include name="jquery.jqplot*.css" />
            <include name="excanvas*.js" />
            <include name="*.php" />
            <include name="style.css" />
          </fileset>
        </copy>
        <copy todir="${WEB_DIR}/images">
          <fileset dir="${DIST_DIR}/images"/>
        </copy>
        <copy todir="${WEB_DIR}/docs">
          <fileset dir="${DIST_DIR}/docs"/>
        </copy>
        <copy todir="${WEB_DIR}/tests">
          <fileset dir="${DIST_DIR}/tests"/>
        </copy>
        <copy todir="${WEB_DIR}/plugins">
          <fileset dir="${DIST_DIR}/plugins"/>
        </copy>
    </target>
    
  <target name="compress" depends="dist" description="Create the zip, gzip, and bzip compressed archives for downloading">
      <zip destfile="${DIST_DIR}/jquery.jqplot.${version}.zip"
       basedir=""
       includes="${DIST_DIR}/excanvas*.js ${DIST_DIR}/jquery*.min.js ${DIST_DIR}/jquery.jqplot.* ${DIST_DIR}/*.txt ${DIST_DIR}/plugins/* ${DIST_DIR}/test*.html"
      />
      <tar destfile="${DIST_DIR}/jquery.jqplot.${version}.tar.gz" compression="gzip">
          <zipfileset src="${DIST_DIR}/jquery.jqplot.${version}.zip"/>
      </tar>
      <tar destfile="${DIST_DIR}/jquery.jqplot.${version}.tar.bz2" compression="bzip2">
          <zipfileset src="${DIST_DIR}/jquery.jqplot.${version}.zip"/>
      </tar>
  </target>

	<target name="tests" depends="dist" description="Create test suite for distribution.">
		<echo message="Creating test suite for distribtion" />
        <mkdir dir="${DIST_DIR}/tests" />
        <copy todir="${DIST_DIR}/tests">
          <fileset dir="tests" includes="*" />
        </copy>
        <copy todir="${DIST_DIR}/tests/jspec/lib">
          <fileset dir="tests/jspec/lib" includes="jspec.min.*" />
        </copy>
        <copy todir="${DIST_DIR}/tests/jspec/lib/images">
          <fileset dir="tests/jspec/lib/images" includes="*" />
        </copy>
        <copy todir="${DIST_DIR}/tests/images">
          <fileset dir="tests/images" includes="*" />
        </copy>
        <replaceregexp match="\.\./src/" replace="\.\./" flags="g">
          <fileset dir="${DIST_DIR}/tests">
            <include name="*.php" />
            <include name="*.html" />
          </fileset>
        </replaceregexp>
        <replaceregexp match="jqplot\.(\w+)\.js" replace="jqplot.\1.min.js" flags="g">
          <fileset dir="${DIST_DIR}/tests" includes="*.php" />
        </replaceregexp>
        <replaceregexp match="jquery.jqplot.js" replace="jquery.jqplot.min.js">
          <fileset dir="${DIST_DIR}/tests" includes="opener.php" />
        </replaceregexp>
		<echo message="Test Suite Finished" />
	</target>

	<target name="docs" description="Create documentation for distribution.">
		<echo message="Creating documentation" />
		  <!-- don't want to process jquery itself -->
		    <move file="${BUILD_DIR}/jquery-1.3.2.js" tofile="${BUILD_DIR}/jquery-1.3.2.js.bak" />
        <mkdir dir="${DIST_DIR}/docs" />
        <exec executable="${ND}">
          <arg value="-r" />
          <arg value="-i" />
          <arg path="${BUILD_DIR}" />
          <arg line="-o HTML " />
          <arg path="dist/docs" />
          <arg value="-p" />
          <arg path="NDdata/" />
          <arg line="-s Default docstyles" />
        </exec>
        <replaceregexp match="@VERSION" replace="${version}" flags="g">
          <fileset dir="${DIST_DIR}/docs/index" includes="*.html" />
          <fileset dir="${DIST_DIR}/docs/files" includes="*.html" />
        </replaceregexp>
        <replace dir="${DIST_DIR}/docs/index" token="${logoDivToken}" value="${logoDivValue}" />
        <replace dir="${DIST_DIR}/docs/files" token="${logoDivToken}" value="${logoDivValue}" />
        <replace dir="${DIST_DIR}/docs/search" token="${logoDivToken}" value="${logoDivValue}" />
        <replace dir="${DIST_DIR}/docs/files" token="${h1Token}" value="${h1Value}" />
        <replace dir="${DIST_DIR}/docs/files/plugins" token="${h1Token}" value="${h1Value}" />
        <replace dir="${DIST_DIR}/docs/files" token="${h1CloseToken}" value="${h1CloseValue}" />
        <replace dir="${DIST_DIR}/docs/files/plugins" token="${h1CloseToken}" value="${h1CloseValue}" />

        <copy todir="${DIST_DIR}/docs/files/images">
          <fileset dir="${SRC_DIR}/images" includes="*.jpg" />
          <fileset dir="${SRC_DIR}/images" includes="*.png" />
    		</copy>
    		<!-- put jquery back the way it was -->
		    <move file="${BUILD_DIR}/jquery-1.3.2.js.bak" tofile="${BUILD_DIR}/jquery-1.3.2.js" />
        <echo message="Documentation Finished" />
	</target>

    <target name="clean" description="Clean up, removing build and distribution directories and everything underneath.">
        <delete dir="${BUILD_DIR}" />
        <delete dir="${DIST_DIR}" />
        <delete dir="${WEB_DIR}" />
    </target>

    <target name="all" depends="clean, build, dist, min, compress, tests, docs, web" description="Clean then build everything (distribution, minify, tests and docs).">
        <echo message="Build complete distribution, docs and tests" />
    </target>

</project>
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.