James Moger
2014-06-09 a755c76d9a035bc9cf9ca82ff1b8541d6711c635
build.xml
@@ -8,7 +8,7 @@
      documentation @ http://gitblit.github.io/moxie
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   -->
   <property name="moxie.version" value="0.9.1" />
   <property name="moxie.version" value="0.9.2" />
   <property name="moxie.url" value="http://gitblit.github.io/moxie/maven" />
   <property name="moxie.jar" value="moxie-toolkit-${moxie.version}.jar" />
   <property name="moxie.dir" value="${user.home}/.moxie" />
@@ -48,11 +48,10 @@
      <property name="manager.zipfile" value="manager-${project.version}.zip" />
      <property name="authority.zipfile" value="authority-${project.version}.zip" />
      <property name="gbapi.zipfile" value="gbapi-${project.version}.zip" />
      <property name="express.zipfile" value="express-${project.version}.zip" />
      <property name="maven.directory" value="${basedir}/../gitblit-maven" />
      <!-- Download links -->
      <property name="gc.url" value="http://dl.bintray.com/jamesmoger/generic/" />
      <property name="gc.url" value="http://dl.bintray.com/gitblit/releases/" />
   </target>
   
@@ -175,7 +174,18 @@
      <property name="go.dir" value="${project.outputDirectory}/go" />   
      <delete dir="${go.dir}" />
      <local name="webinf" />
      <property name="webinf" value="${project.compileOutputDirectory}/WEB-INF" />
      <prepareDataDirectory toDir="${go.dir}/data" />
      <!-- Copy the web.xml from the prototype web.xml -->
      <copy todir="${webinf}" overwrite="true">
         <fileset file="${project.src.dir}/WEB-INF/web.xml" />
         <filterset>
            <filter token="gb.version" value="${project.version}" />
         </filterset>
      </copy>
      
      <!-- Build jar -->
      <mx:jar destfile="${go.dir}/gitblit.jar" includeresources="true">
@@ -241,10 +251,13 @@
      <!-- Prepare the data directory -->
      <prepareDataDirectory toDir="${webinf}/data" />
      <!-- Build the WAR web.xml from the prototype web.xml -->
      <mx:webxml sourcefile="${project.src.dir}/WEB-INF/web.xml" destfile="${webinf}/web.xml">
         <replace token="@gb.version@" value="${project.version}" />
      </mx:webxml>
      <!-- Copy the web.xml from the prototype web.xml -->
      <copy todir="${webinf}" overwrite="true">
         <fileset file="${project.src.dir}/WEB-INF/web.xml" />
         <filterset>
            <filter token="gb.version" value="${project.version}" />
         </filterset>
      </copy>
      <!-- Gitblit jar -->
      <mx:jar destfile="${webinf}/lib/gitblit.jar" includeresources="false" />
@@ -306,61 +319,6 @@
      <!-- Cleanup -->
      <delete file="${project.targetDirectory}/fedclient.jar" />
      
   </target>
   <!--
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      Build a Gitblit filesystem for deployment to RedHat OpenShift Express
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   -->
   <target name="buildExpress" depends="compile" description="Build exploded WAR file suitable for deployment to OpenShift Express">
      <echo>Building Gitblit Express for RedHat OpenShift ${project.version}</echo>
      <local name="express.dir" />
      <property name="express.dir" value="${project.outputDirectory}/express" />
      <delete dir="${express.dir}" />
      <!-- Create the OpenShift filesystem -->
      <local name="deployments.root" />
      <property name="deployments.root" value="${express.dir}/deployments/ROOT.war"/>
      <mkdir dir="${deployments.root}" />
      <touch file="${express.dir}/deployments/ROOT.war.dodeploy" />
      <local name="webinf" />
      <property name="webinf" value="${deployments.root}/WEB-INF" />
      <!-- Prepare the data directory -->
      <prepareDataDirectory toDir="${webinf}/data" />
      <!-- Build the Express web.xml from the prototype web.xml and gitblit.properties -->
      <!-- THIS FILE IS NOT OVERRIDDEN ONCE IT IS BUILT!!! -->
      <mx:webxml sourcefile="${project.src.dir}/WEB-INF/web.xml" destfile="${webinf}/web.xml"
         propertiesFile="${project.distrib.dir}/data/gitblit.properties"
         skip="server.*">
         <replace token="@gb.version@" value="${project.version}" />
      </mx:webxml>
      <!-- Gitblit classes -->
      <mx:jar destfile="${webinf}/lib/gitblit.jar" includeresources="false" />
      <!-- Build Express Zip file -->
      <mx:zip basedir="${express.dir}" destfile="${project.targetDirectory}/${express.zipfile}">
         <fileset dir="${basedir}">
            <include name="LICENSE" />
            <include name="NOTICE" />
         </fileset>
         <!-- README -->
         <zipfileset fullpath="README.gitblit" file="${project.siteSourceDirectory}/openshift.mkd" />
         <!-- resources -->
         <zipfileset prefix="deployments/ROOT.war" dir="${project.resources.dir}">
            <exclude name="thumbs.db" />
            <exclude name="*.mkd" />
         </zipfileset>
         <!-- include "war" tagged dependencies -->
         <dependencies prefix="deployments/ROOT.war/WEB-INF/lib" tag="war" />
      </mx:zip>
   </target>
@@ -542,11 +500,6 @@
                  <page name="upgrade WAR" src="upgrade_war.mkd" />
               </menu>
               <divider />
               <menu name="Gitblit Express" pager="true" pagerPlacement="bottom" pagerLayout="justified">
                  <page name="setup Express" src="setup_express.mkd" />
                  <page name="upgrade Express" src="upgrade_express.mkd" />
               </menu>
               <divider />
               <menu name="Server Configuration" pager="true" pagerPlacement="bottom" pagerLayout="justified">
                  <page name="administration" src="administration.mkd" />
                  <page name="authentication" src="setup_authentication.mkd" />
@@ -567,14 +520,19 @@
                  <page name="using the Eclipse plugin" src="eclipse_plugin.mkd" />
               </menu>
               <divider />
               <menu name="Tickets" pager="true" pagerPlacement="bottom" pagerLayout="justified">
                 <page name="overview" src="tickets_overview.mkd" />
                 <page name="using" src="tickets_using.mkd" />
                 <page name="barnum" src="tickets_barnum.mkd" />
               <menu name="Tickets" pager="true" pagerPlacement="bottom" pagerLayout="justified">
                 <page name="overview" src="tickets_overview.mkd" />
                 <page name="using" src="tickets_using.mkd" />
                 <page name="barnum" src="tickets_barnum.mkd" />
                 <page name="setup" src="tickets_setup.mkd" />
                 <page name="replication &amp; advanced administration" src="tickets_replication.mkd" />
               </menu>
               <divider />
                 <page name="replication &amp; advanced administration" src="tickets_replication.mkd" />
               </menu>
               <divider />
               <menu name="Plugins" pager="true" pagerPlacement="bottom" pagerLayout="justified">
                 <page name="overview" src="plugins_overview.mkd" />
                 <page name="extension points" src="plugins_extensions.mkd" />
               </menu>
               <divider />
               <page name="federation" src="federation.mkd" />
               <divider />
               <page name="settings" src="properties.mkd" />
@@ -599,24 +557,24 @@
               <link name="Gitblit GO (Windows)" src="${gc.url}gitblit-${project.releaseVersion}.zip" />
               <link name="Gitblit GO (Linux/OSX)" src="${gc.url}gitblit-${project.releaseVersion}.tar.gz" />
               <link name="Gitblit WAR" src="${gc.url}gitblit-${project.releaseVersion}.war" />
               <link name="Gitblit Express" src="${gc.url}express-${project.releaseVersion}.zip" />
               <divider />
               <link name="Gitblit GO (Docker)" src="https://registry.hub.docker.com/u/jmoger/gitblit/" />
               <divider />
               <link name="Gitblit Manager" src="${gc.url}manager-${project.releaseVersion}.zip" />
               <link name="Federation Client" src="${gc.url}fedclient-${project.releaseVersion}.zip" />
               <divider />
               <link name="API Library" src="${gc.url}gbapi-${project.releaseVersion}.zip" />
               <divider />
               <link name="Bintray (1.4.0+)" src="https://bintray.com/jamesmoger/generic/Gitblit" />
               <link name="Bintray (1.4.0+)" src="https://bintray.com/gitblit/releases/gitblit" />
               <link name="GoogleCode (pre-1.4.0)" src="https://code.google.com/p/gitblit/downloads/list?can=1" />
               <divider />
               <link name="Maven Repository" src="${project.mavenUrl}" />
            </menu>
            
            <menu name="links">
               <link name="Gitblit Demo (RELEASE)" src="https://demo-gitblit.rhcloud.com" />
               <link name="Gitblit Next (SNAPSHOT)" src="https://next-gitblit.rhcloud.com" />
               <link name="dev.gitblit.com (self-hosted)" src="https://dev.gitblit.com" />
               <divider />
               <link name="Gitblit (Self-Hosted)" src="https://dev.gitblit.com" />
               <link name="Plugin Registry" src="http://plugins.gitblit.com" />
               <divider />
               <link name="Github" src="${project.scmUrl}" />
               <link name="Issues" src="${project.issuesUrl}" />
@@ -700,7 +658,7 @@
      Build all binaries and site
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   -->
   <target name="buildAll" depends="buildGO,buildWAR,buildExpress,buildFederationClient,buildManager,buildApiLibrary,buildSite" />
   <target name="buildAll" depends="buildGO,buildWAR,buildFederationClient,buildManager,buildApiLibrary,buildSite" />
   
   <!--
@@ -752,11 +710,6 @@
      <bintrayUpload
         source="${project.targetDirectory}/${gbapi.zipfile}" 
         target="gbapi-${project.version}.zip" />
      <!-- Upload Gitblit Express for RedHat OpenShift -->
      <bintrayUpload
         source="${project.targetDirectory}/${express.zipfile}"
         target="express-${project.version}.zip" />
   </target>
@@ -859,11 +812,6 @@
                     <page name="upgrade WAR" src="upgrade_war.mkd" />
                  </menu>
                  <divider />
                  <menu name="Gitblit Express" pager="true" pagerPlacement="bottom" pagerLayout="justified">
                     <page name="setup Express" src="setup_express.mkd" />
                     <page name="upgrade Express" src="upgrade_express.mkd" />
                  </menu>
                  <divider />
                  <menu name="Server Configuration" pager="true" pagerPlacement="bottom" pagerLayout="justified">
                     <page name="administration" src="administration.mkd" />
                     <page name="authentication" src="setup_authentication.mkd" />
@@ -884,14 +832,19 @@
                     <page name="using the Eclipse plugin" src="eclipse_plugin.mkd" />
                  </menu>
                  <divider />
                  <menu name="Tickets" pager="true" pagerPlacement="bottom" pagerLayout="justified">
                     <page name="overview" src="tickets_overview.mkd" />
                     <page name="using" src="tickets_using.mkd" />
                     <page name="barnum" src="tickets_barnum.mkd" />
                     <page name="setup" src="tickets_setup.mkd" />
                  <menu name="Tickets" pager="true" pagerPlacement="bottom" pagerLayout="justified">
                     <page name="overview" src="tickets_overview.mkd" />
                     <page name="using" src="tickets_using.mkd" />
                     <page name="barnum" src="tickets_barnum.mkd" />
                     <page name="setup" src="tickets_setup.mkd" />
                     <page name="replication &amp; advanced administration" src="tickets_replication.mkd" />
                  </menu>
                  <divider />
                  </menu>
                  <divider />
                  <menu name="Plugins" pager="true" pagerPlacement="bottom" pagerLayout="justified">
                    <page name="overview" src="plugins_overview.mkd" />
                    <page name="extension points" src="plugins_extensions.mkd" />
                  </menu>
                  <divider />
                  <page name="federation" src="federation.mkd" />
                  <divider />
                  <page name="settings" src="properties.mkd" />
@@ -905,8 +858,9 @@
                  <page name="older releases" src="releasehistory.mkd" />
               </menu>
               <menu name="links">
                  <link name="Gitblit Demo (RELEASE)" src="https://demo-gitblit.rhcloud.com" />
                  <link name="Gitbilt Next (SNAPSHOT)" src="https://next-gitblit.rhcloud.com" />
                  <link name="dev.gitblit.com (self-hosted)" src="https://dev.gitblit.com" />
                  <divider />
                  <link name="Plugin Registry" src="http://plugins.gitblit.com" />
                  <divider />
                  <link name="Github" src="${project.scmUrl}" />
                  <link name="Issues" src="${project.issuesUrl}" />
@@ -981,6 +935,12 @@
               <include name="subgit.groovy" />
            </fileset>
         </copy>
         <mkdir dir="@{toDir}/gitignore" />
         <copy todir="@{toDir}/gitignore">
            <fileset dir="${project.distrib.dir}/data/gitignore">
               <include name="*.gitignore" />
            </fileset>
         </copy>
      </sequential>
   </macrodef>
   
@@ -995,7 +955,7 @@
      <sequential>
         <echo>uploading @{source} to Bintray</echo>
         <exec executable="curl">
            <arg line="--silent --show-error -T @{source} -u${bintray.username}:${bintray.apikey} https://api.bintray.com/content/${bintray.username}/generic/${project.name}/${project.version}/@{target}"></arg>
            <arg line="--silent --show-error -T @{source} -u${bintray.username}:${bintray.apikey} https://api.bintray.com/content/gitblit/releases/gitblit/${project.version}/@{target}"></arg>
         </exec>
      </sequential>
   </macrodef>
@@ -1007,13 +967,23 @@
   -->
   <target name="installMaven" depends="compile" description="Install Gitblit JAR as Maven module">
      <local name="project.jar" />
      <property name="project.jar" value="${project.outputDirectory}/gitblit.jar" />
      <property name="project.jar" value="${project.outputDirectory}/${project.artifactId}.jar" />
      <property name="resourceFolderPrefix" value="" />
      <mx:jar destfile="${project.jar}" includeresources="true" resourceFolderPrefix="${resourceFolderPrefix}" />
      <mx:jar destfile="${project.jar}" packageSources="true" includeresources="true" resourceFolderPrefix="${resourceFolderPrefix}" />
      <!-- Install Binary jar -->
      <exec executable="mvn">
         <arg value="install:install-file" />
         <arg value="-Dfile=${project.jar}" />
         <arg value="-DpomFile=${basedir}/pom.xml" />
         <arg value="-DcreateChecksum=true" />
      </exec>
      <!-- Install Sources  jar -->
      <exec executable="mvn">
         <arg value="install:install-file" />
         <arg value="-Dfile=${project.outputDirectory}/${project.artifactId}-sources.jar" />
         <arg value="-Dclassifier=sources" />
         <arg value="-DpomFile=${basedir}/pom.xml" />
         <arg value="-DcreateChecksum=true" />
      </exec>
@@ -1031,7 +1001,7 @@
   <target name="uploadMaven" depends="compile" description="Upload Gitblit JAR to remote Maven repository">
      <local name="project.jar" />
      <property name="project.jar" value="${project.outputDirectory}/gitblit.jar" />
      <mx:jar destfile="${project.jar}" includeresources="true" />
      <mx:jar destfile="${project.jar}" packageSources="true" includeresources="true" />
      <exec executable="mvn">
         <arg value="deploy:deploy-file" />
@@ -1042,5 +1012,19 @@
         <arg value="-DcreateChecksum=true" />
      </exec>
   </target>
   <!--
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      Install Gitblit JAR for usage as Moxie artifact
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   -->
   <target name="installMoxie" depends="compile" description="Install Gitblit JAR as a Moxie artifact">
      <local name="project.jar" />
      <property name="project.jar" value="${project.targetDirectory}/${project.artifactId}-${project.version}.jar" />
      <property name="resourceFolderPrefix" value="" />
      <mx:jar destfile="${project.jar}" packageSources="true" includeresources="true" resourceFolderPrefix="${resourceFolderPrefix}" />
      <mx:install />
   </target>
   
</project>