Skip to content

Commit be9a8c5

Browse files
committed
Transform Templates on Build
Templates for all assemblies
1 parent 4cb50b5 commit be9a8c5

32 files changed

Lines changed: 302 additions & 215 deletions

‎.gitignore‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,3 +252,6 @@ ModelManifest.xml
252252
# FAKE - F# Make
253253
.fake/
254254
GameBinaries
255+
256+
# Generated Files
257+
**Gen.cs
Lines changed: 8 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,17 @@
11
using System.Reflection;
2-
using System.Runtime.CompilerServices;
32
using System.Runtime.InteropServices;
43

5-
// General Information about an assembly is controlled through the following
6-
// set of attributes. Change these attribute values to modify the information
7-
// associated with an assembly.
8-
[assembly: AssemblyTitle("TorchAPI")]
4+
[assembly: AssemblyTitle("Torch API")]
95
[assembly: AssemblyDescription("")]
10-
[assembly: AssemblyConfiguration("")]
116
[assembly: AssemblyCompany("")]
12-
[assembly: AssemblyProduct("TorchAPI")]
13-
[assembly: AssemblyCopyright("Copyright © 2016")]
7+
[assembly: AssemblyProduct("Torch")]
8+
[assembly: AssemblyCopyright("Copyright © Torch API 2017")]
149
[assembly: AssemblyTrademark("")]
1510
[assembly: AssemblyCulture("")]
16-
17-
// Setting ComVisible to false makes the types in this assembly not visible
18-
// to COM components. If you need to access a type in this assembly from
19-
// COM, set the ComVisible attribute to true on that type.
2011
[assembly: ComVisible(false)]
2112

22-
// The following GUID is for the ID of the typelib if this project is exposed to COM
23-
[assembly: Guid("fba5d932-6254-4a1e-baf4-e229fa94e3c2")]
24-
25-
// Version information for an assembly consists of the following four values:
26-
//
27-
// Major Version
28-
// Minor Version
29-
// Build Number
30-
// Revision
31-
//
32-
// You can specify all the values or you can default the Build and Revision Numbers
33-
// by using the '*' as shown below:
34-
// [assembly: AssemblyVersion("1.0.*")]
35-
[assembly: AssemblyVersion("1.0.0.0")]
36-
[assembly: AssemblyFileVersion("1.0.0.0")]
13+
#if DEBUG
14+
[assembly: AssemblyConfiguration("Debug")]
15+
#else
16+
[assembly: AssemblyConfiguration("Release")]
17+
#endif

‎Torch.API/Torch.API.csproj‎

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
1111
<FileAlignment>512</FileAlignment>
1212
<TargetFrameworkProfile />
13+
<NuGetPackageImportStamp>
14+
</NuGetPackageImportStamp>
1315
</PropertyGroup>
1416
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
1517
<DebugSymbols>true</DebugSymbols>
@@ -36,8 +38,8 @@
3638
<HintPath>..\GameBinaries\HavokWrapper.dll</HintPath>
3739
<Private>False</Private>
3840
</Reference>
39-
<Reference Include="NLog">
40-
<HintPath>..\packages\NLog.4.4.1\lib\net45\NLog.dll</HintPath>
41+
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
42+
<HintPath>..\packages\NLog.4.4.12\lib\net45\NLog.dll</HintPath>
4143
<Private>True</Private>
4244
</Reference>
4345
<Reference Include="PresentationCore" />
@@ -173,18 +175,26 @@
173175
<Compile Include="ModAPI\Ingame\GridExtensions.cs" />
174176
<Compile Include="Plugins\PluginAttribute.cs" />
175177
<Compile Include="Properties\AssemblyInfo.cs" />
178+
<Compile Include="Properties\AssemblyInfoGen.cs">
179+
<DependentUpon>AssemblyInfoGen.tt</DependentUpon>
180+
<AutoGen>True</AutoGen>
181+
<DesignTime>True</DesignTime>
182+
</Compile>
176183
<Compile Include="ServerState.cs" />
177184
<Compile Include="ModAPI\TorchAPI.cs" />
178185
</ItemGroup>
179186
<ItemGroup>
180187
<None Include="packages.config" />
181188
</ItemGroup>
189+
<ItemGroup>
190+
<Content Include="Properties\AssemblyInfoGen.tt">
191+
<Generator>TextTemplatingFileGenerator</Generator>
192+
<LastGenOutput>AssemblyInfoGen.cs</LastGenOutput>
193+
</Content>
194+
</ItemGroup>
195+
<ItemGroup>
196+
<Service Include="{508349B6-6B84-4DF5-91F0-309BEEBAD82D}" />
197+
</ItemGroup>
182198
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
183-
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
184-
Other similar extension points exist, see Microsoft.Common.targets.
185-
<Target Name="BeforeBuild">
186-
</Target>
187-
<Target Name="AfterBuild">
188-
</Target>
189-
-->
199+
<Import Project="$(SolutionDir)\TransformOnBuild.targets" />
190200
</Project>

‎Torch.API/packages.config‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="NLog" version="4.4.1" targetFramework="net461" />
3+
<package id="Clarius.TransformOnBuild" version="1.1.12" targetFramework="net461" developmentDependency="true" />
4+
<package id="Mono.TextTransform" version="1.0.0" targetFramework="net461" />
5+
<package id="NLog" version="4.4.12" targetFramework="net461" />
46
</packages>
Lines changed: 8 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,17 @@
11
using System.Reflection;
2-
using System.Runtime.CompilerServices;
32
using System.Runtime.InteropServices;
43

5-
// General Information about an assembly is controlled through the following
6-
// set of attributes. Change these attribute values to modify the information
7-
// associated with an assembly.
8-
[assembly: AssemblyTitle("Torch.Client.Tests")]
4+
[assembly: AssemblyTitle("Torch Client Tests")]
95
[assembly: AssemblyDescription("")]
10-
[assembly: AssemblyConfiguration("")]
116
[assembly: AssemblyCompany("")]
12-
[assembly: AssemblyProduct("Torch.Client.Tests")]
13-
[assembly: AssemblyCopyright("Copyright © 2017")]
7+
[assembly: AssemblyProduct("Torch")]
8+
[assembly: AssemblyCopyright("Copyright © Torch API 2017")]
149
[assembly: AssemblyTrademark("")]
1510
[assembly: AssemblyCulture("")]
16-
17-
// Setting ComVisible to false makes the types in this assembly not visible
18-
// to COM components. If you need to access a type in this assembly from
19-
// COM, set the ComVisible attribute to true on that type.
2011
[assembly: ComVisible(false)]
2112

22-
// The following GUID is for the ID of the typelib if this project is exposed to COM
23-
[assembly: Guid("632e78c0-0dac-4b71-b411-2f1b333cc310")]
24-
25-
// Version information for an assembly consists of the following four values:
26-
//
27-
// Major Version
28-
// Minor Version
29-
// Build Number
30-
// Revision
31-
//
32-
// You can specify all the values or you can default the Build and Revision Numbers
33-
// by using the '*' as shown below:
34-
// [assembly: AssemblyVersion("1.0.*")]
35-
[assembly: AssemblyVersion("1.0.0.0")]
36-
[assembly: AssemblyFileVersion("1.0.0.0")]
13+
#if DEBUG
14+
[assembly: AssemblyConfiguration("Debug")]
15+
#else
16+
[assembly: AssemblyConfiguration("Release")]
17+
#endif
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<#@ template debug="false" hostspecific="false" language="C#" #>
2+
<#@ assembly name="System.Core" #>
3+
<#@ import namespace="System.Linq" #>
4+
<#@ import namespace="System.Text" #>
5+
<#@ import namespace="System.Collections.Generic" #>
6+
<#@ output extension=".cs" #>
7+
using System.Reflection;
8+
9+
<# var dt = DateTime.Now;
10+
int major = 1;
11+
int minor = 0;
12+
int build = dt.DayOfYear;
13+
int rev = (int)dt.TimeOfDay.TotalMinutes / 2;
14+
#>
15+
[assembly: AssemblyVersion("<#= major #>.<#= minor #>.<#= build #>.<#= rev #>")]
16+
[assembly: AssemblyFileVersion("<#= major #>.<#= minor #>.<#= build #>.<#= rev #>")]

‎Torch.Client.Tests/Torch.Client.Tests.csproj‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@
3434
<DocumentationFile>$(SolutionDir)\bin-test\x64\Release\Torch.Client.Tests.xml</DocumentationFile>
3535
</PropertyGroup>
3636
<ItemGroup>
37+
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
38+
<HintPath>..\packages\NLog.4.4.12\lib\net45\NLog.dll</HintPath>
39+
<Private>True</Private>
40+
</Reference>
3741
<Reference Include="System" />
3842
<Reference Include="System.Core" />
3943
<Reference Include="System.Xml.Linq" />
@@ -57,6 +61,11 @@
5761
</ItemGroup>
5862
<ItemGroup>
5963
<Compile Include="Properties\AssemblyInfo.cs" />
64+
<Compile Include="Properties\AssemblyInfoGen.cs">
65+
<DependentUpon>AssemblyInfoGen.tt</DependentUpon>
66+
<AutoGen>True</AutoGen>
67+
<DesignTime>True</DesignTime>
68+
</Compile>
6069
<Compile Include="TorchClientReflectionTest.cs" />
6170
</ItemGroup>
6271
<ItemGroup>
@@ -81,5 +90,15 @@
8190
<ItemGroup>
8291
<None Include="packages.config" />
8392
</ItemGroup>
93+
<ItemGroup>
94+
<Content Include="Properties\AssemblyInfoGen.tt">
95+
<Generator>TextTemplatingFileGenerator</Generator>
96+
<LastGenOutput>AssemblyInfoGen.cs</LastGenOutput>
97+
</Content>
98+
</ItemGroup>
99+
<ItemGroup>
100+
<Service Include="{508349B6-6B84-4DF5-91F0-309BEEBAD82D}" />
101+
</ItemGroup>
84102
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
103+
<Import Project="$(SolutionDir)\TransformOnBuild.targets" />
85104
</Project>

‎Torch.Client.Tests/packages.config‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3+
<package id="Clarius.TransformOnBuild" version="1.1.12" targetFramework="net461" developmentDependency="true" />
4+
<package id="Mono.TextTransform" version="1.0.0" targetFramework="net461" />
5+
<package id="NLog" version="4.4.12" targetFramework="net461" />
36
<package id="xunit" version="2.2.0" targetFramework="net461" />
47
<package id="xunit.abstractions" version="2.0.1" targetFramework="net461" />
58
<package id="xunit.assert" version="2.2.0" targetFramework="net461" />
Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,17 @@
11
using System.Reflection;
2+
using System.Runtime.InteropServices;
23

3-
[assembly: AssemblyVersion("1.0.229.265")]
4-
[assembly: AssemblyFileVersion("1.0.229.265")]
4+
[assembly: AssemblyTitle("Torch Client")]
5+
[assembly: AssemblyDescription("")]
6+
[assembly: AssemblyCompany("")]
7+
[assembly: AssemblyProduct("Torch")]
8+
[assembly: AssemblyCopyright("Copyright © Torch API 2017")]
9+
[assembly: AssemblyTrademark("")]
10+
[assembly: AssemblyCulture("")]
11+
[assembly: ComVisible(false)]
12+
13+
#if DEBUG
14+
[assembly: AssemblyConfiguration("Debug")]
15+
#else
16+
[assembly: AssemblyConfiguration("Release")]
17+
#endif

0 commit comments

Comments
 (0)