[tasque/xbuild] [build] Switch tasque build to xbuild



commit d5cf7391b221b3f6e0b1ebdd576cef461e8217e5
Author: Antonius Riha <antoniusriha gmail com>
Date:   Wed Sep 5 19:42:27 2012 +0200

    [build] Switch tasque build to xbuild
    
    * build/Tasque/CSharp.targets: Created Before/After targets for targets
    "Install" and "Uninstall"
    
    * src/tasque/Makefile.in: Replaces src/tasque/Makefile.am
    
    * src/tasque/tasque.csproj:
    	- Cleaned up and changes to integrate in overall build
    	- Added some targets to build and install/uninstall extra files.
    
    * src/tasque/Tasque.exe.config.in doesn't need processing. Replaced by
    Tasque.exe.config
    
    * src/tasque/tasque.in: Make pkglibdir customizable.

 .gitignore                                         |    5 +-
 build/Tasque.CSharp.targets                        |   10 ++-
 configure.ac                                       |    7 ++
 src/tasque/Makefile.am                             |   65 ----------------
 src/tasque/Makefile.in                             |   53 +++++++++++++
 .../{Tasque.exe.config.in => Tasque.exe.config}    |    0
 src/tasque/tasque.csproj                           |   82 +++++++-------------
 src/tasque/tasque.in                               |    4 +-
 8 files changed, 101 insertions(+), 125 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index db8cc6b..6735717 100644
--- a/.gitignore
+++ b/.gitignore
@@ -92,10 +92,13 @@ Makefile.in
 
 # /src/tasque/
 /src/tasque/*.exe
-/src/tasque/*.exe.config
+/src/tasque/*.dll
 /src/tasque/*.mdb
 /src/tasque/*.pc
 /src/tasque/tasque
+/src/tasque/tasque.csp
+/src/tasque/obj/
+!/src/tasque/Makefile.in
 
 # /src/Addins/Backends/*/
 /src/Addins/Backends/*/*.dll
diff --git a/build/Tasque.CSharp.targets b/build/Tasque.CSharp.targets
index bd5b1ee..0dc7dae 100644
--- a/build/Tasque.CSharp.targets
+++ b/build/Tasque.CSharp.targets
@@ -28,14 +28,20 @@
       <Output TaskParameter="Include" ItemName="ChildProjectReferences" />
     </CreateItem>
   </Target>
-  <Target Name="Install">
+  <Target Name="Install" DependsOnTargets="BeforeInstall;CoreInstall;AfterInstall" />
+  <Target Name="BeforeInstall" />
+  <Target Name="AfterInstall" />
+  <Target Name="CoreInstall">
     <CreateItem Condition="Exists('$(TargetFileName).mdb')" Include="$(TargetFileName).mdb">
       <Output TaskParameter="Include" ItemName="InstallFileName" />
     </CreateItem>
     <Copy SourceFiles="@(InstallFileName)" DestinationFiles="$(DestDir)$(PkgLibDir)\%(RelativeDir)%(FileName)%(Extension)" SkipUnchangedFiles="true" />
     <WriteLinesToFile File="$(_tmpInstallFileNames)" Lines="@(InstallFileName)" Overwrite="true" />
   </Target>
-  <Target Name="Uninstall">
+  <Target Name="Uninstall" DependsOnTargets="BeforeUninstall;CoreUninstall;AfterUninstall" />
+  <Target Name="BeforeUninstall" />
+  <Target Name="AfterUninstall" />
+  <Target Name="CoreUninstall">
     <ReadLinesFromFile File="$(_tmpInstallFileNames)" >
       <Output TaskParameter="Lines" ItemName="InstallFileName" />
     </ReadLinesFromFile>
diff --git a/configure.ac b/configure.ac
index 68730b5..0fb0b53 100644
--- a/configure.ac
+++ b/configure.ac
@@ -292,6 +292,12 @@ AC_SUBST(GTKTASQUECSPROJ)
 RTMNETCSPROJ=RtmNet.csp
 AC_SUBST(RTMNETCSPROJ)
 
+#
+# Setup tasque.csproj
+#
+TASQUECSPROJ=tasque.csp
+AC_SUBST(TASQUECSPROJ)
+
 AC_CONFIG_FILES([
 Makefile
 build/Tasque.CSharp.targets:build/Tasque.CSharp.targets
@@ -303,6 +309,7 @@ src/libtasque/${LIBTASQUECSPROJ}:src/libtasque/libtasque.csproj
 src/Gtk.Tasque/Makefile
 src/Gtk.Tasque/${GTKTASQUECSPROJ}:src/Gtk.Tasque/Gtk.Tasque.csproj
 src/tasque/Makefile
+src/tasque/${TASQUECSPROJ}:src/tasque/tasque.csproj
 src/tasque/tasque.pc
 src/Addins/Backends/Makefile
 src/Addins/Backends/Dummy/Makefile
diff --git a/src/tasque/Makefile.in b/src/tasque/Makefile.in
new file mode 100644
index 0000000..fcf21c4
--- /dev/null
+++ b/src/tasque/Makefile.in
@@ -0,0 +1,53 @@
+PACKAGE = @PACKAGE@
+VERSION = @VERSION@
+WRAPPER = tasque
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+libdir = @libdir@
+pkglibdir = $(libdir)/$(PACKAGE)
+datarootdir = @datarootdir@
+datadir = @datadir@
+bindir = @bindir@
+
+XBUILD = @XBUILD@
+
+TASQUECSPROJ = @TASQUECSPROJ@
+
+conf=$(shell if test "x enable_debug@" != "xno" ; then echo "GtkLinuxDebug" ; else echo "GtkLinuxRelease" ; fi)
+
+PROPERTIES = \
+	/property:Configuration=$(conf) \
+	/property:SrcDir=$(srcdir) \
+	/property:Prefix=$(prefix) \
+	/property:PkgLibDir=$(pkglibdir) \
+	/property:DestDir=$(DESTDIR) \
+	/property:DistDir=../../$(PACKAGE)-$(VERSION)/src/tasque \
+	/property:Version=$(VERSION) \
+	/property:DataDir=$(datadir) \
+	/property:LibDir=$(libdir) \
+	/property:BinDir=$(bindir) \
+	/property:Wrapper=$(WRAPPER)
+
+all:
+	$(XBUILD) $(PROPERTIES) $(TASQUECSPROJ)
+
+clean:
+	$(XBUILD) $(PROPERTIES) /target:clean $(TASQUECSPROJ)
+
+install:
+	$(XBUILD) $(PROPERTIES) /target:install $(TASQUECSPROJ)
+
+uninstall:
+	$(XBUILD) $(PROPERTIES) /target:uninstall $(TASQUECSPROJ)
+
+dist distdir:
+	$(XBUILD) $(PROPERTIES) /target:dist $(TASQUECSPROJ)
+
+distclean:
+	$(XBUILD) $(PROPERTIES) /target:distclean $(TASQUECSPROJ)
+
+dvi installcheck check:
diff --git a/src/tasque/Tasque.exe.config.in b/src/tasque/Tasque.exe.config
similarity index 100%
rename from src/tasque/Tasque.exe.config.in
rename to src/tasque/Tasque.exe.config
diff --git a/src/tasque/tasque.csproj b/src/tasque/tasque.csproj
index f35ee95..98841cf 100644
--- a/src/tasque/tasque.csproj
+++ b/src/tasque/tasque.csproj
@@ -7,88 +7,46 @@
     <SchemaVersion>2.0</SchemaVersion>
     <ProjectGuid>{A70BD496-A280-4EF5-BBE8-254E0CA89C62}</ProjectGuid>
     <OutputType>WinExe</OutputType>
+    <OutputPath>.</OutputPath>
     <RootNamespace>Tasque</RootNamespace>
-    <AssemblyName>tasque</AssemblyName>
+    <AssemblyName>Tasque</AssemblyName>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'GtkLinuxDebug|AnyCPU' ">
     <DebugSymbols>true</DebugSymbols>
     <DebugType>full</DebugType>
     <Optimize>false</Optimize>
-    <OutputPath>bin\Debug\</OutputPath>
     <DefineConstants>TRACE;DEBUG;LINUX</DefineConstants>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-    <CustomCommands>
-      <CustomCommands>
-        <Command type="Execute" command="bin/lib/tasque/Tasque.exe" workingdir="${SolutionDir}" />
-        <Command type="Build" command="make" workingdir="${SolutionDir}" />
-        <Command type="AfterBuild" command="make install" workingdir="${SolutionDir}" />
-        <Command type="Clean" command="make uninstall" workingdir="${SolutionDir}" />
-        <Command type="AfterClean" command="make clean" workingdir="${SolutionDir}" />
-      </CustomCommands>
-    </CustomCommands>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'GtkLinuxRelease|AnyCPU' ">
     <DebugType>pdbonly</DebugType>
     <Optimize>true</Optimize>
-    <OutputPath>bin\Release\</OutputPath>
     <DefineConstants>TRACE;LINUX</DefineConstants>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'GtkWinDebug|AnyCPU' ">
     <DebugSymbols>true</DebugSymbols>
     <DebugType>full</DebugType>
     <Optimize>false</Optimize>
-    <OutputPath>bin\Debug\</OutputPath>
     <DefineConstants>TRACE;DEBUG;WIN</DefineConstants>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-    <CustomCommands>
-      <CustomCommands>
-        <Command type="Execute" command="bin/lib/tasque/Tasque.exe" workingdir="${SolutionDir}" />
-        <Command type="Build" command="make" workingdir="${SolutionDir}" />
-        <Command type="AfterBuild" command="make install" workingdir="${SolutionDir}" />
-        <Command type="Clean" command="make uninstall" workingdir="${SolutionDir}" />
-        <Command type="AfterClean" command="make clean" workingdir="${SolutionDir}" />
-      </CustomCommands>
-    </CustomCommands>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'GtkWinRelease|AnyCPU' ">
     <DebugType>pdbonly</DebugType>
     <Optimize>true</Optimize>
-    <OutputPath>bin\Release\</OutputPath>
     <DefineConstants>TRACE;WIN</DefineConstants>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'MonoMacDebug|AnyCPU' ">
     <DebugSymbols>true</DebugSymbols>
     <DebugType>full</DebugType>
     <Optimize>false</Optimize>
-    <OutputPath>bin\Debug\</OutputPath>
     <DefineConstants>TRACE;DEBUG;OSX</DefineConstants>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-    <CustomCommands>
-      <CustomCommands>
-        <Command type="Execute" command="bin/lib/tasque/Tasque.exe" workingdir="${SolutionDir}" />
-        <Command type="Build" command="make" workingdir="${SolutionDir}" />
-        <Command type="AfterBuild" command="make install" workingdir="${SolutionDir}" />
-        <Command type="Clean" command="make uninstall" workingdir="${SolutionDir}" />
-        <Command type="AfterClean" command="make clean" workingdir="${SolutionDir}" />
-      </CustomCommands>
-    </CustomCommands>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'MonoMacRelease|AnyCPU' ">
     <DebugType>pdbonly</DebugType>
     <Optimize>true</Optimize>
-    <OutputPath>bin\Release\</OutputPath>
     <DefineConstants>TRACE;OSX</DefineConstants>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
   </PropertyGroup>
-  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+  <Import Project="..\..\build\Tasque.CSharp.targets" />
   <ItemGroup>
     <Reference Include="System" />
   </ItemGroup>
@@ -103,18 +61,32 @@
     </ProjectReference>
   </ItemGroup>
   <ItemGroup>
-    <Compile Include="Properties\AssemblyInfo.cs" />
-    <Compile Include="Program.cs" />
+    <TasqueCompile Include="Properties\AssemblyInfo.cs" />
+    <TasqueCompile Include="Program.cs" />
   </ItemGroup>
   <ItemGroup>
-    <None Include="Tasque.exe.config.in" />
+    <DistFile Include="tasque.in" />
+    <DistFile Include="Tasque.exe.config" />
   </ItemGroup>
-  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
   <ItemGroup>
     <Folder Include="Properties\" />
   </ItemGroup>
-  <!--<PropertyGroup>
-    <PostBuildEvent>copy "$(SolutionDir)\winbin" "$(TargetDir)"</PostBuildEvent>
-    <PreBuildEvent>copy "$(SolutionDir)\data\images\*.png" "$(ProjectDir)"</PreBuildEvent>
-  </PropertyGroup>-->
+  <Target Name="BeforeBeforeBuild" Condition=" '$(Configuration)' == 'GtkLinuxDebug' Or '$(Configuration)' == 'GtkLinuxRelease' ">
+    <Exec Command="sed -e %22s|%5C%40prefix%5C%40|$(Prefix)|g%22 -e %22s|%5C%40exec_prefix%5C%40|$(BinDir)|g%22	-e %22s|%5C%40libdir%5C%40|$(LibDir)|g%22 -e %22s|%5C%40pkglibdir%5C%40|$(PkgLibDir)|g%22 &lt; $(SrcDir)\$(Wrapper).in &gt; $(Wrapper) %3B chmod +x $(Wrapper)" />
+  </Target>
+  <Target Name="BeforeClean">
+    <CreateItem Include="$(Wrapper);tasque.pc">
+      <Output TaskParameter="Include" ItemName="TasqueCleanFile" />
+    </CreateItem>
+  </Target>
+  <Target Name="AfterInstall">
+    <Copy SourceFiles="$(SrcDir)\Tasque.exe.config" DestinationFolder="$(DestDir)$(PkgLibDir)" />
+    <Copy SourceFiles="tasque.pc" DestinationFolder="$(DestDir)$(LibDir)\pkgconfig" />
+    <Copy SourceFiles="$(Wrapper)" DestinationFolder="$(DestDir)$(BinDir)" />
+  </Target>
+  <Target Name="BeforeUninstall">
+    <Delete Files="$(DestDir)$(PkgLibDir)\Tasque.exe.config" />
+    <Delete Files="$(DestDir)$(LibDir)\pkgconfig\tasque.pc" />
+    <Delete Files="$(DestDir)$(BinDir)\$(Wrapper)" />
+  </Target>
 </Project>
diff --git a/src/tasque/tasque.in b/src/tasque/tasque.in
index ed8339a..a9ec282 100644
--- a/src/tasque/tasque.in
+++ b/src/tasque/tasque.in
@@ -3,9 +3,9 @@
 prefix="@prefix@"
 exec_prefix="@exec_prefix@"
 libdir="@libdir@"
-tasque_libdir="${libdir}/tasque"
+pkglibdir="@pkglibdir@"
 
-cd ${tasque_libdir}
+cd ${pkglibdir}
 
 for arg in $*; do
 	case "x--debug" in ("x$arg")



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