]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Provide a way to update config files[target.txt, tools_def.txt, FrameworkDatabase...
authorwuyizhong <wuyizhong@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 17 Oct 2006 07:07:24 +0000 (07:07 +0000)
committerwuyizhong <wuyizhong@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 17 Oct 2006 07:07:24 +0000 (07:07 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1773 6f19259b-4bc3-4df7-8a09-765794883524

Tools/build.xml
edksetup.bat

index caef839b504b61d63667032a2a18e4f2b1d5d10a..9d4e6dbc3903a47080f2cff404f21357dde1c831 100644 (file)
@@ -119,6 +119,55 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
     </if>\r
   </target>\r
 \r
+  <target name="reconfig">\r
+    <!-- backup all config files -->\r
+    <if>\r
+      <available file="Conf/target.txt"/>\r
+      <then>\r
+        <echo message="Backup Conf/target.txt to Conf/target.txt.bak" />\r
+        <copy file="Conf/target.txt" tofile="Conf/target.txt.bak" overwrite="true" />\r
+      </then>\r
+    </if>\r
+    <if>\r
+      <available file="Conf/tools_def.txt"/>\r
+      <then>\r
+        <echo message="Backup Conf/tools_def.txt to Conf/tools_def.txt.bak" />\r
+        <copy file="Conf/tools_def.txt" tofile="Conf/tools_def.txt.bak"  overwrite="true" />\r
+      </then>\r
+    </if>\r
+    <if>\r
+      <available file="Conf/FrameworkDatabase.db"/>\r
+      <then>\r
+        <echo message="Backup Conf/FrameworkDatabase.db to Conf/FrameworkDatabase.db.bak" />\r
+        <copy file="Conf/FrameworkDatabase.db" tofile="Conf/FrameworkDatabase.db.bak"  overwrite="true" />\r
+      </then>\r
+    </if>\r
+    \r
+    <if>\r
+      <available file="Conf/tools_def.template"/>\r
+      <then>\r
+        <echo message="Copy file from Conf/tools_def.template to Conf/tools_def.txt" />\r
+        <copy file="Conf/tools_def.template" tofile="Conf/tools_def.txt" overwrite="true" />\r
+      </then>\r
+    </if>\r
+\r
+    <if>\r
+      <available file="Conf/target.template"/>\r
+      <then>\r
+        <echo message="Copy file from Conf/target.template to Conf/target.txt" />\r
+        <copy file="Conf/target.template" tofile="Conf/target.txt" overwrite="true" />\r
+      </then>\r
+    </if>\r
+\r
+    <if>\r
+      <available file="Conf/FrameworkDatabase.template"/>\r
+      <then>\r
+        <echo message="Copy file from Conf/FrameworkDatabase.template to Conf/FrameworkDatabase.db" />\r
+        <copy file="Conf/FrameworkDatabase.template" tofile="Conf/FrameworkDatabase.db" overwrite="true" />\r
+      </then>\r
+    </if>\r
+  </target>\r
+\r
   <target name="clean">\r
     <subant target="clean" inheritall="false">\r
       <filelist dir="."\r
index 333f061eabc9ac3246693f1885e1409e9256331f..7fabe4690e921b6d2be5a841258f983a03f2e380 100644 (file)
@@ -15,7 +15,7 @@
 @REM set XMLBEANS_HOME=C:\xmlbeans\r
 @REM set CYGWIN_HOME=C:\cygwin\r
 \r
-@REM usage: edksetup.bat [Rebuild] [ForceRebuild]\r
+@REM usage: edksetup.bat [Rebuild] [ForceRebuild] [Reconfig]\r
 @REM if the argument, skip is present, only the paths and the\r
 @REM test and set of environment settings are performed. \r
 \r
@@ -90,6 +90,8 @@ echo Resetting the PATH variable to include the FRAMEWORK_TOOLS_PATH for this WO
 @if "%1"=="/h" goto Usage\r
 @if "%1"=="/?" goto Usage\r
 @if "%1"=="/help" goto Usage\r
+@if "%1"=="ForceRebuild" goto ForceBuild\r
+@if "%1"=="Reconfig" goto Reconfig\r
 \r
 @IF NOT EXIST "Tools\Jars\Common.jar" goto NormalBuild\r
 @IF NOT EXIST "Tools\Jars\PcdTools.jar" goto NormalBuild\r
@@ -131,7 +133,6 @@ echo Resetting the PATH variable to include the FRAMEWORK_TOOLS_PATH for this WO
 @IF NOT EXIST "Tools\bin\dlg.exe" goto NormalBuild\r
 \r
 @if "%1"=="Rebuild" goto NormalBuild\r
-@if "%1"=="ForceRebuild" goto ForceBuild\r
 @if NOT "%1"=="" goto Usage\r
 \r
 goto skipbuild\r
@@ -250,9 +251,23 @@ set CLASSPATH=%CLASSPATH%;%WORKSPACE%\Tools\Bin\MigrationTools.jar
 echo CLASSPATH:     %CLASSPATH%\r
 goto end\r
 \r
+:Reconfig\r
+@REM\r
+@REM Reinstall all config files\r
+@REM\r
+call ant -f %WORKSPACE%\Tools\build.xml reconfig\r
+goto end\r
+\r
 :Usage\r
 echo.\r
-echo  Usage: %0 [Rebuild] [ForceRebuild]\r
+echo  Usage: %0 [Rebuild] [ForceRebuild] [Reconfig]\r
+echo         Rebuild:       Incremental build, only build those updated tools; \r
+echo         ForceRebuild:  Rebuild all tools neither updated or not; \r
+echo         Reconfig:      Reinstall target.txt, tools_def.txt, FrameworkDatabase.db. \r
+echo.\r
+echo  Note that target.template, tools_def.template, FrameworkDatabase.template will be\r
+echo  only copied to target.txt, tools_def.txt, FrameworkDatabase.db respectively if they\r
+echo  are not existed. Using option [Reconfig] to do the force copy. \r
 echo.\r
 \r
 :end\r