[tasque/xbuild] [xbuild] Override BeforeBuild target



commit 865931354168b648a29e23bbc6034c2280b5a8f9
Author: Antonius Riha <antoniusriha gmail com>
Date:   Tue Sep 18 12:28:06 2012 +0200

    [xbuild] Override BeforeBuild target
    
    The build and AltTarget
    -----------------------
    
    This is the main build target of Tasque. Though it primarily serves
    as the entry point to compile Tasque, it also provides a way to trigger
    other targets if the AltTarget property so indicates.
    
    Explanation: The VS solution file format only allows a limited set of
    targets (standard targets). But autotools use a greater variety of targets
    (e.g. dist, install, uninstall, ...). Therefore an alternative way to trigger those
    targets has been established.
    
    If the target "build" is executed and the "AltTarget" property is empty,
    Tasque builds as usual. If however the "AltTarget" property has not empty
    and its value represents a valid target in the project file, that target is
    executed.
    
    To prohibit interference with the regular build (conducted by
    Microsoft.Common.targets proj) during an AltTarget build, the regular build
    path is cut short by tweaking the BuildDependsOn property.
    
    A regular build (non-AltTarget build) includes the execution of
    	* Substitute
    	* GettextCompile
    	* Translate
    	* BeforeTasqueCompile
    before the execution control is handed back to Microsoft.Common.targets.

 build/Tasque.targets |   22 ++++++++++++++++++++++
 1 files changed, 22 insertions(+), 0 deletions(-)
---
diff --git a/build/Tasque.targets b/build/Tasque.targets
index d725b21..f3aefe7 100644
--- a/build/Tasque.targets
+++ b/build/Tasque.targets
@@ -75,6 +75,28 @@
     <Exec Command="$(MsgFmt) -o %(FileName).gmo $(PoSrcDir)\@(GettextCompile)" />
   </Target>
   
+  <!-- Build -->
+  <!-- Switch between regular targets and alternative targets -->
+  <PropertyGroup Condition=" '$(AltTarget)' != '' ">
+    <BuildDependsOn>
+      BeforeBuild;
+      AfterBuild;
+    </BuildDependsOn>
+  </PropertyGroup>
+  
+  <PropertyGroup>
+    <TasqueBuildDependsOn>
+      Substitute;
+      GettextCompile;
+      Translate;
+      BeforeTasqueBuild;
+    </TasqueBuildDependsOn>
+    <TasqueBuildDependsOn Condition=" '$(AltTarget)' != '' ">$(AltTarget)</TasqueBuildDependsOn>
+  </PropertyGroup>
+
+  <Target Name="BeforeBuild" DependsOnTargets="$(TasqueBuildDependsOn)" />
+  <Target Name="BeforeTasqueBuild" />
+  
   <!-- Uninstall -->
   <Target Name="Uninstall" DependsOnTargets="BeforeUninstall;CoreUninstall;AfterUninstall" />
   <Target Name="BeforeUninstall" />



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]