From 10177fb0a59cc9fc61fb78c724f7b0816b69b798 Mon Sep 17 00:00:00 2001
From: James Moger <james.moger@gitblit.com>
Date: Sat, 01 Oct 2011 15:50:22 -0400
Subject: [PATCH] CSS fixes for palette buttons

---
 build.xml |  177 ++++++++++++++++++++++++++++++++++++++++++++++++++---------
 1 files changed, 150 insertions(+), 27 deletions(-)

diff --git a/build.xml b/build.xml
index e1981a1..9a58971 100644
--- a/build.xml
+++ b/build.xml
@@ -2,7 +2,11 @@
 <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"/>
+	<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" />
@@ -12,9 +16,19 @@
 	<property name="project.war.dir" value="${basedir}/war" />
 	<property name="project.site.dir" value="${basedir}/site" />
 	<property name="project.resources.dir" value="${basedir}/resources" />	
+	<available property="hasBuildProps" file="${basedir}/build.properties"/>
 
-	<!-- Load publication servers, paths, and credentials --> 
-	<loadproperties srcfile="${basedir}/build.properties" />
+	<!--
+		~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+		Load build.properties, if available
+		~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+	-->
+	<target name="buildprops" if="hasBuildProps">
+		<!-- Load publication servers, paths, and credentials --> 
+		<loadproperties>
+			<file file="${basedir}/build.properties" />
+		</loadproperties>
+	</target>
 	
 	
 	<!--
@@ -22,11 +36,7 @@
 		Scrape the version info from code and setup the build properties 
 		~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 	-->
-	<target name="buildinfo">
-		<!-- build date -->
-		<tstamp>
-			<format property="gb.buildDate" pattern="yyyy-MM-dd" />
-		</tstamp>
+	<target name="buildinfo" depends="buildprops">
 	
 		<!-- extract Gitblit version number from source code -->
 		<loadfile property="gb.version" srcfile="${basedir}/src/com/gitblit/Constants.java">
@@ -42,7 +52,22 @@
 				</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 = &quot;" to="" />
+					<replacestring from="&quot;;" to="" />
+					<trim />
+				</tokenfilter>
+			</filterchain>
+		</loadfile>
+					
 		<!-- extract JGit version number from source code -->
 		<loadfile property="jgit.version" srcfile="${basedir}/src/com/gitblit/Constants.java">
 			<filterchain>
@@ -59,6 +84,7 @@
 		</loadfile>	
 		<property name="distribution.zipfile" value="gitblit-${gb.version}.zip" />
 		<property name="distribution.warfile" value="gitblit-${gb.version}.war" />
+		<property name="fedclient.zipfile" value="fedclient-${gb.version}.zip" />
 	</target>
 	
 	
@@ -82,7 +108,7 @@
 
 		<delete dir="${project.build.dir}" />
 		<mkdir dir="${project.build.dir}" />
-		<javac srcdir="${basedir}/src" destdir="${project.build.dir}">
+		<javac debug="true" srcdir="${basedir}/src" destdir="${project.build.dir}">
 			<include name="com/gitblit/build/Build.java" />			
 			<include name="com/gitblit/Constants.java" />
 			<include name="com/gitblit/utils/StringUtils.java" />			
@@ -94,8 +120,9 @@
 			<fileset dir="${basedir}/ext">
 				<include name="*.jar" />
 			</fileset>
+			<pathelement path="${project.build.dir}" />				
 		</path>
-		<javac destdir="${project.build.dir}" failonerror="false">
+		<javac debug="true" destdir="${project.build.dir}" failonerror="false">
 			<src path="${basedir}/src" />
 			<classpath refid="master-classpath" />
 		</javac>
@@ -122,6 +149,11 @@
 		<copy todir="${project.deploy.dir}">
 			<fileset dir="${basedir}/distrib">
 				<include name="**/*" />
+				<exclude name="federation.properties" />
+			</fileset>
+			<fileset dir="${basedir}">
+				<include name="LICENSE" />
+				<include name="NOTICE" />
 			</fileset>
 		</copy>
 
@@ -164,10 +196,10 @@
 			<copy todir="${docs.output.dir}">
 				<!-- Copy selected Gitblit resources -->
 				<fileset dir="${project.resources.dir}">
-					<include name="background.png" />
-					<include name="gitblit.css" />
+					<include name="bootstrap.130.css" />
+					<include name="bootstrap.gb.css" />
 					<include name="markdown.css" />
-					<include name="gitblt_25.png" />
+					<include name="gitblt_25_white.png" />
 					<include name="gitblt-favicon.png" />
 					<include name="lock_go_16x16.png" />
 					<include name="lock_pull_16x16.png" />
@@ -176,6 +208,7 @@
 					<include name="bug_16x16.png" />
 					<include name="book_16x16.png" />
 					<include name="blank.png" />
+					<include name="federated_16x16.png" />
 				</fileset>
 
 				<!-- Copy Doc images -->
@@ -229,14 +262,29 @@
 				<arg value="%WAR%=${distribution.warfile}" />
 
 				<arg value="--substitute" />
-				<arg value="%BUILDDATE%=${gb.buildDate}" />
+				<arg value="%FEDCLIENT%=${fedclient.zipfile}" />
+
+				<arg value="--substitute" />
+				<arg value="%BUILDDATE%=${gb.versionDate}" />
 
 				<arg value="--substitute" />
 				<arg value="%JGIT%=${jgit.version}" />
 
-				<arg value="--load" />
+				<arg value="--properties" />
 				<arg value="%PROPERTIES%=${basedir}/distrib/gitblit.properties" />
 
+				<arg value="--nomarkdown" />
+				<arg value="%BEGINCODE%:%ENDCODE%" />
+
+				<arg value="--substitute" />
+				<arg value="&quot;%BEGINCODE%=&lt;pre class='prettyprint lang-java'&gt;&quot;" />
+
+				<arg value="--substitute" />
+				<arg value="%ENDCODE%=&lt;/pre&gt;" />
+				
+				<arg value="--regex" />
+				<arg value="&quot;\b(issue)(\s*[#]?|-){0,1}(\d+)\b!!!&lt;a href='http://code.google.com/p/gitblit/issues/detail?id=$3'&gt;issue $3&lt;/a&gt;&quot;" />
+		
 			</java>
 	</target>
 	
@@ -259,6 +307,10 @@
 			</fileset>
 			<fileset dir="${basedir}/src/WEB-INF">
 			 	<include name="web.xml" />
+			</fileset>
+			<fileset dir="${basedir}">
+				<include name="LICENSE" />
+				<include name="NOTICE" />
 			</fileset>
 		</copy>
 		
@@ -321,6 +373,45 @@
 	
 	<!-- 
 		~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+		Build the stand-alone, command-line Gitblit Federation Client
+		~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+	-->
+	<target name="buildFederationClient" depends="compile" description="Builds the stand-alone Gitblit federation client">
+		<echo>Building Gitblit Federation Client ${gb.version}</echo>
+	
+		<genjar jarfile="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." />
+			</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>
+		
+		<!-- Build the federation client zip file -->
+		<zip destfile="${fedclient.zipfile}">
+			<fileset dir="${basedir}">
+				<include name="fedclient.jar" />				
+			</fileset>
+			<fileset dir="${basedir}/distrib">
+				<include name="federation.properties" />				
+			</fileset>
+		</zip>
+	</target>
+
+		
+	<!-- 
+		~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 		Build the Gitblit Website
 		~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 	-->
@@ -334,10 +425,10 @@
 		<copy todir="${project.site.dir}">
 			<!-- Copy selected Gitblit resources -->
 			<fileset dir="${project.resources.dir}">
-				<include name="background.png" />
-				<include name="gitblit.css" />
+				<include name="bootstrap.130.css" />
+				<include name="bootstrap.gb.css" />
 				<include name="markdown.css" />
-				<include name="gitblt_25.png" />
+				<include name="gitblt_25_white.png" />
 				<include name="gitblt-favicon.png" />
 				<include name="lock_go_16x16.png" />
 				<include name="lock_pull_16x16.png" />
@@ -346,6 +437,7 @@
 				<include name="bug_16x16.png" />
 				<include name="book_16x16.png" />
 				<include name="blank.png" />
+				<include name="federated_16x16.png" />
 			</fileset>
 
 			<!-- Copy Doc images -->
@@ -404,9 +496,15 @@
 
 			<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" />
@@ -424,15 +522,30 @@
 			<arg value="%WAR%=${distribution.warfile}" />
 
 			<arg value="--substitute" />
-			<arg value="%BUILDDATE%=${gb.buildDate}" />
+			<arg value="%FEDCLIENT%=${fedclient.zipfile}" />
+
+			<arg value="--substitute" />
+			<arg value="%BUILDDATE%=${gb.versionDate}" />
 
 			<arg value="--substitute" />
 			<arg value="%JGIT%=${jgit.version}" />
 
-			<arg value="--load" />
+			<arg value="--properties" />
 			<arg value="%PROPERTIES%=${basedir}/distrib/gitblit.properties" />
+			
+			<arg value="--nomarkdown" />
+			<arg value="%BEGINCODE%:%ENDCODE%" />
 
-		</java>
+			<arg value="--substitute" />
+			<arg value="&quot;%BEGINCODE%=&lt;pre class='prettyprint lang-java'&gt;&quot;" />
+
+			<arg value="--substitute" />
+			<arg value="%ENDCODE%=&lt;/pre&gt;" />
+
+			<arg value="--regex" />
+			<arg value="&quot;\b(issue)(\s*[#]?|-){0,1}(\d+)\b!!!&lt;a href='http://code.google.com/p/gitblit/issues/detail?id=$3'&gt;issue $3&lt;/a&gt;&quot;" />
+
+		</java>	
 	</target>
 		
 
@@ -441,7 +554,7 @@
 		Compile from source, publish binaries, and build & deploy site
 		~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 	-->
-	<target name="buildAll" depends="buildGO,buildWAR,buildSite">		
+	<target name="buildAll" depends="buildGO,buildWAR,buildFederationClient,buildSite">		
 		<!-- Cleanup -->
 		<delete dir="${project.build.dir}" />
 		<delete dir="${project.war.dir}" />
@@ -454,7 +567,7 @@
 		Publish binaries to Google Code
 		~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 	-->
-	<target name="publishBinaries" depends="buildGO,buildWAR" description="Publish the Gitblit binaries to Google Code">
+	<target name="publishBinaries" depends="buildGO,buildWAR,buildFederationClient" description="Publish the Gitblit binaries to Google Code">
 		
 		<echo>Uploading Gitblit ${gb.version} binaries</echo>
 		
@@ -465,7 +578,7 @@
 			 projectname="gitblit" 
 			 filename="${distribution.zipfile}" 
 			 targetfilename="gitblit-${gb.version}.zip"
-			 summary="Standalone, integrated Gitblit server v${gb.version}"
+			 summary="Gitblit GO v${gb.version} (standalone, integrated Gitblit server)"
 			 labels="Featured, Type-Package, OpSys-All" />
 			
 		<!-- Upload WAR file -->
@@ -475,8 +588,18 @@
 		     projectname="gitblit" 
 		     filename="${distribution.warfile}" 
 		     targetfilename="gitblit-${gb.version}.war"
-		     summary="Gitblit WAR v${gb.version} for your servlet container"
+		     summary="Gitblit WAR v${gb.version} (standard WAR webapp for servlet containers)"
 		     labels="Featured, Type-Package, OpSys-All" />
+		
+		<!-- Upload FedClient -->
+		<gcupload 
+			username="${googlecode.user}" 
+			password="${googlecode.password}" 
+			projectname="gitblit" 
+			filename="${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" />
 	</target>
 
 	

--
Gitblit v1.9.1