Skip to content

Commit

Permalink
Reintroduced the versioning system but only for Release builds.
Browse files Browse the repository at this point in the history
Updated the git versioning script so that it outputs AssemblyInfo.cs in UTF8.
  • Loading branch information
IcySon55 committed Dec 3, 2018
1 parent 64e8617 commit 6ff3663
Show file tree
Hide file tree
Showing 11 changed files with 57 additions and 37 deletions.
6 changes: 3 additions & 3 deletions get_git_info.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ $assemblyFile = $projectPath + "\Properties\AssemblyInfo.cs";
$templateAssemblyFile = $projectPath + "\Properties\AssemblyInfo_template.cs";

# Read template files, overwrite place holders with git version info
$newAssemblyContent = Get-Content $templateAssemblyFile |
$newAssemblyContent = Get-Content -Encoding UTF8 $templateAssemblyFile |
%{$_ -replace '\$gitUser\$', $gitUser.Replace('"','\"') } |
%{$_ -replace '\$gitEmail\$', $gitEmail } |
%{$_ -replace '\$gitStateUser\$', $gitStateUser.Replace('"','\"') } |
Expand All @@ -53,5 +53,5 @@ $newAssemblyContent = Get-Content $templateAssemblyFile |
%{$_ -replace '\$compileTime\$', $compileTime };

# Write cs files only if there are changes
Write-Host " * Updated AssemblyInfo.cs";
$newAssemblyContent > $assemblyFile;
Write-Host " * Wrote AssemblyInfo.cs";
$newAssemblyContent | Out-File -Encoding UTF8 $assemblyFile;
3 changes: 1 addition & 2 deletions src/Karameru/Karameru.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,7 @@
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PreBuildEvent>
</PreBuildEvent>
<PreBuildEvent>if $(ConfigurationName) == Release powershell -ExecutionPolicy ByPass -File "$(SolutionDir)\get_git_info.ps1" "$(ProjectDir)"</PreBuildEvent>
</PropertyGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
Expand Down
13 changes: 9 additions & 4 deletions src/Karameru/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
using System.Reflection;
// Do not change this file, as it will be overwritten on build time
// Edit AssemblyInfo_template.cs instead

using System.Reflection;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
Expand Down Expand Up @@ -31,6 +34,8 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0.0")]

// Use this when you apply git tags like "0.1.0" to automatically keep up with the version
[assembly: AssemblyVersion("1.0.13.2071")]
[assembly: AssemblyFileVersion("1.0.13.2071")]
[assembly: AssemblyInformationalVersion("1.0.13-64e86178")]
3 changes: 1 addition & 2 deletions src/Kontract/Kontract.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,7 @@
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PreBuildEvent>
</PreBuildEvent>
<PreBuildEvent>if $(ConfigurationName) == Release powershell -ExecutionPolicy ByPass -File "$(SolutionDir)\get_git_info.ps1" "$(ProjectDir)"</PreBuildEvent>
</PropertyGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
Expand Down
19 changes: 12 additions & 7 deletions src/Kontract/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
using System.Reflection;
// Do not change this file, as it will be overwritten on build time
// Edit AssemblyInfo_template.cs instead

using System.Reflection;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Kontract")]
[assembly: AssemblyDescription("Kontract is the information interchange library between the applications and all plugins.")]
[assembly: AssemblyTitle("Kuriimu Contract")]
[assembly: AssemblyDescription("Kuriimu Contract is the information interchange library between the applications and all plugins.")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Fan Translators International")]
[assembly: AssemblyProduct("Kontract")]
[assembly: AssemblyProduct("Kuriimu Contract")]
[assembly: AssemblyCopyright("Copyright © Fan Translators Int. 2018")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
Expand All @@ -31,6 +34,8 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0.0")]

// Use this when you apply git tags like "0.1.0" to automatically keep up with the version
[assembly: AssemblyVersion("1.0.13.2071")]
[assembly: AssemblyFileVersion("1.0.13.2071")]
[assembly: AssemblyInformationalVersion("1.0.13-64e86178")]
3 changes: 1 addition & 2 deletions src/Kukkii/Kukkii.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,7 @@
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PreBuildEvent>
</PreBuildEvent>
<PreBuildEvent>if $(ConfigurationName) == Release powershell -ExecutionPolicy ByPass -File "$(SolutionDir)\get_git_info.ps1" "$(ProjectDir)"</PreBuildEvent>
</PropertyGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
Expand Down
13 changes: 9 additions & 4 deletions src/Kukkii/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
using System.Reflection;
// Do not change this file, as it will be overwritten on build time
// Edit AssemblyInfo_template.cs instead

using System.Reflection;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
Expand Down Expand Up @@ -31,6 +34,8 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0.0")]

// Use this when you apply git tags like "0.1.0" to automatically keep up with the version
[assembly: AssemblyVersion("1.0.13.2071")]
[assembly: AssemblyFileVersion("1.0.13.2071")]
[assembly: AssemblyInformationalVersion("1.0.13-64e86178")]
3 changes: 1 addition & 2 deletions src/Kuriimu/Kuriimu.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -291,8 +291,7 @@
</PostBuildEvent>
</PropertyGroup>
<PropertyGroup>
<PreBuildEvent>
</PreBuildEvent>
<PreBuildEvent>if $(ConfigurationName) == Release powershell -ExecutionPolicy ByPass -File "$(SolutionDir)\get_git_info.ps1" "$(ProjectDir)"</PreBuildEvent>
</PropertyGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
Expand Down
15 changes: 10 additions & 5 deletions src/Kuriimu/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
using System.Reflection;
// Do not change this file, as it will be overwritten on build time
// Edit AssemblyInfo_template.cs instead

using System.Reflection;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Kuriimu")]
[assembly: AssemblyDescription("Kuriimu is the game translation text editor for authors of fan translations.\r\n\r\nCoding:\r\n\tIcySon55\r\n\tNeobeo\r\n\tonepiecefreak\r\nGIT Info:\r\n\tBranch:\tIcySon55/Kuriimu/master\r\n\tCommit:\t3f7bcd9\r\n\tCompiled:\t2018-11-10 00:07:40UTC\r\n\tby:\tIcySon55 ([email protected])")]
[assembly: AssemblyDescription("Kuriimu is the game translation text editor for authors of fan translations.\r\n\r\nCoding:\r\n\tIcySon55\r\n\tNeobeo\r\n\tonepiecefreak\r\nGIT Info:\r\n\tBranch:\tIcySon55/Kuriimu/master\r\n\tCommit:\t64e86178\r\n\tCompiled:\t2018-12-03 19:34:08UTC\r\n\tby:\tIcySon55 ([email protected])")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Fan Translators International")]
[assembly: AssemblyProduct("Kuriimu")]
Expand All @@ -31,6 +34,8 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0.0")]

// Use this when you apply git tags like "0.1.0" to automatically keep up with the version
[assembly: AssemblyVersion("1.0.13.2071")]
[assembly: AssemblyFileVersion("1.0.13.2071")]
[assembly: AssemblyInformationalVersion("1.0.13-64e86178")]
13 changes: 9 additions & 4 deletions src/runext/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
using System.Reflection;
// Do not change this file, as it will be overwritten on build time
// Edit AssemblyInfo_template.cs instead

using System.Reflection;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
Expand Down Expand Up @@ -31,6 +34,8 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0.0")]

// Use this when you apply git tags like "0.1.0" to automatically keep up with the version
[assembly: AssemblyVersion("1.0.13.2071")]
[assembly: AssemblyFileVersion("1.0.13.2071")]
[assembly: AssemblyInformationalVersion("1.0.13-64e86178")]
3 changes: 1 addition & 2 deletions src/runext/runext.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,7 @@
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PreBuildEvent>
</PreBuildEvent>
<PreBuildEvent>if $(ConfigurationName) == Release powershell -ExecutionPolicy ByPass -File "$(SolutionDir)\get_git_info.ps1" "$(ProjectDir)"</PreBuildEvent>
</PropertyGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
Expand Down

0 comments on commit 6ff3663

Please sign in to comment.