diff options
author | James Moger <james.moger@gitblit.com> | 2013-03-27 12:46:05 -0400 |
---|---|---|
committer | James Moger <james.moger@gitblit.com> | 2013-03-27 17:22:08 -0400 |
commit | f6b200be4c8b90c26886c6cdd5809abac8c4ac15 (patch) | |
tree | a948dbcf6f24bf884ad95a8d6830b4ec4e1706cf /build.xml | |
parent | b79ade104858ce6714a7329b7629b331564a2ea5 (diff) | |
download | gitblit-f6b200be4c8b90c26886c6cdd5809abac8c4ac15.tar.gz gitblit-f6b200be4c8b90c26886c6cdd5809abac8c4ac15.zip |
Reorganized to Apache Standard Directory Layout & integrated Moxie
This is a massive commit which reorganizes the entire project structure
(although it is still monolithic), removes the Build classes, and
switches to Moxie, a smarter Ant build tookit based on the original
Gitblit Build classes.
The Ant build script will likely require additional fine-tuning, but
this is big step forward.
Diffstat (limited to 'build.xml')
-rw-r--r-- | build.xml | 1661 |
1 files changed, 681 insertions, 980 deletions
@@ -1,117 +1,64 @@ <?xml version="1.0" encoding="UTF-8"?>
-<project name="gitblit" default="compile" basedir=".">
-
- <!-- Google Code upload task -->
- <taskdef classname="net.bluecow.googlecode.ant.GoogleCodeUploadTask"
- classpath="${basedir}/tools/ant-googlecode-0.0.3.jar" name="gcupload"/>
-
- <!-- GenJar task -->
- <taskdef resource="genjar.properties" classpath="${basedir}/tools/GenJar.jar" />
-
- <!-- Project Properties -->
- <property name="project.jar" value="gitblit.jar" />
- <property name="project.mainclass" value="com.gitblit.Launcher" />
- <property name="project.build.dir" value="${basedir}/build" />
- <property name="project.deploy.dir" value="${basedir}/deploy" />
- <property name="project.war.dir" value="${basedir}/war" />
- <property name="project.jar.dir" value="${basedir}/jar" />
- <property name="project.site.dir" value="${basedir}/target/site" />
- <property name="project.target.dir" value="${basedir}/target" />
- <property name="project.resources.dir" value="${basedir}/resources" />
- <property name="project.express.dir" value="${basedir}/express" />
- <property name="project.maven.repo.url" value="enter here your Maven repo URL" />
- <property name="project.maven.repo.id" value="gitblit.maven.repo" />
- <available property="hasBuildProps" file="${basedir}/build.properties"/>
+<project name="gitblit" default="compile" xmlns:mx="antlib:org.moxie">
<!--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Load build.properties, if available
+ Retrieve Moxie Toolkit
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-->
- <target name="buildprops" if="hasBuildProps">
- <!-- Load publication servers, paths, and credentials -->
- <loadproperties>
- <file file="${basedir}/build.properties" />
- </loadproperties>
- </target>
+ <property name="moxie.version" value="0.7.1" />
+ <property name="moxie.url" value="http://gitblit.github.com/moxie/maven" />
+ <property name="moxie.jar" value="moxie-toolkit-${moxie.version}.jar" />
+ <property name="moxie.dir" value="${user.home}/.moxie" />
+
+ <!-- Download Moxie from it's Maven repository to user.home -->
+ <get src="${moxie.url}/org/moxie/moxie-toolkit/${moxie.version}/${moxie.jar}"
+ dest="${moxie.dir}" skipexisting="true" verbose="true" />
+ <!-- Register Moxie tasks -->
+ <taskdef uri="antlib:org.moxie">
+ <classpath location="${moxie.dir}/${moxie.jar}" />
+ </taskdef>
+
+ <!-- Project directories -->
+ <property name="project.src.dir" value="${basedir}/src/main/java" />
+ <property name="project.resources.dir" value="${basedir}/src/main/resources" />
+ <property name="project.distrib.dir" value="${basedir}/src/main/distrib" />
<!--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Scrape the version info from code and setup the build properties
+ Initialize Moxie and setup build properties
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-->
- <target name="buildinfo" depends="buildprops">
+ <target name="prepare">
- <!-- extract Gitblit version number from source code -->
- <loadfile property="gb.version" srcfile="${basedir}/src/com/gitblit/Constants.java">
- <filterchain>
- <linecontains>
- <contains value="public static final String VERSION = " />
- </linecontains>
- <striplinebreaks />
- <tokenfilter>
- <replacestring from="public static final String VERSION = "" to="" />
- <replacestring from="";" to="" />
- <trim />
- </tokenfilter>
- </filterchain>
- </loadfile>
-
- <!-- extract Gitblit version date from source code -->
- <loadfile property="gb.versionDate" srcfile="${basedir}/src/com/gitblit/Constants.java">
- <filterchain>
- <linecontains>
- <contains value="public static final String VERSION_DATE = " />
- </linecontains>
- <striplinebreaks />
- <tokenfilter>
- <replacestring from="public static final String VERSION_DATE = "" to="" />
- <replacestring from="";" to="" />
- <trim />
- </tokenfilter>
- </filterchain>
- </loadfile>
-
- <!-- extract JGit version number from source code -->
- <loadfile property="jgit.version" srcfile="${basedir}/src/com/gitblit/Constants.java">
- <filterchain>
- <linecontains>
- <contains value="public static final String JGIT_VERSION = " />
- </linecontains>
- <striplinebreaks />
- <tokenfilter>
- <replacestring from="public static final String JGIT_VERSION = "" to="" />
- <replacestring from="";" to="" />
- <trim />
- </tokenfilter>
- </filterchain>
- </loadfile>
- <property name="distribution.zipfile" value="gitblit-${gb.version}.zip" />
- <property name="distribution.warfile" value="gitblit-${gb.version}.war" />
- <property name="distribution.jarfile" value="gitblit-${gb.version}.jar" />
- <property name="distribution.pomfile" value="${basedir}/pom.xml" />
- <property name="fedclient.zipfile" value="fedclient-${gb.version}.zip" />
- <property name="manager.zipfile" value="manager-${gb.version}.zip" />
- <property name="authority.zipfile" value="authority-${gb.version}.zip" />
- <property name="gbapi.zipfile" value="gbapi-${gb.version}.zip" />
- <property name="express.zipfile" value="express-${gb.version}.zip" />
- <property name="distribution.pomfileTmplt" value="tmplt.pom.xml" />
+ <!-- Setup Ant build from build.moxie and resolve dependencies.
+ if it exists, build.properties is automatically loaded -->
+ <mx:init verbose="no" />
+
+ <!-- Set Ant project properties -->
+ <property name="distribution.zipfile" value="gitblit-${project.version}.zip" />
+ <property name="distribution.tgzfile" value="gitblit-${project.version}.tar.gz" />
+ <property name="distribution.warfile" value="gitblit-${project.version}.war" />
+ <property name="fedclient.zipfile" value="fedclient-${project.version}.zip" />
+ <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" />
+
+ <!-- Download links -->
+ <property name="gc.url" value="http://code.google.com/p/gitblit/downloads/detail?name=" />
</target>
-
+
<!--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Compile
+ Cleanup all build artifacts and directories
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-->
- <target name="compile" depends="buildinfo" description="Retrieves dependencies and compiles Gitblit from source">
-
- <!-- cleanup old builds -->
- <delete dir="${project.target.dir}" />
- <mkdir dir="${project.target.dir}" />
-
- <!-- cleanup old builds -->
+ <target name="clean" depends="prepare" description="Cleanup all build artifacts and directories">
+ <!-- cleanup legacy build structure -->
+ <!-- this can be eliminated after 1.3.0 release -->
<delete>
<fileset dir="${basedir}">
<include name="*.zip" />
@@ -119,33 +66,42 @@ <include name="*.jar" />
</fileset>
</delete>
+ <delete dir="${basedir}/deploy" failonerror="false" />
+ <delete dir="${basedir}/express" failonerror="false" />
+ <delete dir="${basedir}/jar" failonerror="false" />
+ <delete dir="${basedir}/javadoc" failonerror="false" />
+ <delete dir="${basedir}/site" failonerror="false" />
+ <delete dir="${basedir}/temp" failonerror="false" />
+ <delete dir="${basedir}/war" failonerror="false" />
- <!-- copy required distribution files to data folder -->
+ <!-- Clean build and target directories -->
+ <mx:clean />
+
+ </target>
+
+
+ <!--
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Setup
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ -->
+ <target name="setup" depends="prepare" description="Setup up project">
+
+ <!-- copy distrib/data to project data directory -->
<mkdir dir="${basedir}/data" />
<copy todir="${basedir}/data" overwrite="false">
- <fileset dir="${basedir}/distrib">
- <include name="gitblit.properties" />
- <include name="users.conf" />
- <include name="projects.conf" />
- </fileset>
+ <fileset dir="${project.distrib.dir}/data" />
</copy>
- <!-- copy required distribution files to project folder -->
- <mkdir dir="${basedir}/data/certs" />
- <copy todir="${basedir}/data/certs" overwrite="false">
- <fileset dir="${basedir}/distrib">
- <include name="authority.conf" />
- <include name="*.tmpl" />
- </fileset>
- </copy>
-
- <!-- copy required distribution files to project folder -->
- <mkdir dir="${basedir}/data/groovy" />
- <copy todir="${basedir}/data/groovy" overwrite="false">
- <fileset dir="${basedir}/distrib/groovy" />
- </copy>
+ <!-- copy gitblit.properties to the WEB-INF directory.
+ this file is only used for parsing setting descriptions. -->
+ <copy tofile="${project.src.dir}/WEB-INF/reference.properties" overwrite="true"
+ file="${project.distrib.dir}/data/gitblit.properties" />
- <!-- upgrade existing workspace to data folder -->
+ <!--
+ upgrade existing workspace to data directory
+ this code can be eliminated after 1.3.0 release
+ -->
<move todir="${basedir}/data" overwrite="true" failonerror="false">
<fileset dir="${basedir}">
<include name="users.conf" />
@@ -164,467 +120,173 @@ <move todir="${basedir}/data/proposals" overwrite="true" failonerror="false">
<fileset dir="${basedir}/proposals" />
</move>
- <delete dir="${basedir}/javadoc" failonerror="false" />
- <delete dir="${basedir}/site" failonerror="false" />
- <delete dir="${basedir}/temp" failonerror="false" />
-
- <!-- copy gitblit.properties to the WEB-INF folder.
- this file is only used for parsing setting descriptions. -->
- <copy tofile="${basedir}/src/WEB-INF/reference.properties" overwrite="true"
- file="${basedir}/distrib/gitblit.properties" />
-
- <!-- Compile the build tool and execute it.
- This downloads missing compile-time dependencies from Maven. -->
-
- <delete dir="${project.build.dir}" />
- <mkdir dir="${project.build.dir}" />
- <javac debug="true" srcdir="${basedir}/src" destdir="${project.build.dir}" includeantruntime="false">
- <include name="com/gitblit/build/Build.java" />
- <include name="com/gitblit/Constants.java" />
- <include name="com/gitblit/utils/StringUtils.java" />
- </javac>
-
- <java classpath="${project.build.dir}" classname="com.gitblit.build.Build" failonerror="true">
- <syspropertyset id="proxy.properties">
- <propertyref prefix="java.net.useSystemProxies"/>
- <propertyref prefix="http."/>
- <propertyref prefix="https."/>
- <propertyref prefix="ftp."/>
- <propertyref prefix="socksProxy"/>
- </syspropertyset>
- </java>
-
- <!-- Compile Project -->
- <path id="master-classpath">
- <fileset dir="${basedir}/ext">
- <include name="*.jar" />
- </fileset>
- <pathelement path="${project.build.dir}" />
- </path>
- <javac debug="true" destdir="${project.build.dir}" failonerror="false" includeantruntime="false">
- <src path="${basedir}/src" />
- <classpath refid="master-classpath" />
- </javac>
- <copy todir="${project.build.dir}">
- <fileset dir="${basedir}/src" excludes="**/*.java,**/thumbs.db" />
- </copy>
-
- <!-- Set Version into web.xml -->
- <replace file="${project.build.dir}/WEB-INF/web.xml" token="@gb.version@" value="${gb.version}" summary="yes"/>
</target>
-
+
<!--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Build Gitblit GO
+ Compile
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-->
- <target name="buildGO" depends="compile,buildAuthority" description="Build Gitblit GO distribution">
-
- <echo>Building Gitblit GO ${gb.version}</echo>
-
- <!-- Delete the deploy folder -->
- <delete dir="${project.deploy.dir}" />
-
- <!-- Create deployment folder structure -->
- <mkdir dir="${project.deploy.dir}" />
- <copy todir="${project.deploy.dir}">
- <fileset dir="${basedir}/distrib">
- <include name="**/*" />
- <exclude name="federation.properties" />
- <exclude name="openshift.mkd" />
- <exclude name="authority.conf" />
- <exclude name="users.conf" />
- <exclude name="projects.conf" />
- <exclude name="gitblit.properties" />
- <exclude name="*.tmpl" />
- <exclude name="groovy/**" />
- </fileset>
- <fileset dir="${basedir}">
- <include name="LICENSE" />
- <include name="NOTICE" />
- </fileset>
- </copy>
+ <target name="compile" depends="setup" description="compiles Gitblit from source">
- <!-- Copy the supported Groovy hook scripts -->
- <mkdir dir="${project.deploy.dir}/data/groovy" />
- <copy todir="${project.deploy.dir}/data/groovy">
- <fileset dir="${basedir}/distrib/groovy">
- <include name="sendmail.groovy" />
- <include name="sendmail-html.groovy" />
- <include name="jenkins.groovy" />
- <include name="protect-refs.groovy" />
- <include name="fogbugz.groovy" />
- <include name="thebuggenie.groovy" />
- </fileset>
- </copy>
-
- <copy tofile="${project.deploy.dir}/authority.jar" file="${project.target.dir}/authority-${gb.version}.jar" />
-
- <!-- Prepare the data folder -->
- <mkdir dir="${project.deploy.dir}/data"/>
- <copy todir="${project.deploy.dir}/data">
- <fileset dir="${basedir}/distrib">
- <include name="users.conf" />
- <include name="projects.conf" />
- <include name="gitblit.properties" />
- </fileset>
- </copy>
-
- <!-- Certificate templates -->
- <mkdir dir="${project.deploy.dir}/data/certs"/>
- <mkdir dir="${project.deploy.dir}/data/certs"/>
- <copy todir="${project.deploy.dir}/data/certs">
- <fileset dir="${basedir}/distrib">
- <include name="*.tmpl" />
- <include name="authority.conf" />
- </fileset>
- </copy>
-
- <!-- Set Version into web.xml -->
- <replace file="${project.build.dir}/WEB-INF/web.xml" token="@gb.version@" value="${gb.version}" summary="yes"/>
-
- <!-- Build jar -->
- <jar jarfile="${project.deploy.dir}/${project.jar}">
- <fileset dir="${project.build.dir}">
- <include name="**/*" />
- <exclude name="com/gitblit/client/**" />
- </fileset>
- <fileset dir="${project.resources.dir}">
- <exclude name="thumbs.db" />
- </fileset>
- <manifest>
- <attribute name="Main-Class" value="${project.mainclass}" />
- </manifest>
- </jar>
+ <!-- Generate the Keys class from the properties file -->
+ <mx:keys propertiesfile="${project.distrib.dir}/data/gitblit.properties"
+ outputclass="com.gitblit.Keys"
+ todir="${project.src.dir}" />
- <!-- Gitblit library dependencies -->
- <mkdir dir="${project.deploy.dir}/ext"/>
- <copy todir="${project.deploy.dir}/ext">
- <fileset dir="${basedir}/ext">
- <exclude name="src/**" />
- <exclude name="junit*.jar" />
- <exclude name="hamcrest*.jar" />
- <exclude name="commons-net*.jar" />
- </fileset>
- </copy>
-
- <!-- Build the docs for the deploy -->
- <antcall target="buildDocs" inheritall="true" inheritrefs="true">
- <param name="docs.output.dir" value="${project.deploy.dir}/docs" />
- </antcall>
+ <!-- Compile project incrementally -->
+ <mx:javac scope="compile" clean="false" />
- <!-- Create Zip deployment -->
- <zip destfile="${project.target.dir}/${distribution.zipfile}">
- <fileset dir="${project.deploy.dir}">
- <include name="**/*" />
- </fileset>
- </zip>
-
</target>
-
-
+
+
<!--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Build Gitblit Docs which are bundled with GO and WAR downloads
+ Report the compile dependencies on the console
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-->
- <target name="buildDocs">
- <!-- Build Docs -->
- <mkdir dir="${docs.output.dir}" />
- <copy todir="${docs.output.dir}">
- <!-- Copy selected Gitblit resources -->
- <fileset dir="${project.resources.dir}">
- <include name="bootstrap/**/*" />
- <include name="gitblit.css" />
- <include name="gitblt_25_white.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" />
- <include name="federated_16x16.png" />
- <include name="arrow_page.png" />
- </fileset>
-
- <!-- Copy Doc images -->
- <fileset dir="${basedir}/docs">
- <include name="*.png" />
- <include name="*.gif" />
- </fileset>
- </copy>
-
- <!-- Copy google-code-prettify -->
- <mkdir dir="${docs.output.dir}/prettify" />
- <copy todir="${docs.output.dir}/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.build.BuildSite">
- <classpath refid="master-classpath" />
- <arg value="--sourceFolder" />
- <arg value="${basedir}/docs" />
-
- <arg value="--outputFolder" />
- <arg value="${docs.output.dir}" />
-
- <arg value="--pageHeader" />
- <arg value="${basedir}/docs/doc_header.html" />
-
- <arg value="--pageFooter" />
- <arg value="${basedir}/docs/doc_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=settings" />
-
- <arg value="--substitute" />
- <arg value="%VERSION%=${gb.version}" />
-
- <arg value="--substitute" />
- <arg value="%GO%=${distribution.zipfile}" />
-
- <arg value="--substitute" />
- <arg value="%WAR%=${distribution.warfile}" />
-
- <arg value="--substitute" />
- <arg value="%FEDCLIENT%=${fedclient.zipfile}" />
-
- <arg value="--substitute" />
- <arg value="%MANAGER%=${manager.zipfile}" />
-
- <arg value="--substitute" />
- <arg value="%API%=${gbapi.zipfile}" />
-
- <arg value="--substitute" />
- <arg value="%EXPRESS%=${express.zipfile}" />
-
- <arg value="--substitute" />
- <arg value="%BUILDDATE%=${gb.versionDate}" />
-
- <arg value="--substitute" />
- <arg value="%JGIT%=${jgit.version}" />
-
- <arg value="--properties" />
- <arg value="%PROPERTIES%=${basedir}/distrib/gitblit.properties" />
-
- <arg value="--nomarkdown" />
- <arg value="%BEGINCODE%:%ENDCODE%" />
-
- <arg value="--substitute" />
- <arg value=""%BEGINCODE%=<pre class='prettyprint lang-java'>"" />
-
- <arg value="--substitute" />
- <arg value="%ENDCODE%=</pre>" />
-
- <arg value="--regex" />
- <arg value=""\b(issue)(\s*[#]?|-){0,1}(\d+)\b!!!<a href='http://code.google.com/p/gitblit/issues/detail?id=$3'>issue $3</a>"" />
+ <target name="report" depends="prepare" description="generate dependency report">
+
+ <!-- Report compile dependencies to the console -->
+ <mx:report scope="compile" destfile="${project.targetDirectory}/dependencies.txt" />
- </java>
</target>
+
-
<!--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Build Gitblit WAR
+ Test
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-->
- <target name="buildWAR" depends="compile" description="Build Gitblit WAR">
+ <target name="test" depends="compile" description="compiles Gitblit from source and runs unit tests">
- <echo>Building Gitblit WAR ${gb.version}</echo>
+ <!-- Compile unit tests -->
+ <mx:javac scope="test" />
- <delete dir="${project.war.dir}" />
-
- <!-- Copy web.xml and users.conf to WEB-INF -->
- <copy todir="${project.war.dir}/WEB-INF">
- <fileset dir="${basedir}/src/WEB-INF">
- <include name="web.xml" />
- </fileset>
- <fileset dir="${basedir}">
- <include name="LICENSE" />
- <include name="NOTICE" />
- </fileset>
- </copy>
+ <!-- Run unit tests -->
+ <mx:test failonerror="true" />
- <!-- Set Version into web.xml -->
- <replace file="${project.war.dir}/WEB-INF/web.xml" token="@gb.version@" value="${gb.version}" summary="yes"/>
-
- <!-- Copy gitblit.properties as reference.properties -->
- <copy tofile="${project.war.dir}/WEB-INF/reference.properties"
- file="${basedir}/distrib/gitblit.properties"/>
-
- <!-- Build the docs for the WAR build -->
- <antcall target="buildDocs" inheritall="true" inheritrefs="true">
- <param name="docs.output.dir" value="${project.war.dir}/WEB-INF/docs" />
- </antcall>
-
- <!-- Copy users.conf to WEB-INF/data -->
- <mkdir dir="${project.war.dir}/WEB-INF/data" />
- <copy todir="${project.war.dir}/WEB-INF/data">
- <fileset dir="${basedir}/distrib">
- <include name="users.conf" />
- <include name="projects.conf" />
- <include name="gitblit.properties" />
- </fileset>
- </copy>
+ </target>
- <!-- Copy the supported Groovy hook scripts -->
- <mkdir dir="${project.war.dir}/WEB-INF/data/groovy" />
- <copy todir="${project.war.dir}/WEB-INF/data/groovy">
- <fileset dir="${basedir}/distrib/groovy">
- <include name="sendmail.groovy" />
- <include name="sendmail-html.groovy" />
- <include name="jenkins.groovy" />
- <include name="protect-refs.groovy" />
- <include name="fogbugz.groovy" />
- <include name="thebuggenie.groovy" />
- </fileset>
- </copy>
- <!-- Build the WAR web.xml from the prototype web.xml -->
- <java classpath="${project.build.dir}" classname="com.gitblit.build.BuildWebXml">
- <classpath refid="master-classpath" />
-
- <arg value="--sourceFile" />
- <arg value="${basedir}/src/WEB-INF/web.xml" />
-
- <arg value="--destinationFile" />
- <arg value="${project.war.dir}/WEB-INF/web.xml" />
+ <!--
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Run Gitblit GO
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ -->
+ <target name="run" depends="compile" description="Run Gitblit GO">
+
+ <!-- run the mainclass in a separate JVM -->
+ <mx:run fork="true" />
+
+ </target>
- </java>
+
+ <!--
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Build Gitblit GO
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ -->
+ <target name="buildGO" depends="compile" description="Build Gitblit GO distribution">
- <!-- Set Version into web.xml -->
- <replace file="${project.war.dir}/WEB-INF/web.xml" token="@gb.version@" value="${gb.version}" summary="yes"/>
+ <echo>Building Gitblit GO ${project.version}</echo>
- <!-- Gitblit resources -->
- <copy todir="${project.war.dir}">
- <fileset dir="${project.resources.dir}">
- <exclude name="thumbs.db" />
- </fileset>
- </copy>
+ <local name="go.dir" />
+ <property name="go.dir" value="${project.outputDirectory}/go" />
+ <delete dir="${go.dir}" />
+
+ <prepareDataDirectory toDir="${go.dir}/data" />
- <!-- Gitblit library dependencies -->
- <mkdir dir="${project.war.dir}/WEB-INF/lib"/>
- <copy todir="${project.war.dir}/WEB-INF/lib">
- <fileset dir="${basedir}/ext">
- <exclude name="src/**" />
- <exclude name="jcommander*.jar" />
- <exclude name="jetty*.jar" />
- <exclude name="junit*.jar" />
- <exclude name="hamcrest*.jar" />
- <exclude name="servlet*.jar" />
- <exclude name="javax.servlet*.jar" />
+ <!-- Build jar -->
+ <mx:jar destfile="${go.dir}/gitblit.jar" includeresources="true">
+ <mainclass name="com.gitblit.GitBlitServer" />
+ <launcher paths="ext" />
+ </mx:jar>
+
+ <!-- Generate the docs for the GO build -->
+ <generateDocs toDir="${go.dir}/docs" />
+
+ <!-- Create GO Windows Zip deployment -->
+ <mx:zip basedir="${go.dir}">
+ <!-- LICENSE and NOTICE -->
+ <fileset dir="${basedir}" >
+ <include name="LICENSE" />
+ <include name="NOTICE" />
</fileset>
- </copy>
+ <!-- Distrib files -->
+ <zipfileset dir="${project.distrib.dir}/win" />
+ <!-- include all dependencies -->
+ <dependencies prefix="ext" />
+ </mx:zip>
- <!-- Gitblit classes -->
- <mkdir dir="${project.war.dir}/WEB-INF/classes"/>
- <copy todir="${project.war.dir}/WEB-INF/classes">
- <fileset dir="${project.build.dir}">
- <exclude name="WEB-INF/" />
- <exclude name="com/gitblit/tests/" />
- <exclude name="com/gitblit/build/**" />
- <exclude name="com/gitblit/client/**" />
- <exclude name="com/gitblit/AddIndexedBranch*.class" />
- <exclude name="com/gitblit/GitBlitServer*.class" />
- <exclude name="com/gitblit/Launcher*.class" />
- <exclude name="com/gitblit/authority/**" />
+ <!-- Create GO Linux/OSX tar.gz deployment -->
+ <mx:tar basedir="${go.dir}" longfile="gnu" compression="gzip">
+ <!-- LICENSE and NOTICE -->
+ <fileset dir="${basedir}" >
+ <include name="LICENSE" />
+ <include name="NOTICE" />
</fileset>
- </copy>
+ <!-- Distrib files -->
+ <tarfileset dir="${project.distrib.dir}/linux" filemode="755" />
+ <!-- include all dependencies -->
+ <dependencies prefix="ext" />
+ </mx:tar>
- <!-- Build the WAR file -->
- <jar basedir="${project.war.dir}" destfile="${project.target.dir}/${distribution.warfile}" compress="true" />
</target>
-
+
<!--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Build Gitblit JAR for usage in other projects plug-ins (i.e. Gerrit)
+ Build Gitblit WAR
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-->
- <target name="buildJAR" depends="compile" description="Build Gitblit JAR">
+ <target name="buildWAR" depends="compile" description="Build Gitblit WAR">
+
+ <echo>Building Gitblit WAR ${project.version}</echo>
- <echo>Building Gitblit JAR ${gb.version}</echo>
+ <local name="war.dir" />
+ <property name="war.dir" value="${project.outputDirectory}/war" />
+ <delete dir="${war.dir}" />
+
+ <local name="webinf" />
+ <property name="webinf" value="${war.dir}/WEB-INF" />
- <delete dir="${project.jar.dir}" />
+ <!-- Generate the docs for the WAR build -->
+ <generateDocs toDir="${webinf}/docs" />
- <!-- Gitblit classes -->
- <mkdir dir="${project.jar.dir}"/>
- <copy todir="${project.jar.dir}">
- <fileset dir="${project.build.dir}">
- <exclude name="WEB-INF/" />
- <exclude name="com/gitblit/tests/" />
- <exclude name="com/gitblit/build/**" />
- <exclude name="com/gitblit/client/**" />
- <exclude name="com/gitblit/authority/**" />
- <exclude name="com/gitblit/AddIndexedBranch*.class" />
- <exclude name="com/gitblit/GitBlitServer*.class" />
- <exclude name="com/gitblit/Launcher*.class" />
- </fileset>
- </copy>
- <copy todir="${project.jar.dir}/static">
+ <!-- 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" />
+
+ <!-- Build the WAR file -->
+ <mx:zip basedir="${war.dir}" destfile="${project.targetDirectory}/${distribution.warfile}" compress="true" >
+ <!-- Resources in root -->
<fileset dir="${project.resources.dir}">
<exclude name="thumbs.db" />
+ <exclude name="*.mkd" />
</fileset>
- </copy>
-
- <!-- Build the JAR file -->
- <jar basedir="${project.jar.dir}" destfile="${distribution.jarfile}" compress="true" />
- </target>
-
- <!--
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Build pom.xml for GitBlit JAR Maven module
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- -->
- <target name="buildMaven" depends="buildJAR" description="Build pom.xml for Gitblit JAR Maven module">
- <copy tofile="${distribution.pomfile}" file="${distribution.pomfileTmplt}"/>
- <replace file="${distribution.pomfile}" token="@gb.version@" value="${gb.version}" />
+ <!-- WEB-INF directory -->
+ <zipfileset fullpath="WEB-INF/reference.properties"
+ file="${project.distrib.dir}/data/gitblit.properties" />
+ <zipfileset prefix="WEB-INF" dir="${basedir}" >
+ <include name="LICENSE" />
+ <include name="NOTICE" />
+ </zipfileset>
+ <!-- Classes and classpath resources -->
+ <zipfileset prefix="WEB-INF/classes" dir="${project.compileOutputDirectory}">
+ <include name="**/*.class" />
+ <include name="**/*.properties" />
+ <include name="**/*.mkd" />
+ <exclude name="WEB-INF" />
+ </zipfileset>
+ <!-- include "war" tagged dependencies -->
+ <dependencies prefix="WEB-INF/lib" tag="war" />
+ </mx:zip>
</target>
- <!--
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Install Gitblit JAR for usage as Maven module
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- -->
- <target name="installMaven" depends="buildMaven" description="Install Gitblit JAR as Maven module">
- <exec executable="mvn">
- <arg value="install:install-file" />
- <arg value="-Dfile=${distribution.jarfile}" />
- <arg value="-DpomFile=${distribution.pomfile}" />
- <arg value="-DcreateChecksum=true" />
- </exec>
- </target>
-
- <!--
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Upload Gitblit JAR to remote Maven repository
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- -->
- <target name="uploadMaven" depends="buildJAR" description="Upload Gitblit JAR to remote Maven repository">
- <exec executable="mvn">
- <arg value="deploy:deploy-file" />
- <arg value="-Dfile=${distribution.jarfile}" />
- <arg value="-DpomFile=${distribution.pomfile}" />
- <arg value="-Durl=${project.maven.repo.url}" />
- <arg value="-DrepositoryId=${project.maven.repo.id}" />
- <arg value="-DcreateChecksum=true" />
- </exec>
- </target>
<!--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -632,145 +294,72 @@ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-->
<target name="buildFederationClient" depends="compile" description="Builds the stand-alone Gitblit federation client">
- <echo>Building Gitblit Federation Client ${gb.version}</echo>
+ <echo>Building Gitblit Federation Client ${project.version}</echo>
- <genjar jarfile="${project.target.dir}/fedclient.jar">
- <class name="com.gitblit.FederationClientLauncher" />
- <resource file="${project.build.dir}/log4j.properties" />
- <classfilter>
- <exclude name="org.apache." />
- <exclude name="org.bouncycastle." />
- <exclude name="org.eclipse." />
- <exclude name="org.slf4j." />
- <exclude name="com.beust." />
- <exclude name="com.google." />
- <exclude name="com.unboundid." />
- </classfilter>
- <classpath refid="master-classpath" />
- <manifest>
- <attribute name="Main-Class" value="com.gitblit.FederationClientLauncher" />
- <attribute name="Specification-Version" value="${gb.version}" />
- <attribute name="Release-Date" value="${gb.versionDate}" />
- </manifest>
- </genjar>
+ <!-- generate jar by traversing the class hierarchy of the specified
+ classes, exclude any classes in classpath jars -->
+ <mx:genjar tag="" excludeClasspathJars="true"
+ destfile="${project.targetDirectory}/fedclient.jar">
+ <mainclass name="com.gitblit.FederationClient" />
+ <launcher paths="ext" />
+ <resource file="${project.compileOutputDirectory}/log4j.properties" />
+ </mx:genjar>
<!-- Build the federation client zip file -->
- <zip destfile="${project.target.dir}/${fedclient.zipfile}">
+ <mx:zip destfile="${project.targetDirectory}/${fedclient.zipfile}">
<fileset dir="${basedir}">
<include name="LICENSE" />
<include name="NOTICE" />
</fileset>
- <fileset dir="${project.target.dir}">
+ <fileset dir="${project.targetDirectory}">
<include name="fedclient.jar" />
</fileset>
- <fileset dir="${basedir}/distrib">
+ <fileset dir="${project.distrib.dir}">
<include name="federation.properties" />
</fileset>
- </zip>
+ <!-- include "fedclient" tagged dependencies -->
+ <dependencies prefix="ext" tag="fedclient" />
+ </mx:zip>
<!-- Cleanup -->
- <delete file="${project.target.dir}/fedclient.jar" />
+ <delete file="${project.targetDirectory}/fedclient.jar" />
+
</target>
<!--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Build a Gitblit filesystem for deployment to RedHat OpenShif Expresst
+ 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 ${gb.version}</echo>
+ <echo>Building Gitblit Express for RedHat OpenShift ${project.version}</echo>
- <delete dir="${project.express.dir}" />
+ <local name="express.dir" />
+ <property name="express.dir" value="${project.outputDirectory}/express" />
+ <delete dir="${express.dir}" />
<!-- Create the OpenShift filesystem -->
- <property name="deployments.root" value="${project.express.dir}/deployments/ROOT.war"/>
+ <local name="deployments.root" />
+ <property name="deployments.root" value="${express.dir}/deployments/ROOT.war"/>
<mkdir dir="${deployments.root}" />
- <touch file="${project.express.dir}/deployments/ROOT.war.dodeploy" />
+ <touch file="${express.dir}/deployments/ROOT.war.dodeploy" />
- <!-- Copy the Gitblit OpenShift readme file -->
- <copy tofile="${project.express.dir}/README.gitblit"
- file="${basedir}/distrib/openshift.mkd"/>
-
- <!-- Copy LICENSE and NOTICE to WEB-INF -->
- <copy todir="${deployments.root}/WEB-INF">
- <fileset dir="${basedir}">
- <include name="LICENSE" />
- <include name="NOTICE" />
- </fileset>
- </copy>
+ <local name="webinf" />
+ <property name="webinf" value="${deployments.root}/WEB-INF" />
- <!-- Copy gitblit.properties as reference.properties -->
- <copy tofile="${deployments.root}/WEB-INF/reference.properties"
- file="${basedir}/distrib/gitblit.properties"/>
-
- <!-- Copy users.conf and gitblit.properties -->
- <mkdir dir="${deployments.root}/WEB-INF/data" />
- <copy todir="${deployments.root}/WEB-INF/data">
- <fileset dir="${basedir}/distrib">
- <include name="users.conf" />
- <include name="projects.conf" />
- <include name="gitblit.properties" />
- </fileset>
- </copy>
+ <!-- Prepare the data directory -->
+ <prepareDataDirectory toDir="${webinf}/data" />
- <!-- Copy the supported Groovy hook scripts -->
- <mkdir dir="${deployments.root}/WEB-INF/data/groovy" />
- <copy todir="${deployments.root}/WEB-INF/data/groovy">
- <fileset dir="${basedir}/distrib/groovy">
- <include name="sendmail.groovy" />
- <include name="sendmail-html.groovy" />
- <include name="jenkins.groovy" />
- <include name="protect-refs.groovy" />
- <include name="fogbugz.groovy" />
- <include name="thebuggenie.groovy" />
- </fileset>
- </copy>
-
- <!-- Build the WAR web.xml from the prototype web.xml and gitblit.properties -->
+ <!-- Build the Express web.xml from the prototype web.xml and gitblit.properties -->
<!-- THIS FILE IS NOT OVERRIDDEN ONCE IT IS BUILT!!! -->
- <java classpath="${project.build.dir}" classname="com.gitblit.build.BuildWebXml">
- <classpath refid="master-classpath" />
-
- <arg value="--sourceFile" />
- <arg value="${basedir}/src/WEB-INF/web.xml" />
-
- <arg value="--destinationFile" />
- <arg value="${deployments.root}/WEB-INF/web.xml" />
-
- <arg value="--propertiesFile" />
- <arg value="${basedir}/distrib/gitblit.properties" />
- </java>
-
- <!-- Set Version into web.xml -->
- <replace file="${deployments.root}/WEB-INF/web.xml" token="@gb.version@" value="${gb.version}" summary="yes"/>
-
- <!-- Gitblit resources -->
- <copy todir="${deployments.root}">
- <fileset dir="${project.resources.dir}">
- <exclude name="thumbs.db" />
- </fileset>
- </copy>
-
- <!-- Gitblit library dependencies -->
- <mkdir dir="${deployments.root}/WEB-INF/lib"/>
- <copy todir="${deployments.root}/WEB-INF/lib">
- <fileset dir="${basedir}/ext">
- <exclude name="src/**" />
- <exclude name="jcommander*.jar" />
- <exclude name="jetty*.jar" />
- <exclude name="junit*.jar" />
- <exclude name="hamcrest*.jar" />
- <exclude name="servlet*.jar" />
- <exclude name="javax.servlet*.jar" />
- <exclude name="jsslutils*.jar" />
- <exclude name="jcalendar*.jar" />
- </fileset>
- </copy>
+ <mx:webxml sourcefile="${project.src.dir}/WEB-INF/web.xml" destfile="${webinf}/web.xml"
+ propertiesFile="${project.distrib.dir}/data/gitblit.properties"
+ skip="server.*" />
<!-- Gitblit classes -->
- <jar destfile="${deployments.root}/WEB-INF/lib/gitblit-${gb.version}.jar">
- <fileset dir="${project.build.dir}">
+ <jar destfile="${webinf}/lib/gitblit.jar">
+ <fileset dir="${project.compileOutputDirectory}">
<exclude name="WEB-INF/" />
<exclude name="com/gitblit/tests/" />
<exclude name="com/gitblit/build/**" />
@@ -782,9 +371,24 @@ </jar>
<!-- Build Express Zip file -->
- <zip destfile="${project.target.dir}/${express.zipfile}">
- <fileset dir="${project.express.dir}" />
- </zip>
+ <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>
+ <!-- reference.properties -->
+ <zipfileset fullpath="deployments/ROOT.war/WEB-INF/reference.properties"
+ file="${project.distrib.dir}/data/gitblit.properties" />
+ <!-- include "war" tagged dependencies -->
+ <dependencies prefix="deployments/ROOT.war/WEB-INF/lib" tag="war" />
+ </mx:zip>
</target>
@@ -795,72 +399,64 @@ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-->
<target name="buildManager" depends="compile" description="Builds the stand-alone Gitblit Manager">
- <echo>Building Gitblit Manager ${gb.version}</echo>
-
- <genjar jarfile="${project.target.dir}/manager-${gb.version}.jar">
- <resource file="${basedir}/src/com/gitblit/client/splash.png" />
- <resource file="${basedir}/resources/gitblt-favicon.png" />
- <resource file="${basedir}/resources/gitweb-favicon.png" />
- <resource file="${basedir}/resources/git-orange-16x16.png" />
- <resource file="${basedir}/resources/user_16x16.png" />
- <resource file="${basedir}/resources/users_16x16.png" />
- <resource file="${basedir}/resources/settings_16x16.png" />
- <resource file="${basedir}/resources/lock_go_16x16.png" />
- <resource file="${basedir}/resources/lock_pull_16x16.png" />
- <resource file="${basedir}/resources/shield_16x16.png" />
- <resource file="${basedir}/resources/federated_16x16.png" />
- <resource file="${basedir}/resources/cold_16x16.png" />
- <resource file="${basedir}/resources/book_16x16.png" />
- <resource file="${basedir}/resources/bug_16x16.png" />
- <resource file="${basedir}/resources/health_16x16.png" />
- <resource file="${basedir}/resources/feed_16x16.png" />
- <resource file="${basedir}/resources/bullet_feed.png" />
- <resource file="${basedir}/resources/search-icon.png" />
- <resource file="${basedir}/resources/commit_changes_16x16.png" />
- <resource file="${basedir}/resources/commit_merge_16x16.png" />
- <resource file="${basedir}/resources/commit_divide_16x16.png" />
- <resource file="${basedir}/resources/star_16x16.png" />
- <resource file="${basedir}/resources/blank.png" />
- <resource file="${basedir}/src/com/gitblit/wicket/GitBlitWebApp.properties" />
- <resource file="${basedir}/src/com/gitblit/wicket/GitBlitWebApp_es.properties" />
- <resource file="${basedir}/src/com/gitblit/wicket/GitBlitWebApp_ja.properties" />
- <resource file="${basedir}/src/com/gitblit/wicket/GitBlitWebApp_ko.properties" />
- <resource file="${basedir}/src/com/gitblit/wicket/GitBlitWebApp_nl.properties" />
- <resource file="${basedir}/src/com/gitblit/wicket/GitBlitWebApp_pl.properties" />
- <resource file="${basedir}/src/com/gitblit/wicket/GitBlitWebApp_pt_BR.properties" />
-
- <class name="com.gitblit.client.GitblitManagerLauncher" />
- <classfilter>
- <exclude name="org.apache." />
- <exclude name="org.bouncycastle." />
- <exclude name="org.eclipse." />
- <exclude name="org.slf4j." />
- <exclude name="com.beust." />
- <exclude name="com.google." />
- <exclude name="com.unboundid." />
- </classfilter>
- <classpath refid="master-classpath" />
+ <echo>Building Gitblit Manager ${project.version}</echo>
+
+ <!-- generate jar by traversing the class hierarchy of the specified
+ classes, exclude any classes in classpath jars -->
+ <mx:genjar tag="" excludeClasspathJars="true"
+ destfile="${project.targetDirectory}/manager.jar">
+ <resource file="${project.src.dir}/com/gitblit/client/splash.png" />
+ <resource file="${project.resources.dir}/gitblt-favicon.png" />
+ <resource file="${project.resources.dir}/gitweb-favicon.png" />
+ <resource file="${project.resources.dir}/git-orange-16x16.png" />
+ <resource file="${project.resources.dir}/user_16x16.png" />
+ <resource file="${project.resources.dir}/users_16x16.png" />
+ <resource file="${project.resources.dir}/settings_16x16.png" />
+ <resource file="${project.resources.dir}/lock_go_16x16.png" />
+ <resource file="${project.resources.dir}/lock_pull_16x16.png" />
+ <resource file="${project.resources.dir}/shield_16x16.png" />
+ <resource file="${project.resources.dir}/federated_16x16.png" />
+ <resource file="${project.resources.dir}/cold_16x16.png" />
+ <resource file="${project.resources.dir}/book_16x16.png" />
+ <resource file="${project.resources.dir}/bug_16x16.png" />
+ <resource file="${project.resources.dir}/health_16x16.png" />
+ <resource file="${project.resources.dir}/feed_16x16.png" />
+ <resource file="${project.resources.dir}/bullet_feed.png" />
+ <resource file="${project.resources.dir}/search-icon.png" />
+ <resource file="${project.resources.dir}/commit_changes_16x16.png" />
+ <resource file="${project.resources.dir}/commit_merge_16x16.png" />
+ <resource file="${project.resources.dir}/commit_divide_16x16.png" />
+ <resource file="${project.resources.dir}/star_16x16.png" />
+ <resource file="${project.resources.dir}/blank.png" />
+ <resource file="${project.src.dir}/log4j.properties" />
+ <resource>
+ <!-- inlcude all translations -->
+ <fileset dir="${project.src.dir}/com/gitblit/wicket">
+ <include name="*.properties" />
+ </fileset>
+ </resource>
+
+ <mainclass name="com.gitblit.client.GitblitManagerLauncher" />
<manifest>
- <attribute name="Main-Class" value="com.gitblit.client.GitblitManagerLauncher" />
<attribute name="SplashScreen-Image" value="splash.png" />
- <attribute name="Specification-Version" value="${gb.version}" />
- <attribute name="Release-Date" value="${gb.versionDate}" />
</manifest>
- </genjar>
+ </mx:genjar>
<!-- Build Manager Zip file -->
- <zip destfile="${project.target.dir}/${manager.zipfile}">
+ <mx:zip destfile="${project.targetDirectory}/${manager.zipfile}">
<fileset dir="${basedir}">
<include name="LICENSE" />
<include name="NOTICE" />
</fileset>
- <fileset dir="${project.target.dir}">
- <include name="manager-${gb.version}.jar" />
+ <fileset dir="${project.targetDirectory}">
+ <include name="manager.jar" />
</fileset>
- </zip>
+ <!-- include "manager" tagged dependencies -->
+ <dependencies prefix="ext" tag="manager" />
+ </mx:zip>
<!-- Cleanup -->
- <delete file="${project.target.dir}/manager-${gb.version}.jar" />
+ <delete file="${project.targetDirectory}/manager.jar" />
</target>
@@ -870,69 +466,69 @@ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-->
<target name="buildAuthority" depends="compile" description="Builds the stand-alone Gitblit Authority">
- <echo>Building Gitblit Authority ${gb.version}</echo>
-
- <genjar jarfile="${project.target.dir}/authority-${gb.version}.jar">
- <resource file="${basedir}/src/com/gitblit/client/splash.png" />
- <resource file="${basedir}/resources/gitblt-favicon.png" />
- <resource file="${basedir}/resources/user_16x16.png" />
- <resource file="${basedir}/resources/users_16x16.png" />
- <resource file="${basedir}/resources/rosette_16x16.png" />
- <resource file="${basedir}/resources/rosette_32x32.png" />
- <resource file="${basedir}/resources/vcard_16x16.png" />
- <resource file="${basedir}/resources/settings_16x16.png" />
- <resource file="${basedir}/resources/settings_32x32.png" />
- <resource file="${basedir}/resources/search-icon.png" />
- <resource file="${basedir}/resources/mail_16x16.png" />
- <resource file="${basedir}/resources/script_16x16.png" />
- <resource file="${basedir}/resources/blank.png" />
- <resource file="${basedir}/resources/bullet_green.png" />
- <resource file="${basedir}/resources/bullet_orange.png" />
- <resource file="${basedir}/resources/bullet_red.png" />
- <resource file="${basedir}/resources/bullet_white.png" />
- <resource file="${basedir}/resources/bullet_delete.png" />
- <resource file="${basedir}/resources/bullet_key.png" />
- <resource file="${basedir}/src/log4j.properties" />
- <resource file="${basedir}/src/com/gitblit/wicket/GitBlitWebApp.properties" />
- <resource file="${basedir}/src/com/gitblit/wicket/GitBlitWebApp_es.properties" />
- <resource file="${basedir}/src/com/gitblit/wicket/GitBlitWebApp_ja.properties" />
- <resource file="${basedir}/src/com/gitblit/wicket/GitBlitWebApp_ko.properties" />
- <resource file="${basedir}/src/com/gitblit/wicket/GitBlitWebApp_pl.properties" />
-
- <class name="com.gitblit.authority.GitblitAuthorityLauncher" />
- <classfilter>
- <exclude name="org.apache." />
- <exclude name="org.bouncycastle." />
- <exclude name="org.eclipse." />
- <exclude name="org.slf4j." />
- <exclude name="com.beust." />
- <exclude name="com.google." />
- <exclude name="com.unboundid." />
- </classfilter>
- <classpath refid="master-classpath" />
+ <echo>Building Gitblit Authority ${project.version}</echo>
+
+ <!-- generate jar by traversing the class hierarchy of the specified
+ classes, exclude any classes in "authority" classpath jars -->
+ <mx:genjar tag="authority" excludeClasspathJars="true"
+ destfile="${project.targetDirectory}/authority.jar">
+ <resource file="${project.src.dir}/com/gitblit/client/splash.png" />
+ <resource file="${project.resources.dir}/gitblt-favicon.png" />
+ <resource file="${project.resources.dir}/user_16x16.png" />
+ <resource file="${project.resources.dir}/users_16x16.png" />
+ <resource file="${project.resources.dir}/rosette_16x16.png" />
+ <resource file="${project.resources.dir}/rosette_32x32.png" />
+ <resource file="${project.resources.dir}/vcard_16x16.png" />
+ <resource file="${project.resources.dir}/settings_16x16.png" />
+ <resource file="${project.resources.dir}/settings_32x32.png" />
+ <resource file="${project.resources.dir}/search-icon.png" />
+ <resource file="${project.resources.dir}/mail_16x16.png" />
+ <resource file="${project.resources.dir}/script_16x16.png" />
+ <resource file="${project.resources.dir}/blank.png" />
+ <resource file="${project.resources.dir}/bullet_green.png" />
+ <resource file="${project.resources.dir}/bullet_orange.png" />
+ <resource file="${project.resources.dir}/bullet_red.png" />
+ <resource file="${project.resources.dir}/bullet_white.png" />
+ <resource file="${project.resources.dir}/bullet_delete.png" />
+ <resource file="${project.resources.dir}/bullet_key.png" />
+ <resource file="${project.src.dir}/log4j.properties" />
+ <resource>
+ <!-- inlcude all translations -->
+ <fileset dir="${project.src.dir}/com/gitblit/wicket">
+ <include name="*.properties" />
+ </fileset>
+ </resource>
+
+ <mainclass name="com.gitblit.authority.Launcher" />
<manifest>
- <attribute name="Main-Class" value="com.gitblit.authority.GitblitAuthorityLauncher" />
<attribute name="SplashScreen-Image" value="splash.png" />
- <attribute name="Specification-Version" value="${gb.version}" />
- <attribute name="Release-Date" value="${gb.versionDate}" />
</manifest>
- </genjar>
+ </mx:genjar>
<!-- Build Authority Zip file -->
- <zip destfile="${project.target.dir}/${authority.zipfile}">
+ <mx:zip destfile="${project.targetDirectory}/${authority.zipfile}">
<fileset dir="${basedir}">
<include name="LICENSE" />
<include name="NOTICE" />
</fileset>
- <fileset dir="${project.target.dir}">
- <include name="authority-${gb.version}.jar" />
+ <fileset dir="${project.targetDirectory}">
+ <include name="authority.jar" />
</fileset>
- <zipfileset dir="${basedir}/distrib" prefix="data/certs">
+ <zipfileset dir="${project.distrib.dir}/data" prefix="data">
+ <include name="users.conf" />
+ <include name="gitblit.properties" />
+ </zipfileset>
+ <zipfileset dir="${project.distrib.dir}/data/certs" prefix="data/certs">
<include name="authority.conf" />
<include name="mail.tmpl" />
<include name="instructions.tmpl" />
</zipfileset>
- </zip>
+ <!-- include "authority" tagged dependencies -->
+ <dependencies prefix="ext" tag="authority" />
+ </mx:zip>
+
+ <!-- Cleanup -->
+ <delete file="${project.targetDirectory}/authority.jar" />
</target>
<!--
@@ -941,29 +537,25 @@ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-->
<target name="buildApiLibrary" depends="compile" description="Builds the Gitblit RPC client library">
- <echo>Building Gitblit API Library ${gb.version}</echo>
+ <echo>Building Gitblit API Library ${project.version}</echo>
+ <local name="javadoc.dir" />
+ <property name="javadoc.dir" value="${project.outputDirectory}/javadoc" />
+ <delete dir="${javadoc.dir}" />
+
<!-- Build API Library jar -->
- <genjar jarfile="${project.target.dir}/gbapi-${gb.version}.jar">
+ <mx:genjar tag="" excludeClasspathJars="true"
+ destfile="${project.targetDirectory}/gbapi-${project.version}.jar">
<class name="com.gitblit.Keys" />
<class name="com.gitblit.client.GitblitClient" />
<class name="com.gitblit.models.FederationModel" />
<class name="com.gitblit.models.FederationProposal" />
<class name="com.gitblit.models.FederationSet" />
- <classpath refid="master-classpath" />
- <classfilter>
- <exclude name="com.google.gson." />
- <exclude name="com.sun.syndication." />
- </classfilter>
- <manifest>
- <attribute name="Specification-Version" value="${gb.version}" />
- <attribute name="Release-Date" value="${gb.versionDate}" />
- </manifest>
- </genjar>
+ </mx:genjar>
<!-- Build API sources jar -->
- <zip destfile="${project.target.dir}/gbapi-${gb.version}-sources.jar">
- <fileset dir="${basedir}/src" defaultexcludes="yes">
+ <zip destfile="${project.targetDirectory}/gbapi-${project.version}-sources.jar">
+ <fileset dir="${project.src.dir}" defaultexcludes="yes">
<include name="com/gitblit/Constants.java"/>
<include name="com/gitblit/GitBlitException.java"/>
<include name="com/gitblit/Keys.java"/>
@@ -974,8 +566,8 @@ </zip>
<!-- Build API JavaDoc jar -->
- <javadoc destdir="${project.target.dir}/javadoc">
- <fileset dir="${basedir}/src" defaultexcludes="yes">
+ <mx:javadoc destdir="${javadoc.dir}" redirect="true">
+ <fileset dir="${project.src.dir}" defaultexcludes="yes">
<include name="com/gitblit/Constants.java"/>
<include name="com/gitblit/GitBlitException.java"/>
<include name="com/gitblit/Keys.java"/>
@@ -983,37 +575,34 @@ <include name="com/gitblit/models/**/*.java"/>
<include name="com/gitblit/utils/**/*.java"/>
</fileset>
- </javadoc>
- <zip destfile="${project.target.dir}/gbapi-${gb.version}-javadoc.jar">
- <fileset dir="${project.target.dir}/javadoc" />
+ </mx:javadoc>
+
+ <zip destfile="${project.targetDirectory}/gbapi-${project.version}-javadoc.jar">
+ <fileset dir="${javadoc.dir}" />
</zip>
<!-- Build the API library zip file -->
- <zip destfile="${project.target.dir}/${gbapi.zipfile}">
+ <mx:zip destfile="${project.targetDirectory}/${gbapi.zipfile}">
<fileset dir="${basedir}">
<include name="LICENSE" />
<include name="NOTICE" />
</fileset>
- <fileset dir="${project.target.dir}">
- <include name="gbapi-${gb.version}.jar" />
- <include name="gbapi-${gb.version}-sources.jar" />
- <include name="gbapi-${gb.version}-javadoc.jar" />
- </fileset>
- <fileset dir="${basedir}/ext">
- <exclude name="src/**" />
- <include name="gson*.jar" />
- <include name="rome*.jar" />
- <include name="jdom*.jar" />
+ <fileset dir="${project.targetDirectory}">
+ <include name="gbapi-${project.version}.jar" />
+ <include name="gbapi-${project.version}-sources.jar" />
+ <include name="gbapi-${project.version}-javadoc.jar" />
</fileset>
- </zip>
+ <!-- include "api" tagged dependencies -->
+ <dependencies prefix="ext" tag="api" />
+ </mx:zip>
<!-- Cleanup -->
<delete>
- <fileset dir="${project.target.dir}">
+ <fileset dir="${project.targetDirectory}">
<include name="javadoc/**" />
- <include name="gbapi-${gb.version}.jar" />
- <include name="gbapi-${gb.version}-sources.jar" />
- <include name="gbapi-${gb.version}-javadoc.jar" />
+ <include name="gbapi-${project.version}.jar" />
+ <include name="gbapi-${project.version}-sources.jar" />
+ <include name="gbapi-${project.version}-javadoc.jar" />
</fileset>
</delete>
</target>
@@ -1024,162 +613,122 @@ Build the Gitblit Website
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-->
- <target name="buildSite" depends="compile" description="Build the Gitblit website">
+ <target name="buildSite" depends="prepare" description="Build the Gitblit website">
- <echo>Building Gitblit Website ${gb.version}</echo>
+ <echo>Building Gitblit Website ${project.version}</echo>
- <!-- Build Site -->
- <delete dir="${project.site.dir}" />
- <mkdir dir="${project.site.dir}" />
- <copy todir="${project.site.dir}">
- <!-- Copy selected Gitblit resources -->
- <fileset dir="${project.resources.dir}">
- <include name="bootstrap/**/*" />
- <include name="gitblit.css" />
- <include name="gitblt_25_white.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" />
- <include name="federated_16x16.png" />
- <include name="arrow_page.png" />
- </fileset>
+ <property name="releaselog" value="${basedir}/releases.moxie" />
- <!-- Copy Doc images -->
- <fileset dir="${basedir}/docs">
- <include name="*.png" />
- <include name="*.gif" />
- <include name="*.js" />
- </fileset>
- </copy>
+ <!-- Build Site -->
+ <mx:doc googleplusid="114464678392593421684" googleanalyticsid="UA-24377072-1"
+ googlePlusOne="true" minify="true" customless="custom.less">
+ <structure>
+ <menu name="about">
+ <page name="overview" src="siteindex.mkd" out="index.html" headerLinks="false" />
+ <page name="features" src="features.mkd" />
+ <page name="screenshots" src="screenshots.mkd" />
+ </menu>
+ <menu name="documentation">
+ <page name="setup" src="setup.mkd" />
+ <page name="federation" src="federation.mkd" />
+ <divider />
+ <page name="settings" src="properties.mkd" />
+ <page name="faq" src="faq.mkd" />
+ <divider />
+ <page name="design" src="design.mkd" />
+ <page name="rpc" src="rpc.mkd" />
+ </menu>
+
+ <menu name="releases">
+ <page name="release notes" out="releasenotes.html">
+ <template src="releasecurrent.ftl" data="${releaselog}" />
+ </page>
+ <page name="release history" out="releases.html">
+ <template src="releasehistory.ftl" data="${releaselog}" />
+ </page>
+ <divider />
+ <page name="roadmap" src="roadmap.mkd" />
+ </menu>
+
+ <menu name="downloads">
+ <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 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" />
+ </menu>
+
+ <menu name="links">
+ <link name="Demo" src="https://demo-gitblit.rhcloud.com" />
+ <divider />
+ <link name="Github" src="${project.scmUrl}" />
+ <link name="Issues" src="${project.issuesUrl}" />
+ <link name="Discussion" src="${project.forumUrl}" />
+ <link name="Google+" src="${project.socialNetworkUrl}" />
+ <link name="Ohloh" src="http://www.ohloh.net/p/gitblit" />
+ </menu>
+ <divider />
+ </structure>
+
+ <replace token="%GCURL%" value="${gc.url}" />
+
+ <properties token="%PROPERTIES%" file="${project.distrib.dir}/data/gitblit.properties" />
+
+ <regex searchPattern="\b(issue)(\s*[#]?|-){0,1}(\d+)\b" replacePattern="<a href='http://code.google.com/p/gitblit/issues/detail?id=$3'>issue $3</a>" />
+
+ <!-- Set the logo from the mx:doc resources -->
+ <logo file="${project.resources.dir}/gitblt_25_white.png" />
+ <favicon file="${project.resources.dir}/gitblt-favicon.png" />
+
+ <resource>
+ <fileset dir="${project.resources.dir}">
+ <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" />
+ <include name="federated_16x16.png" />
+ <include name="arrow_page.png" />
+ </fileset>
+ </resource>
+ </mx:doc>
<!-- Copy Fancybox -->
- <mkdir dir="${project.site.dir}/fancybox" />
- <copy todir="${project.site.dir}/fancybox">
- <fileset dir="${basedir}/docs/fancybox">
- <exclude name="thumbs.db" />
- </fileset>
- </copy>
-
- <!-- Copy google-code-prettify -->
- <mkdir dir="${basedir}/src/com/gitblit/wicket/pages/prettify" />
- <copy todir="${project.site.dir}/prettify">
- <fileset dir="${basedir}/src/com/gitblit/wicket/pages/prettify">
+ <mkdir dir="${project.siteTargetDirectory}/fancybox" />
+ <copy todir="${project.siteTargetDirectory}/fancybox">
+ <fileset dir="${project.siteSourceDirectory}/fancybox">
<exclude name="thumbs.db" />
</fileset>
</copy>
<!-- Generate thumbnails of screenshots -->
- <java classpath="${project.build.dir}" classname="com.gitblit.build.BuildThumbnails">
- <classpath refid="master-classpath" />
-
- <arg value="--sourceFolder" />
- <arg value="${basedir}/docs/screenshots" />
-
- <arg value="--destinationFolder" />
- <arg value="${project.site.dir}/thumbs" />
-
- <arg value="--maximumDimension" />
- <arg value="250" />
- </java>
+ <mx:thumbs input="png" output="png" maximumDimension="250"
+ sourceDir="${project.siteSourceDirectory}/screenshots"
+ destDir="${project.siteTargetDirectory}/thumbs" />
<!-- Copy screenshots -->
- <mkdir dir="${project.site.dir}/screenshots" />
- <copy todir="${project.site.dir}/screenshots">
- <fileset dir="${basedir}/docs/screenshots">
+ <mkdir dir="${project.siteTargetDirectory}/screenshots" />
+ <copy todir="${project.siteTargetDirectory}/screenshots">
+ <fileset dir="${project.siteSourceDirectory}/screenshots">
<include name="*.png" />
</fileset>
</copy>
- <!-- Build site pages -->
- <java classpath="${project.build.dir}" classname="com.gitblit.build.BuildSite">
- <classpath refid="master-classpath" />
- <arg value="--sourceFolder" />
- <arg value="${basedir}/docs" />
-
- <arg value="--outputFolder" />
- <arg value="${project.site.dir}" />
-
- <arg value="--pageHeader" />
- <arg value="${basedir}/docs/site_header.html" />
-
- <arg value="--pageFooter" />
- <arg value="${basedir}/docs/site_footer.html" />
-
- <arg value="--analyticsSnippet" />
- <arg value="${basedir}/docs/site_analytics.html" />
-
- <arg value="--adSnippet" />
- <arg value="${basedir}/docs/site_ads.html" />
-
- <arg value="--alias" />
- <arg value="index=overview" />
-
- <arg value="--alias" />
- <arg value="properties=settings" />
-
- <arg value="--substitute" />
- <arg value="%VERSION%=${gb.version}" />
-
- <arg value="--substitute" />
- <arg value="%GO%=${distribution.zipfile}" />
-
- <arg value="--substitute" />
- <arg value="%WAR%=${distribution.warfile}" />
-
- <arg value="--substitute" />
- <arg value="%FEDCLIENT%=${fedclient.zipfile}" />
-
- <arg value="--substitute" />
- <arg value="%MANAGER%=${manager.zipfile}" />
-
- <arg value="--substitute" />
- <arg value="%API%=${gbapi.zipfile}" />
-
- <arg value="--substitute" />
- <arg value="%EXPRESS%=${express.zipfile}" />
-
- <arg value="--substitute" />
- <arg value="%BUILDDATE%=${gb.versionDate}" />
-
- <arg value="--substitute" />
- <arg value="%JGIT%=${jgit.version}" />
-
- <arg value="--properties" />
- <arg value="%PROPERTIES%=${basedir}/distrib/gitblit.properties" />
-
- <arg value="--nomarkdown" />
- <arg value="%BEGINCODE%:%ENDCODE%" />
-
- <arg value="--substitute" />
- <arg value=""%BEGINCODE%=<pre class='prettyprint lang-java'>"" />
-
- <arg value="--substitute" />
- <arg value="%ENDCODE%=</pre>" />
-
- <arg value="--regex" />
- <arg value=""\b(issue)(\s*[#]?|-){0,1}(\d+)\b!!!<a href='http://code.google.com/p/gitblit/issues/detail?id=$3'>issue $3</a>"" />
-
- </java>
</target>
<!--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Compile from source, publish binaries, and build & deploy site
+ Build all binaries and site
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-->
- <target name="buildAll" depends="buildAuthority,buildGO,buildWAR,buildExpress,buildFederationClient,buildManager,buildApiLibrary,buildSite">
- <!-- Cleanup -->
- <delete dir="${project.build.dir}" />
- <delete dir="${project.war.dir}" />
- <delete dir="${project.deploy.dir}" />
- <delete dir="${project.express.dir}" />
- </target>
+ <target name="buildAll" depends="buildAuthority,buildGO,buildWAR,buildExpress,buildFederationClient,buildManager,buildApiLibrary,buildSite" />
<!--
@@ -1189,16 +738,7 @@ -->
<target name="updateGhPages" depends="buildSite">
<!-- Build gh-pages branch -->
- <java classpath="${project.build.dir}" classname="com.gitblit.build.BuildGhPages">
- <classpath refid="master-classpath" />
- <arg value="--sourceFolder" />
- <arg value="${basedir}/target/site" />
-
- <arg value="--repository" />
- <arg value="${basedir}" />
-
- <arg value="--obliterate" />
- </java>
+ <mx:ghpages repositorydir="${basedir}" obliterate="true" />
</target>
@@ -1207,69 +747,51 @@ Publish binaries to Google Code
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-->
- <target name="publishBinaries" depends="buildGO,buildWAR,buildExpress,buildFederationClient,buildManager,buildApiLibrary" description="Publish the Gitblit binaries to Google Code">
+ <target name="publishBinaries" depends="clean,buildGO,buildWAR,buildExpress,buildFederationClient,buildManager,buildApiLibrary" description="Publish the Gitblit binaries to Google Code">
+
+ <echo>Uploading Gitblit ${project.version} binaries</echo>
- <echo>Uploading Gitblit ${gb.version} binaries</echo>
+ <!-- Upload Gitblit GO Windows ZIP file -->
+ <mx:gcupload
+ sourceFile="${distribution.zipfile}"
+ targetFile="gitblit-${project.version}.zip"
+ description="Gitblit GO v${project.version} (standalone, integrated Gitblit server for Windows)" />
- <!-- Upload Gitblit GO ZIP file -->
- <gcupload
- username="${googlecode.user}"
- password="${googlecode.password}"
- projectname="gitblit"
- filename="${project.target.dir}/${distribution.zipfile}"
- targetfilename="gitblit-${gb.version}.zip"
- summary="Gitblit GO v${gb.version} (standalone, integrated Gitblit server)"
- labels="Featured, Type-Package, OpSys-All" />
+ <!-- Upload Gitblit GO Linux/Unix tar.gz file -->
+ <mx:gcupload
+ sourceFile="${distribution.tgzfile}"
+ targetFile="gitblit-${project.version}.tar.gz"
+ description="Gitblit GO v${project.version} (standalone, integrated Gitblit server for Linux/Unix)" />
<!-- Upload Gitblit WAR file -->
- <gcupload
- username="${googlecode.user}"
- password="${googlecode.password}"
- projectname="gitblit"
- filename="${project.target.dir}/${distribution.warfile}"
- targetfilename="gitblit-${gb.version}.war"
- summary="Gitblit WAR v${gb.version} (standard WAR webapp for servlet containers)"
- labels="Featured, Type-Package, OpSys-All" />
+ <mx:gcupload
+ sourceFile="${distribution.warfile}"
+ targetFile="gitblit-${project.version}.war"
+ description="Gitblit WAR v${project.version} (standard WAR webapp for servlet containers)" />
<!-- Upload Gitblit FedClient -->
- <gcupload
- username="${googlecode.user}"
- password="${googlecode.password}"
- projectname="gitblit"
- filename="${project.target.dir}/${fedclient.zipfile}"
- targetfilename="fedclient-${gb.version}.zip"
- summary="Gitblit Federation Client v${gb.version} (command-line tool to clone data from federated Gitblit instances)"
- labels="Featured, Type-Package, OpSys-All" />
+ <mx:gcupload
+ sourceFile="${fedclient.zipfile}"
+ targetFile="fedclient-${project.version}.zip"
+ description="Gitblit Federation Client v${project.version} (command-line tool to clone data from federated Gitblit instances)" />
<!-- Upload Gitblit Manager -->
- <gcupload
- username="${googlecode.user}"
- password="${googlecode.password}"
- projectname="gitblit"
- filename="${project.target.dir}/${manager.zipfile}"
- targetfilename="manager-${gb.version}.zip"
- summary="Gitblit Manager v${gb.version} (Swing tool to remotely administer a Gitblit server)"
- labels="Featured, Type-Package, OpSys-All" />
+ <mx:gcupload
+ sourceFile="${manager.zipfile}"
+ targetFile="manager-${project.version}.zip"
+ description="Gitblit Manager v${project.version} (Swing tool to remotely administer a Gitblit server)" />
<!-- Upload Gitblit API Library -->
- <gcupload
- username="${googlecode.user}"
- password="${googlecode.password}"
- projectname="gitblit"
- filename="${project.target.dir}/${gbapi.zipfile}"
- targetfilename="gbapi-${gb.version}.zip"
- summary="Gitblit API Library v${gb.version} (JSON RPC library to integrate with your software)"
- labels="Featured, Type-Package, OpSys-All" />
+ <mx:gcupload
+ sourceFile="${gbapi.zipfile}"
+ targetFile="gbapi-${project.version}.zip"
+ description="Gitblit API Library v${project.version} (JSON RPC library to integrate with your software)" />
<!-- Upload Gitblit Express for RedHat OpenShift -->
- <gcupload
- username="${googlecode.user}"
- password="${googlecode.password}"
- projectname="gitblit"
- filename="${project.target.dir}/${express.zipfile}"
- targetfilename="express-${gb.version}.zip"
- summary="Gitblit Express v${gb.version} (run Gitblit on RedHat's OpenShift cloud)"
- labels="Featured, Type-Package, OpSys-All" />
+ <mx:gcupload
+ sourceFile="${express.zipfile}"
+ targetFile="express-${project.version}.zip"
+ description="Gitblit Express v${project.version} (run Gitblit on RedHat's OpenShift cloud)" />
</target>
@@ -1280,9 +802,9 @@ You must add ext/commons-net-1.4.0.jar to your ANT classpath.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-->
- <target name="publishSite" depends="buildSite,updateGhPages" description="Publish the Gitblit site to a webserver (requires ext/commons-net-1.4.0.jar)" >
+ <target name="publishSite" depends="clean,buildSite,updateGhPages" description="Publish the Gitblit site to a webserver (requires ext/commons-net-1.4.0.jar)" >
- <echo>Uploading Gitblit ${gb.version} website</echo>
+ <echo>Uploading Gitblit ${project.version} website</echo>
<ftp server="${ftp.server}"
userid="${ftp.user}"
@@ -1290,7 +812,7 @@ remotedir="${ftp.dir}"
passive="true"
verbose="yes">
- <fileset dir="${project.site.dir}" />
+ <fileset dir="${project.siteTargetDirectory}" />
</ftp>
</target>
@@ -1300,10 +822,189 @@ Compile from source, publish binaries, and build & deploy site
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-->
- <target name="publishAll" depends="publishBinaries,publishSite">
- <!-- Cleanup -->
- <delete dir="${project.build.dir}" />
- <delete dir="${project.war.dir}" />
- <delete dir="${project.deploy.dir}" />
+ <target name="publishAll" depends="publishBinaries,publishSite" />
+
+
+ <!--
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Tag a new version and prepare for the next development cycle.
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ -->
+ <target name="tagRelease" depends="prepare">
+ <!-- release -->
+ <property name="dryrun" value="false" />
+ <mx:version stage="release" dryrun="${dryrun}" />
+ <!-- commit build.moxie & releases.moxie (automatic) -->
+ <mx:commit showtitle="no">
+ <message>Prepare ${project.version} release</message>
+ <tag name="v${project.version}">
+ <message>${project.name} ${project.version} release</message>
+ </tag>
+ </mx:commit>
+
+ <!-- next cycle -->
+ <mx:version stage="snapshot" incrementNumber="incremental" dryrun="${dryrun}" />
+ <mx:commit showtitle="no">
+ <message>Reset build identifiers for next development cycle</message>
+ </mx:commit>
</target>
+
+
+ <!--
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Build Gitblit Docs
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ -->
+ <macrodef name="generateDocs">
+ <attribute name="toDir"/>
+ <sequential>
+ <mx:doc toDir="@{toDir}" minify="true" customless="custom.less">
+ <structure>
+ <menu name="about">
+ <page name="overview" src="siteindex.mkd" out="index.html" headerLinks="false" />
+ <page name="features" src="features.mkd" />
+ </menu>
+ <menu name="documentation">
+ <page name="setup" src="setup.mkd" />
+ <page name="federation" src="federation.mkd" />
+ <divider />
+ <page name="faq" src="faq.mkd" />
+ <page name="settings" src="properties.mkd" />
+ <divider />
+ <page name="design" src="design.mkd" />
+ <page name="rpc" src="rpc.mkd" />
+ </menu>
+ <menu name="changelog">
+ <page name="current release" src="releasecurrent.mkd" />
+ <page name="older releases" src="releasehistory.mkd" />
+ </menu>
+ <menu name="links">
+ <link name="Demo" src="https://demo-gitblit.rhcloud.com" />
+ <divider />
+ <link name="Github" src="${project.scmUrl}" />
+ <link name="Issues" src="${project.issuesUrl}" />
+ <link name="Discussion" src="${project.forumUrl}" />
+ <link name="Google+" src="${project.socialNetworkUrl}" />
+ <link name="Ohloh" src="http://www.ohloh.net/p/gitblit" />
+ </menu>
+ </structure>
+
+ <properties token="%PROPERTIES%" file="${project.distrib.dir}/data/gitblit.properties" />
+
+ <regex searchPattern="\b(issue)(\s*[#]?|-){0,1}(\d+)\b" replacePattern="<a href='http://code.google.com/p/gitblit/issues/detail?id=$3'>issue $3</a>" />
+
+ <!-- Set the logo from the mx:doc resources -->
+ <logo file="${project.resources.dir}/gitblt_25_white.png" />
+ <favicon file="${project.resources.dir}/gitblt-favicon.png" />
+
+ <resource>
+ <fileset dir="${project.resources.dir}">
+ <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" />
+ <include name="federated_16x16.png" />
+ <include name="arrow_page.png" />
+ </fileset>
+ </resource>
+ </mx:doc>
+ </sequential>
+ </macrodef>
+
+ <!--
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Macro to create a pristine data directory for the target build
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ -->
+ <macrodef name="prepareDataDirectory">
+ <attribute name="toDir"/>
+ <sequential>
+ <mkdir dir="@{toDir}" />
+ <copy todir="@{toDir}" overwrite="false">
+ <fileset dir="${project.distrib.dir}/data">
+ <include name="users.conf" />
+ <include name="projects.conf" />
+ <include name="gitblit.properties" />
+ </fileset>
+ </copy>
+ <mkdir dir="@{toDir}/groovy" />
+ <copy todir="@{toDir}/groovy">
+ <fileset dir="${project.distrib.dir}/data/groovy">
+ <include name="sendmail.groovy" />
+ <include name="sendmail-html.groovy" />
+ <include name="jenkins.groovy" />
+ <include name="protect-refs.groovy" />
+ <include name="fogbugz.groovy" />
+ <include name="thebuggenie.groovy" />
+ </fileset>
+ </copy>
+ </sequential>
+ </macrodef>
+
+ <!--
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Macro to upload binaries to GoogleCode
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ -->
+ <macrodef name="googleUpload">
+ <attribute name="sourceFile"/>
+ <attribute name="targetFile"/>
+ <attribute name="description"/>
+ <sequential>
+ <gcupload
+ username="${googlecode.user}"
+ password="${googlecode.password}"
+ projectname="gitblit"
+ filename="${project.targetDirectory}/@{sourceFile}"
+ targetfilename="@{targetFile}"
+ summary="@{description}"
+ labels="Featured, Type-Package, OpSys-All" />
+ </sequential>
+ </macrodef>
+
+
+ <!--
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Install Gitblit JAR for usage as Maven module
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ -->
+ <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" />
+ <mx:jar destfile="${project.jar}" includeresources="true" />
+
+ <exec executable="mvn">
+ <arg value="install:install-file" />
+ <arg value="-Dfile=${project.jar}" />
+ <arg value="-DpomFile=${basedir}/pom.xml" />
+ <arg value="-DcreateChecksum=true" />
+ </exec>
+ </target>
+
+ <!--
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Upload Gitblit JAR to remote Maven repository
+
+ build.properties:
+ project.maven.repo.url = http://whatever.com/maven2
+ project.maven.repo.id = whateverId
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ -->
+ <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" />
+
+ <exec executable="mvn">
+ <arg value="deploy:deploy-file" />
+ <arg value="-Dfile=${project.jar}" />
+ <arg value="-DpomFile=${basedir}/pom.xml" />
+ <arg value="-Durl=${project.maven.repo.url}" />
+ <arg value="-DrepositoryId=${project.maven.repo.id}" />
+ <arg value="-DcreateChecksum=true" />
+ </exec>
+ </target>
</project>
|