Проставляем версию в AssemblyInfo.cs

This commit is contained in:
Danil Kislov
2019-03-19 09:13:43 +03:00
parent 92830f9edf
commit 2fc864cd6a
5 changed files with 80 additions and 36 deletions
+1 -1
View File
@@ -1 +1 @@
1.0.12 1.0.14
+1
View File
@@ -14,6 +14,7 @@ set VERSION=%MAJOR:~0,1%.%MINOR:~0,1%.%PATCH1%
echo %VERSION%>.semver.txt echo %VERSION%>.semver.txt
echo Updating to %VERSION% echo Updating to %VERSION%
call tools\SetVersion.cmd %VERSION%
git add . git add .
git commit -m "%~1" git commit -m "%~1"
+31 -35
View File
@@ -1,35 +1,31 @@
using System.Reflection; using System.Reflection;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information
// set of attributes. Change these attribute values to modify the information // associated with an assembly.
// associated with an assembly. [assembly: AssemblyTitle("JiraTimeBot")]
[assembly: AssemblyTitle("JiraTimeBot")] [assembly: AssemblyDescription("")]
[assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")]
[assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")]
[assembly: AssemblyCompany("")] [assembly: AssemblyProduct("JiraTimeBot")]
[assembly: AssemblyProduct("JiraTimeBot")] [assembly: AssemblyCopyright("Copyright © 2019")]
[assembly: AssemblyCopyright("Copyright © 2019")] [assembly: AssemblyTrademark("")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")]
[assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// Setting ComVisible to false makes the types in this assembly not visible // COM, set the ComVisible attribute to true on that type.
// to COM components. If you need to access a type in this assembly from [assembly: ComVisible(false)]
// COM, set the ComVisible attribute to true on that type. // The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: ComVisible(false)] [assembly: Guid("f3b89316-c38c-4ce6-9d88-0b1373cfba1a")]
// Version information for an assembly consists of the following four values:
// The following GUID is for the ID of the typelib if this project is exposed to COM //
[assembly: Guid("f3b89316-c38c-4ce6-9d88-0b1373cfba1a")] // Major Version
// Minor Version
// Version information for an assembly consists of the following four values: // Build Number
// // Revision
// Major Version //
// Minor Version // You can specify all the values or you can default the Build and Revision Numbers
// Build Number // by using the '*' as shown below:
// Revision [assembly: AssemblyVersion("1.0.14")]
// [assembly: AssemblyFileVersion("1.0.14")]
// You can specify all the values or you can default the Build and Revision Numbers [assembly: AssemblyInformationalVersion("1.0.14")]
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
+47
View File
@@ -0,0 +1,47 @@
@echo off
setlocal enabledelayedexpansion
if [%1] == [] GOTO :USAGE
set version=%1
set fileversion=%1
set informationalversion=%1
if [%2] NEQ [] SET fileversion=%2
if [%3] NEQ [] SET informationalversion=%3
echo Setting assembly version information
for /F "delims=" %%f in ('dir /s /b Assemblyinfo.cs') do (
echo ^> %%f
pushd %%~dpf
for /F "usebackq delims=" %%g in ("AssemblyInfo.cs") do (
set ln=%%g
set skip=0
if "!ln:AssemblyVersion=!" NEQ "!ln!" set skip=1
if "!ln:AssemblyFileVersion=!" NEQ "!ln!" set skip=1
if "!ln:AssemblyInformationalVersion=!" NEQ "!ln!" set skip=1
if !skip!==0 echo !ln! >> AssemblyInfo.cs.versioned
)
echo [assembly: AssemblyVersion^("%version%"^)] >> AssemblyInfo.cs.versioned
echo [assembly: AssemblyFileVersion^("%fileversion%"^)] >> AssemblyInfo.cs.versioned
echo [assembly: AssemblyInformationalVersion^("%informationalversion%"^)] >> AssemblyInfo.cs.versioned
copy /y AssemblyInfo.cs AssemblyInfo.cs.orig
move /y AssemblyInfo.cs.versioned AssemblyInfo.cs
popd
)
echo Done^^!
GOTO:EOF
:USAGE
echo Usage:
echo.
echo SetVersion.bat Version [FileVersion] [InformationalVersion]
echo.
Binary file not shown.