[tasque/xbuild] [build] Couple build and install targets



commit 6fd70715772c5949ed25e92b8402c1f3e667a51b
Author: Antonius Riha <antoniusriha gmail com>
Date:   Thu Sep 20 16:38:47 2012 +0200

    [build] Couple build and install targets
    
    For better integration with MD on Linux, the install target is now
    executed autoamtically after build is finished (it's hooked into
    AfterBuild). This behavior is controlled by the property "AutoInstall",
    which defaults to true. The same goes for the clean and uninstall
    targets.
    
    Because this behavior is not expected when doing "configure && \
    make && make install" "AutoInstall" is set to false in the Makefile.
    
    To enable debugging/running Tasque from within MD a custom
    command has been set up for execution on the tasque project.

 Makefile.am              |    3 ++-
 build/Tasque.targets     |   28 ++++++++++++++++++++++++++--
 src/tasque/tasque.csproj |   10 ++++++++++
 3 files changed, 38 insertions(+), 3 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index e33c9c0..b2f485f 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -72,7 +72,8 @@ PROPERTIES = \
 	/property:EnableBackendIceCore=$(enable_backend_icecore) \
 	/property:EnableBackendEds=$(enable_backend_eds) \
 	/property:EnableBackendHiveminder=$(enable_backend_hiveminder) \
-	/property:EnableBackendRtm=$(enable_backend_rtm)
+	/property:EnableBackendRtm=$(enable_backend_rtm) \
+	/property:AutoInstall="false"
 
 pkgdata_DATA =  $(DLL_REFERENCES)
 
diff --git a/build/Tasque.targets b/build/Tasque.targets
index 9e247c6..6a71c02 100644
--- a/build/Tasque.targets
+++ b/build/Tasque.targets
@@ -3,6 +3,9 @@
   <PropertyGroup>
     <BuildingSolutionFile>True</BuildingSolutionFile>
     <BuildEnabled Condition=" '$(BuildEnabled)' == '' ">true</BuildEnabled>
+    <AutoInstall Condition=" '$(AutoInstall)' == '' ">true</AutoInstall>
+    <!-- if AltTarget is set, disable AutoInstall -->
+    <AutoInstall Condition=" '$(AltTarget)' != '' ">false</AutoInstall>
 
     <!-- Global dirs -->
     <OutputPath>.</OutputPath>
@@ -120,8 +123,30 @@
   <Target Name="BeforeBuild" DependsOnTargets="$(TasqueBuildDependsOn)" />
   <Target Name="BeforeTasqueBuild" />
   
+  <PropertyGroup>
+    <AfterBuildDependsOn>
+      Install;
+      AfterTasqueBuild;
+    </AfterBuildDependsOn>
+    <AfterBuildDependsOn Condition=" !'$(AutoInstall)' ">AfterTasqueBuild</AfterBuildDependsOn>
+  </PropertyGroup>
+  
+  <Target Name="AfterBuild"  DependsOnTargets="$(AfterBuildDependsOn)" />
+  <Target Name="AfterTasqueBuild" />
+  
   <!-- Clean -->
-  <Target Name="AfterClean" DependsOnTargets="BeforeTasqueClean">
+  <PropertyGroup>
+    <BeforeCleanDependsOn>
+      BeforeTasqueClean;
+      Uninstall;
+    </BeforeCleanDependsOn>
+    <BeforeCleanDependsOn Condition=" !'$(AutoInstall)' ">BeforeTasqueClean</BeforeCleanDependsOn>
+  </PropertyGroup>
+  
+  <Target Name="BeforeClean" DependsOnTargets="$(BeforeCleanDependsOn)" />
+  <Target Name="BeforeTasqueClean" />
+  
+  <Target Name="AfterClean">
     <CreateItem Condition=" '@(Translate)' != '' " Include="%(Translate.RelativeDir)%(Translate.FileName)">
       <Output TaskParameter="Include" ItemName="TasqueCleanFile" />
     </CreateItem>
@@ -133,7 +158,6 @@
     </CreateItem>
     <Delete Files="@(TasqueCleanFile)" />
   </Target>
-  <Target Name="BeforeTasqueClean" />
   
   <!-- Install -->
   <PropertyGroup>
diff --git a/src/tasque/tasque.csproj b/src/tasque/tasque.csproj
index 59fb397..6368737 100644
--- a/src/tasque/tasque.csproj
+++ b/src/tasque/tasque.csproj
@@ -22,11 +22,21 @@
     <DebugType>full</DebugType>
     <Optimize>false</Optimize>
     <DefineConstants>TRACE;DEBUG;LINUX</DefineConstants>
+    <CustomCommands>
+      <CustomCommands>
+        <Command type="Execute" command="${SolutionDir}/build/bin/lib/tasque/Tasque.exe" />
+      </CustomCommands>
+    </CustomCommands>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'GtkLinuxRelease|AnyCPU' ">
     <DebugType>none</DebugType>
     <Optimize>true</Optimize>
     <DefineConstants>TRACE;LINUX</DefineConstants>
+    <CustomCommands>
+      <CustomCommands>
+        <Command type="Execute" command="${SolutionDir}/build/bin/lib/tasque/Tasque.exe" />
+      </CustomCommands>
+    </CustomCommands>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'GtkWinDebug|AnyCPU' ">
     <DebugSymbols>true</DebugSymbols>



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