[376211] WTP needs to move from CVS to Git
diff --git a/releng.wtpbuilder/build.properties b/releng.wtpbuilder/build.properties
index 647935d..84f7944 100644
--- a/releng.wtpbuilder/build.properties
+++ b/releng.wtpbuilder/build.properties
@@ -49,5 +49,6 @@
 
 #repoBaseLocation=${buildDirectory}/${buildLabel}/repository
 transformedRepoLocation=${buildDirectory}/transformedRepo
+fetchCacheLocation=${buildDirectory}/fetchCacheLocation
 
 cvs.reallyquiet=true
diff --git a/releng.wtpbuilder/build.xml b/releng.wtpbuilder/build.xml
index 044f5a5..a85a305 100644
--- a/releng.wtpbuilder/build.xml
+++ b/releng.wtpbuilder/build.xml
@@ -179,7 +179,7 @@
         -->
         <condition
             property="fetchTag"
-            value="HEAD">
+            value="CVS=HEAD,GIT=origin/master">
             <equals
                 arg1="${buildType}"
                 arg2="N"/>
diff --git a/releng.wtpbuilder/scripts/build/runbuild.xml b/releng.wtpbuilder/scripts/build/runbuild.xml
index 5b1e3d2..43826a2 100644
--- a/releng.wtpbuilder/scripts/build/runbuild.xml
+++ b/releng.wtpbuilder/scripts/build/runbuild.xml
@@ -170,6 +170,14 @@
 
         <ant
             antfile="${wtp.builder.home}/scripts/dependency/dependency.xml"
+            target="prereq.egit"/>
+
+        <ant
+            antfile="${wtp.builder.home}/scripts/dependency/dependency.xml"
+            target="prereq.gitfetchfactory"/>
+
+        <ant
+            antfile="${wtp.builder.home}/scripts/dependency/dependency.xml"
             target="prereq.wtpbuildtools"/>
         
         <!-- remember, we install wtp tools only when eclipse builder is installed, 
@@ -336,7 +344,7 @@
         -->
         <condition
             property="fetchTag"
-            value="HEAD">
+            value="CVS=HEAD,GIT=origin/master">
             <equals
                 arg1="${buildType}"
                 arg2="N"/>
diff --git a/releng.wtpbuilder/scripts/dependency/build.xml b/releng.wtpbuilder/scripts/dependency/build.xml
index 8399e45..c12447a 100644
--- a/releng.wtpbuilder/scripts/dependency/build.xml
+++ b/releng.wtpbuilder/scripts/dependency/build.xml
@@ -316,7 +316,7 @@
     </target>
 
     <target name="installDependency">
-        <echo message="grouopId: ${groupId}"/>
+        <echo message="groupId: ${groupId}"/>
         <echo message="install.destination: ${install.destination}"/>
         <dirname
             file="${ant.file}"
@@ -395,7 +395,42 @@
 
     </target>
 
+	
+    <target name="installRepoFromURL">
+        <dirname
+            file="${ant.file}"
+            property="dependency.dir"/>
 
+        <copy tofile="${installWorkingDirectory}/dependency.${groupId}.xml">
+            <fileset dir="${dependency.dir}">
+                <include name="template.xml"/>
+            </fileset>
+        </copy>
+        <replace
+            file="${installWorkingDirectory}/dependency.${groupId}.xml"
+            value="${groupId}.">
+            <replacetoken>@dependencyGroupId@</replacetoken>
+        </replace>
+        <replace
+            file="${installWorkingDirectory}/dependency.${groupId}.xml"
+            value="${dependency.dir}">
+            <replacetoken>@dependencyDir@</replacetoken>
+        </replace>
+        <replace
+            file="${installWorkingDirectory}/dependency.${groupId}.xml"
+            value="${dependency.properties}">
+            <replacetoken>@dependencyProperties@</replacetoken>
+        </replace>
+
+        <ant
+            antfile="${installWorkingDirectory}/dependency.${groupId}.xml"
+            target="installRepoFromURL">
+            <property
+                name="install.destination"
+                value="${install.destination}"/>
+        </ant>
+
+    </target>
 
 </project>
 
diff --git a/releng.wtpbuilder/scripts/dependency/dependency.xml b/releng.wtpbuilder/scripts/dependency/dependency.xml
index 325aaa3..7c1e5db 100644
--- a/releng.wtpbuilder/scripts/dependency/dependency.xml
+++ b/releng.wtpbuilder/scripts/dependency/dependency.xml
@@ -85,7 +85,7 @@
         <antcall target="prereq.dalitests"/>
     </target>
 
-<!--  Note: this target is called from "install base buider" routines, not "install prereqs" like most targets here -->
+<!--  Note: this target is called from "install base builder" routines, not "install prereqs" like most targets here -->
     <target name="prereq.eclipsebuilder">
         <echo message="eclipse builder being installed to: ${eclipse.builder.base.install.dir}"/>
         <mkdir dir="${eclipse.builder.base.install.dir}"/>
@@ -98,7 +98,31 @@
                 value="${eclipse.builder.base.install.dir}"/>
         </antcall>
     </target>
-    <!--  Note: this target is called from "install base buider" routines, not "install prereqs" like most targets here -->
+	<!--  Note: this target is called from "install base builder" routines, not "install prereqs" like most targets here -->
+	    <target name="prereq.egit">
+	        <echo message="EGit being installed to: ${eclipse.builder.base.install.dir}"/>
+	        <antcall target="getAndInstallRepoFromURL">
+	            <param
+	                name="groupId"
+	                value="egit"/>
+	            <param
+	                name="base.install.dir"
+	                value="${eclipse.builder.base.install.dir}"/>
+	        </antcall>
+	    </target>
+	<!--  Note: this target is called from "install base builder" routines, not "install prereqs" like most targets here -->
+	    <target name="prereq.gitfetchfactory">
+	        <echo message="Git fetch factory being installed to: ${eclipse.builder.base.install.dir}"/>
+	        <antcall target="getAndInstallRepoFromURL">
+	            <param
+	                name="groupId"
+	                value="gitFetchFactory"/>
+	            <param
+	                name="base.install.dir"
+	                value="${eclipse.builder.base.install.dir}"/>
+	        </antcall>
+	    </target>
+    <!--  Note: this target is called from "install base builder" routines, not "install prereqs" like most targets here -->
     <target name="prereq.wtpbuildtools">
         <echo level="debug" message="wtp build tools installing to: ${pde.builder.path}"/>
          <!-- TODO could check if ${eclipse.builder.base.install.dir} exists, since would be error if not -->
@@ -396,6 +420,27 @@
                 value="${base.install.dir}"/>
         </ant>
     </target>
+	<target
+	        name="getAndInstallRepoFromURL"
+	        if="${groupId}.url">
+	        <ant
+	            antfile="${dependencyTargets}"
+	            target="checkDependency">
+	            <property
+	                name="groupId"
+	                value="${groupId}"/>
+	        </ant>
+	        <ant
+	            antfile="${dependencyTargets}"
+	            target="installRepoFromURL">
+	            <property
+	                name="groupId"
+	                value="${groupId}"/>
+	            <property
+	                name="install.destination"
+	                value="${base.install.dir}"/>
+	        </ant>
+	    </target>
      <!-- use getAndInstallFramework to decide based on whether or not 'tobeinstalledfeaturegroups' exists -->
     <target
         name="getAndInstallFramework"
diff --git a/releng.wtpbuilder/scripts/dependency/template.xml b/releng.wtpbuilder/scripts/dependency/template.xml
index 208e16f..1ab58d7 100644
--- a/releng.wtpbuilder/scripts/dependency/template.xml
+++ b/releng.wtpbuilder/scripts/dependency/template.xml
@@ -326,4 +326,57 @@
             target="install"/>
     </target>
 
+    <target
+        name="installRepoFromURL"
+        depends="init">
+    	<echo message="Installing ${dependency.repo}"/>
+    	<echo message="destination: ${install.destination}"/>
+        <antcall target="cleanInstall"/>
+        <property file="${installWorkingDirectory}/installmanifest.properties"/>
+    	<echo message="install repo for groupId: ${groupId}"/>
+        <echo message="URL: ${dependency.url}"/>
+        <echo message="tobeInstalledfeaturegroups:  ${dependency.tobeinstalledfeaturegroups}"/>
+<!-- note we are deliberately running the eclipse we are installing into -->
+        <java
+            taskname="p2Director Install"
+            fork="true"
+            resultProperty="p2DirectorInstallResult"
+            failonerror="true"
+            jvm="${env.JAVA_6_HOME}/bin/java"
+            dir="${install.destination}"
+            classname="org.eclipse.equinox.launcher.Main">
+            <classpath>
+                <fileset dir="${install.destination}/eclipse/plugins">
+                    <include name="org.eclipse.equinox.launcher_*.jar"/>
+                </fileset>
+            </classpath>
+            <jvmarg value="-Djava.io.tmpdir=${env.RECOMMENDED_TMP_DIR}"/>
+            <arg value="-nosplash"/>
+            <arg value="-debug"/>
+            <arg value="-consolelog"/>
+            <arg value="-data"/>
+            <arg value="${installWorkingDirectory}/p2DirectorInstall"/>
+            <arg value="-application"/>
+            <arg value="org.eclipse.equinox.p2.director"/>
+
+            <arg value="-repository"/>
+            <arg value="${dependency.url}"/>
+
+
+            <arg value="-installIU"/>
+            <arg value="${dependency.tobeinstalledfeaturegroups}"/>
+
+            <arg value="-list"/>
+
+
+            <!-- make sure our forked env has a DISPLAY? -->
+            <env
+                key="DISPLAY"
+                value="${env.DISPLAY}"/>
+
+            <arg value="-vmArgs"/>
+
+        </java>
+    	<echo message="p2DirectorInstallResult: ${p2DirectorInstallResult}"/>
+    </target>
 </project>
\ No newline at end of file