James Moger
2011-06-09 24d08fb7bef89584e0ea39e55aba9fb92bc500e3
build.xml
@@ -6,9 +6,12 @@
   <property name="project.mainclass" value="com.gitblit.Launcher" />
   <property name="project.build.dir" value="${basedir}/build" />
   <target name="main">
   <loadproperties srcfile="${basedir}/build.properties" />
      <!-- build dsate -->
   <!-- Build Gitblit -->
   <target name="main" description="Compiles Gitblit from source to website">
      <!-- build date -->
      <tstamp>
         <format property="gb.buildDate" pattern="yyyy-MM-dd" />
      </tstamp>
@@ -25,7 +28,7 @@
               <replacestring from="&quot;;" to="" />
               <trim />
            </tokenfilter>
         </filterchain>
         </filterchain>
      </loadfile>
      <!-- extract JGit version number from source code -->
@@ -70,7 +73,7 @@
            <include name="*.jar" />
         </fileset>
      </path>
      <javac destdir="${project.build.dir}">
      <javac destdir="${project.build.dir}" failonerror="false">
         <src path="${basedir}/src" />
         <classpath refid="master-classpath" />
      </javac>
@@ -88,36 +91,6 @@
            <attribute name="Main-Class" value="${project.mainclass}" />
         </manifest>
      </jar>
      <!-- Delete the deploy folder -->
      <delete dir="${basedir}/deploy" />
      <!-- Create deployment folder structure -->
      <mkdir dir="${basedir}/deploy" />
      <copy todir="${basedir}/deploy" file="${project.jar}" />
      <copy todir="${basedir}/deploy">
         <fileset dir="${basedir}/distrib">
            <include name="**/*" />
         </fileset>
      </copy>
      <!-- Create Zip deployment -->
      <property name="distribution.zipfile" value="gitblit-${gb.version}.zip" />
      <zip destfile="${distribution.zipfile}">
         <fileset dir="${basedir}/deploy">
            <include name="**/*" />
         </fileset>
      </zip>
      <!-- Delete the deploy folder -->
      <delete dir="${basedir}/deploy" />
      <!-- Cleanup builds -->
      <delete>
         <fileset dir="${basedir}">
            <include name="${project.jar}" />
         </fileset>
      </delete>
      <!-- Build Site -->
      <delete dir="${basedir}/site" />
@@ -154,13 +127,27 @@
         </fileset>
      </copy>
      <!-- Copy screenshot thumbnails -->
      <mkdir dir="${basedir}/site/thumbs" />
      <copy todir="${basedir}/site/thumbs">
         <fileset dir="${basedir}/docs/screenshots/thumbs">
            <include name="*.png" />
      <!-- Copy google-code-prettify -->
      <mkdir dir="${basedir}/src/com/gitblit/wicket/pages/prettify" />
      <copy todir="${basedir}/site/prettify">
         <fileset dir="${basedir}/src/com/gitblit/wicket/pages/prettify">
            <exclude name="thumbs.db" />
         </fileset>
      </copy>
      <!-- Generate thumbnails of screenshots -->
      <java classpath="${project.build.dir}" classname="com.gitblit.Thumbnailer">
         <classpath refid="master-classpath" />
         <arg value="--sourceFolder" />
         <arg value="${basedir}/docs/screenshots" />
         <arg value="--destinationFolder" />
         <arg value="${basedir}/site/thumbs" />
         <arg value="--maximumDimension" />
         <arg value="250" />
      </java>
      <!-- Copy screenshots -->
      <mkdir dir="${basedir}/site/screenshots" />
@@ -180,13 +167,16 @@
         <arg value="${basedir}/site" />
         <arg value="--pageHeader" />
         <arg value="${basedir}/docs/page_header.html" />
         <arg value="${basedir}/docs/site_header.html" />
         <arg value="--pageFooter" />
         <arg value="${basedir}/docs/page_footer.html" />
         <arg value="${basedir}/docs/site_footer.html" />
         <arg value="--alias" />
         <arg value="index=overview" />
         <arg value="--alias" />
         <arg value="properties=gitblit.properties" />
         <arg value="--substitute" />
         <arg value="%VERSION%=${gb.version}" />
@@ -199,9 +189,140 @@
         <arg value="--substitute" />
         <arg value="%JGIT%=${jgit.version}" />
         <arg value="--load" />
         <arg value="%PROPERTIES%=${basedir}/distrib/gitblit.properties" />
      </java>
      <!-- Cleanup -->
      <!-- Delete the deploy folder -->
      <delete dir="${basedir}/deploy" />
      <!-- Create deployment folder structure -->
      <mkdir dir="${basedir}/deploy" />
      <copy todir="${basedir}/deploy" file="${project.jar}" />
      <copy todir="${basedir}/deploy">
         <fileset dir="${basedir}/distrib">
            <include name="**/*" />
         </fileset>
      </copy>
      <!-- Build Deployment Docs -->
      <mkdir dir="${basedir}/deploy/docs" />
      <copy todir="${basedir}/deploy/docs">
         <!-- Copy selected Gitblit resources -->
         <fileset dir="${basedir}/src/com/gitblit/wicket/resources">
            <include name="background.png" />
            <include name="gitblit.css" />
            <include name="markdown.css" />
            <include name="gitblt_25.png" />
            <include name="gitblt-favicon.png" />
            <include name="lock_go_16x16.png" />
            <include name="lock_pull_16x16.png" />
            <include name="shield_16x16.png" />
            <include name="cold_16x16.png" />
            <include name="bug_16x16.png" />
            <include name="book_16x16.png" />
            <include name="blank.png" />
         </fileset>
         <!-- Copy Doc images -->
         <fileset dir="${basedir}/docs">
            <include name="*.png" />
         </fileset>
      </copy>
      <!-- Copy google-code-prettify -->
      <mkdir dir="${basedir}/src/com/gitblit/wicket/pages/prettify" />
      <copy todir="${basedir}/deploy/docs/prettify">
         <fileset dir="${basedir}/src/com/gitblit/wicket/pages/prettify">
            <exclude name="thumbs.db" />
         </fileset>
      </copy>
      <!-- Build deployment doc pages -->
      <java classpath="${project.build.dir}" classname="com.gitblit.BuildSite">
         <classpath refid="master-classpath" />
         <arg value="--sourceFolder" />
         <arg value="${basedir}/docs" />
         <arg value="--outputFolder" />
         <arg value="${basedir}/deploy/docs" />
         <arg value="--pageHeader" />
         <arg value="${basedir}/docs/page_header.html" />
         <arg value="--pageFooter" />
         <arg value="${basedir}/docs/page_footer.html" />
         <arg value="--skip" />
         <arg value="screenshots" />
         <arg value="--skip" />
         <arg value="releases" />
         <arg value="--alias" />
         <arg value="index=overview" />
         <arg value="--alias" />
         <arg value="properties=gitblit.properties" />
         <arg value="--substitute" />
         <arg value="%VERSION%=${gb.version}" />
         <arg value="--substitute" />
         <arg value="%DISTRIBUTION%=${distribution.zipfile}" />
         <arg value="--substitute" />
         <arg value="%BUILDDATE%=${gb.buildDate}" />
         <arg value="--substitute" />
         <arg value="%JGIT%=${jgit.version}" />
         <arg value="--load" />
         <arg value="%PROPERTIES%=${basedir}/distrib/gitblit.properties" />
      </java>
      <!-- Create Zip deployment -->
      <property name="distribution.zipfile" value="gitblit-${gb.version}.zip" />
      <zip destfile="${distribution.zipfile}">
         <fileset dir="${basedir}/deploy">
            <include name="**/*" />
         </fileset>
      </zip>
      <!-- Delete the deploy folder -->
      <delete dir="${basedir}/deploy" />
      <!-- Cleanup builds -->
      <delete>
         <fileset dir="${basedir}">
            <include name="${project.jar}" />
         </fileset>
      </delete>
      <!-- Cleanup -->
      <delete dir="${project.build.dir}" />
   </target>
   <!-- Publish site to hosting service -->
   <!-- You must add ext/commons-net-1.4.0.jar to your   ANT classpath. -->
   <target name="publishSite" description="Publish the Gitblit site to a webserver (requires ext/commons-net-1.4.0.jar)">
      <ftp server="${ftp.server}"
         userid="${ftp.user}"
         password="${ftp.password}"
         remotedir="${ftp.dir}"
         passive="true"
         verbose="yes">
      <fileset dir="${basedir}/site" />
      </ftp>
   </target>
   <!-- Publish distribution to github -->
   <target name="publishDistribution" description="Publish the Gitblit distribution to Github">
      <!-- TODO -->
      <!-- https://github.com/oyvindkinsey/GitHubUploadTask -->
   </target>
</project>