[tasque/transition: 129/213] Introduce Prefix build variable



commit ecf930c3119c6b771709350b6d7d8a80de1dcc59
Author: Antonius Riha <antoniusriha gmail com>
Date:   Fri Aug 17 21:58:17 2012 +0200

    Introduce Prefix build variable
    
    The prefix variable is the same as in autotool's configure scripts. By default
    it points to build/out/. The projects output ontop of prefix follows the
    common Unix directory structure.
    
    In favor of the prefix variable the DataDir variable has been dropped. The
    DataDir, which is the same as the Unix share directory, can be deduced as
    Prefix/share.
    
    The Prefix variable is accessible in code via the GlobalDefines class.
    
    The SetDataAtBuildTime task has been updated to reflect the transition
    to the Prefix variable.

 .gitignore                                         |    1 +
 INSTALL                                            |    3 ++-
 build/GlobalDefines.cs.in                          |   16 ++++++++++------
 build/SetDataAtBuildTime.cs                        |    4 ++--
 build/build.csproj                                 |    4 ++--
 src/Addins/DummyBackend/DummyBackend.csproj        |    3 ++-
 .../HiveminderBackend/HiveminderBackend.csproj     |    3 ++-
 src/Addins/RtmBackend/RtmBackend.csproj            |    3 ++-
 src/Addins/SqliteBackend/SqliteBackend.csproj      |    3 ++-
 src/ObservableTransformCollections                 |    2 +-
 src/RtmNet/RtmNet.csproj                           |    3 ++-
 src/Tasque.Gtk/Tasque.Gtk.csproj                   |    3 ++-
 src/Tasque.MonoMac/Tasque.MonoMac.csproj           |    3 ++-
 src/libtasque/libtasque.csproj                     |    3 ++-
 src/tasque/tasque.csproj                           |    3 ++-
 tests/tests.csproj                                 |    3 ++-
 16 files changed, 38 insertions(+), 22 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 1acf5ab..2423d2c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -26,6 +26,7 @@ obj/
 
 # build output
 bin/
+/build/out/
 *.exe
 *.dll
 *.pdb
diff --git a/INSTALL b/INSTALL
index 8c7d8b2..ae74e5e 100644
--- a/INSTALL
+++ b/INSTALL
@@ -29,7 +29,8 @@ as the build command.
 
 
 Other options:
-	/property:DataDir=pathToDataDir			(datadir contains resources, translation, ...)
+	/property:Prefix=installationPrefix
+e.g. /usr/local; must be an absolute path; default is /<PathToTasqueRepository>/build/out/)
 
 
 
diff --git a/build/GlobalDefines.cs.in b/build/GlobalDefines.cs.in
index ac330a9..dec822d 100644
--- a/build/GlobalDefines.cs.in
+++ b/build/GlobalDefines.cs.in
@@ -26,17 +26,21 @@
 // THE SOFTWARE.
 
 using System.Collections.ObjectModel;
+using System.IO;
 
-namespace Tasque {
-	static class GlobalDefines {
+namespace Tasque
+{
+	static class GlobalDefines
+	{
+		public const string Prefix = "@prefix@";
+		public static readonly string DataDir = Path.Combine (Prefix, "share");
+		public static readonly string LocaleDir = Path.Combine (DataDir, "locale");
+//		public static readonly string SoundDir = Path.Combine (DataDir, "tasque", "sounds");
 		public const string Version = "@version@";
-		public const string DataDir	= "@datadir@";
-		public const string LocaleDir = "@datadir@/locale";
-//		public const string SoundDir = "@datadir@/tasque/sounds";
 		public const string CopyrightInfo = @"@copyrightinfo@";
 		public const string License = @"@license@";
 		public const string Website = "@website@";
 		public static readonly ReadOnlyCollection<string> Authors =
 			new ReadOnlyCollection<string> (new Collection<string> () { @authors@ });
 	}
-}
\ No newline at end of file
+}
diff --git a/build/SetDataAtBuildTime.cs b/build/SetDataAtBuildTime.cs
index 7241223..f4f4a37 100644
--- a/build/SetDataAtBuildTime.cs
+++ b/build/SetDataAtBuildTime.cs
@@ -141,7 +141,7 @@ namespace Tasque.Build
 		}
 
 		[Required]
-		public ITaskItem DataDir { get; set; }
+		public ITaskItem Prefix { get; set; }
 		
 		[Required]
 		public ITaskItem GlobalDefinesFile { get; set; }
@@ -170,7 +170,7 @@ namespace Tasque.Build
 
 			SetValue ("@authors@", authors);
 			
-			SetValue ("@datadir@", DataDir.ItemSpec);
+			SetValue ("@prefix@", Prefix.ItemSpec);
 
 			if (!WriteGlobalDefines ())
 				return false;
diff --git a/build/build.csproj b/build/build.csproj
index b532217..914a875 100644
--- a/build/build.csproj
+++ b/build/build.csproj
@@ -12,7 +12,7 @@
     <AssemblyName>Tasque.Build</AssemblyName>
     <RootNamespace>Tasque.Build</RootNamespace>
     <Website>https://live.gnome.org/Tasque</Website>
-    <DataDir Condition=" '$(DataDir)' == '' ">$(MSBuildProjectDirectory)\data</DataDir>
+    <Prefix Condition=" '$(Prefix)' == '' ">$(MSBuildProjectDirectory)\out</Prefix>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
     <DebugType>full</DebugType>
@@ -116,7 +116,7 @@
   </ItemGroup>
   <Target Name="AfterBuild">
     <Message Text="Setting up global definitions..." />
-    <SetDataAtBuildTime AuthorsFile="@(Authors)" CopyingFile="@(License)" DataDir="$(DataDir)" GlobalDefinesFile="@(GlobalDefines)" GlobalDefinesFileIn="@(GlobalDefinesIn)" Version="$(ReleaseVersion)" Website="$(Website)" />
+    <SetDataAtBuildTime AuthorsFile="@(Authors)" CopyingFile="@(License)" Prefix="$(Prefix)" GlobalDefinesFile="@(GlobalDefines)" GlobalDefinesFileIn="@(GlobalDefinesIn)" Version="$(ReleaseVersion)" Website="$(Website)" />
     <Message Text="Finished setting up global definitions." />
     <Message Text="Load submodules..." />
     <LoadGitSubmodules SolutionDirectory="$(MSBuildProjectDirectory)\.." />
diff --git a/src/Addins/DummyBackend/DummyBackend.csproj b/src/Addins/DummyBackend/DummyBackend.csproj
index a3ad7a9..6249812 100644
--- a/src/Addins/DummyBackend/DummyBackend.csproj
+++ b/src/Addins/DummyBackend/DummyBackend.csproj
@@ -7,7 +7,8 @@
     <SchemaVersion>2.0</SchemaVersion>
     <ProjectGuid>{91F6578A-2993-40A4-BE49-64028923EB87}</ProjectGuid>
     <OutputType>Library</OutputType>
-    <OutputPath>..\..\..\build\bin</OutputPath>
+    <Prefix Condition=" '$(Prefix)' == '' ">..\..\..\build\out\</Prefix>
+    <OutputPath>$(Prefix)\lib\tasque</OutputPath>
     <RootNamespace>DummyBackend</RootNamespace>
     <AssemblyName>DummyBackend</AssemblyName>
     <ReleaseVersion>0.1.10</ReleaseVersion>
diff --git a/src/Addins/HiveminderBackend/HiveminderBackend.csproj b/src/Addins/HiveminderBackend/HiveminderBackend.csproj
index b93d213..d987e22 100644
--- a/src/Addins/HiveminderBackend/HiveminderBackend.csproj
+++ b/src/Addins/HiveminderBackend/HiveminderBackend.csproj
@@ -7,7 +7,8 @@
     <SchemaVersion>2.0</SchemaVersion>
     <ProjectGuid>{B3107E6C-08DD-4264-A8D5-467BD96F33CA}</ProjectGuid>
     <OutputType>Library</OutputType>
-    <OutputPath>..\..\..\build\bin</OutputPath>
+    <Prefix Condition=" '$(Prefix)' == '' ">..\..\..\build\out\</Prefix>
+    <OutputPath>$(Prefix)\lib\tasque</OutputPath>
     <RootNamespace>HiveminderBackend</RootNamespace>
     <AssemblyName>HiveminderBackend</AssemblyName>
     <ReleaseVersion>0.1.10</ReleaseVersion>
diff --git a/src/Addins/RtmBackend/RtmBackend.csproj b/src/Addins/RtmBackend/RtmBackend.csproj
index 78c420a..89eff8c 100644
--- a/src/Addins/RtmBackend/RtmBackend.csproj
+++ b/src/Addins/RtmBackend/RtmBackend.csproj
@@ -7,7 +7,8 @@
     <SchemaVersion>2.0</SchemaVersion>
     <ProjectGuid>{545C0208-DE58-42F1-B818-0B57293B7831}</ProjectGuid>
     <OutputType>Library</OutputType>
-    <OutputPath>..\..\..\build\bin</OutputPath>
+    <Prefix Condition=" '$(Prefix)' == '' ">..\..\..\build\out\</Prefix>
+    <OutputPath>$(Prefix)\lib\tasque</OutputPath>
     <RootNamespace>RtmBackend</RootNamespace>
     <AssemblyName>RtmBackend</AssemblyName>
     <ReleaseVersion>0.1.10</ReleaseVersion>
diff --git a/src/Addins/SqliteBackend/SqliteBackend.csproj b/src/Addins/SqliteBackend/SqliteBackend.csproj
index ae98a73..8c24115 100644
--- a/src/Addins/SqliteBackend/SqliteBackend.csproj
+++ b/src/Addins/SqliteBackend/SqliteBackend.csproj
@@ -7,7 +7,8 @@
     <SchemaVersion>2.0</SchemaVersion>
     <ProjectGuid>{89054FCE-E9A3-47E5-8DEF-75FDB000F82A}</ProjectGuid>
     <OutputType>Library</OutputType>
-    <OutputPath>..\..\..\build\bin</OutputPath>
+    <Prefix Condition=" '$(Prefix)' == '' ">..\..\..\build\out\</Prefix>
+    <OutputPath>$(Prefix)\lib\tasque</OutputPath>
     <RootNamespace>SqliteBackend</RootNamespace>
     <AssemblyName>SqliteBackend</AssemblyName>
     <ReleaseVersion>0.1.10</ReleaseVersion>
diff --git a/src/ObservableTransformCollections b/src/ObservableTransformCollections
index 66194b8..cb23a1a 160000
--- a/src/ObservableTransformCollections
+++ b/src/ObservableTransformCollections
@@ -1 +1 @@
-Subproject commit 66194b888e3f92b3d0486182426b6bcfc9f031a1
+Subproject commit cb23a1a1bc48c6cc7039c83dc3ca301ff73eb5e5
diff --git a/src/RtmNet/RtmNet.csproj b/src/RtmNet/RtmNet.csproj
index 3fcb037..a646a8e 100644
--- a/src/RtmNet/RtmNet.csproj
+++ b/src/RtmNet/RtmNet.csproj
@@ -7,7 +7,8 @@
     <ProductVersion>9.0.21022</ProductVersion>
     <SchemaVersion>2.0</SchemaVersion>
     <OutputType>Library</OutputType>
-    <OutputPath>..\..\build\bin</OutputPath>
+    <Prefix Condition=" '$(Prefix)' == '' ">..\..\build\out\</Prefix>
+    <OutputPath>$(Prefix)\lib\tasque</OutputPath>
     <NoStandardLibraries>false</NoStandardLibraries>
     <AssemblyName>RtmNet</AssemblyName>
     <FileAlignment>512</FileAlignment>
diff --git a/src/Tasque.Gtk/Tasque.Gtk.csproj b/src/Tasque.Gtk/Tasque.Gtk.csproj
index a18c9ac..18e1b24 100644
--- a/src/Tasque.Gtk/Tasque.Gtk.csproj
+++ b/src/Tasque.Gtk/Tasque.Gtk.csproj
@@ -7,7 +7,8 @@
     <ProductVersion>10.0.0</ProductVersion>
     <SchemaVersion>2.0</SchemaVersion>
     <OutputType>Library</OutputType>
-    <OutputPath>..\..\build\bin</OutputPath>
+    <Prefix Condition=" '$(Prefix)' == '' ">..\..\build\out\</Prefix>
+    <OutputPath>$(Prefix)\lib\tasque</OutputPath>
     <AssemblyName>Tasque.Gtk</AssemblyName>
     <RootNamespace>Tasque</RootNamespace>
     <ReleaseVersion>0.1.10</ReleaseVersion>
diff --git a/src/Tasque.MonoMac/Tasque.MonoMac.csproj b/src/Tasque.MonoMac/Tasque.MonoMac.csproj
index e70286b..2caa5b0 100644
--- a/src/Tasque.MonoMac/Tasque.MonoMac.csproj
+++ b/src/Tasque.MonoMac/Tasque.MonoMac.csproj
@@ -7,7 +7,8 @@
     <SchemaVersion>2.0</SchemaVersion>
     <ProjectGuid>{1F6FC2AE-0BB5-4536-939F-1D9FE893F7DD}</ProjectGuid>
     <OutputType>Library</OutputType>
-    <OutputPath>..\..\build\bin</OutputPath>
+    <Prefix Condition=" '$(Prefix)' == '' ">..\..\build\out\</Prefix>
+    <OutputPath>$(Prefix)\lib\tasque</OutputPath>
     <RootNamespace>Tasque</RootNamespace>
     <AssemblyName>Tasque</AssemblyName>
     <ReleaseVersion>0.1.10</ReleaseVersion>
diff --git a/src/libtasque/libtasque.csproj b/src/libtasque/libtasque.csproj
index e550b76..1da42eb 100644
--- a/src/libtasque/libtasque.csproj
+++ b/src/libtasque/libtasque.csproj
@@ -7,7 +7,8 @@
     <SchemaVersion>2.0</SchemaVersion>
     <ProjectGuid>{784C9AA8-2B28-400B-8CC4-DCDC48CA37F0}</ProjectGuid>
     <OutputType>Library</OutputType>
-    <OutputPath>..\..\build\bin</OutputPath>
+    <Prefix Condition=" '$(Prefix)' == '' ">..\..\build\out\</Prefix>
+    <OutputPath>$(Prefix)\lib\tasque</OutputPath>
     <RootNamespace>Tasque</RootNamespace>
     <AssemblyName>libtasque</AssemblyName>
     <ReleaseVersion>0.1.10</ReleaseVersion>
diff --git a/src/tasque/tasque.csproj b/src/tasque/tasque.csproj
index b12745c..6d941b9 100644
--- a/src/tasque/tasque.csproj
+++ b/src/tasque/tasque.csproj
@@ -7,7 +7,8 @@
     <SchemaVersion>2.0</SchemaVersion>
     <ProjectGuid>{A70BD496-A280-4EF5-BBE8-254E0CA89C62}</ProjectGuid>
     <OutputType>WinExe</OutputType>
-    <OutputPath>..\..\build\bin</OutputPath>
+    <Prefix Condition=" '$(Prefix)' == '' ">..\..\build\out\</Prefix>
+    <OutputPath>$(Prefix)\lib\tasque</OutputPath>
     <RootNamespace>Tasque</RootNamespace>
     <AssemblyName>tasque</AssemblyName>
     <ReleaseVersion>0.1.10</ReleaseVersion>
diff --git a/tests/tests.csproj b/tests/tests.csproj
index 10400a3..dfc9f04 100644
--- a/tests/tests.csproj
+++ b/tests/tests.csproj
@@ -7,7 +7,8 @@
     <SchemaVersion>2.0</SchemaVersion>
     <ProjectGuid>{6DC908EC-E7C2-46CD-A21D-832C0D81D946}</ProjectGuid>
     <OutputType>Library</OutputType>
-    <OutputPath>bin</OutputPath>
+    <Prefix Condition=" '$(Prefix)' == '' ">..\build\out\</Prefix>
+    <OutputPath>$(Prefix)\lib\tasque</OutputPath>
     <RootNamespace>Tasque.Tests</RootNamespace>
     <AssemblyName>tests</AssemblyName>
     <ReleaseVersion>0.1.10</ReleaseVersion>



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