diff --git a/w32/Setup/GitInfo/GitInfo.cache.pp b/w32/Setup/GitInfo/GitInfo.cache.pp new file mode 100644 index 0000000000..3f188321df --- /dev/null +++ b/w32/Setup/GitInfo/GitInfo.cache.pp @@ -0,0 +1,17 @@ +GitBranch=$GitBranch$; +GitCommit=$GitCommit$; +GitSha=$GitSha$; +GitBaseVersion=$GitBaseVersion$; +GitBaseVersionSource=$GitBaseVersionSource$; +GitBaseVersionMajor=$GitBaseVersionMajor$; +GitBaseVersionMinor=$GitBaseVersionMinor$; +GitBaseVersionPatch=$GitBaseVersionPatch$; +GitCommits=$GitCommits$; +GitTag=$GitTag$; +GitBaseTag=$GitBaseTag$; +GitSemVerMajor=$GitSemVerMajor$; +GitSemVerMinor=$GitSemVerMinor$; +GitSemVerPatch=$GitSemVerPatch$; +GitSemVerLabel=$GitSemVerLabel$; +GitSemVerDashLabel=$GitSemVerDashLabel$; +GitSemVerSource=$GitSemVerSource$ \ No newline at end of file diff --git a/w32/Setup/GitInfo/GitInfo.cs.pp b/w32/Setup/GitInfo/GitInfo.cs.pp new file mode 100644 index 0000000000..b8d0a57896 --- /dev/null +++ b/w32/Setup/GitInfo/GitInfo.cs.pp @@ -0,0 +1,98 @@ +// +#define $NamespaceDefine$ +#define $MetadataDefine$ +#pragma warning disable 0436 + +#if ADDMETADATA +[assembly: System.Reflection.AssemblyMetadata("GitInfo.IsDirty", RootNamespace.ThisAssembly.Git.IsDirtyString)] +[assembly: System.Reflection.AssemblyMetadata("GitInfo.Branch", RootNamespace.ThisAssembly.Git.Branch)] +[assembly: System.Reflection.AssemblyMetadata("GitInfo.Commit", RootNamespace.ThisAssembly.Git.Commit)] +[assembly: System.Reflection.AssemblyMetadata("GitInfo.Sha", RootNamespace.ThisAssembly.Git.Sha)] +[assembly: System.Reflection.AssemblyMetadata("GitInfo.BaseVersion.Major", RootNamespace.ThisAssembly.Git.BaseVersion.Major)] +[assembly: System.Reflection.AssemblyMetadata("GitInfo.BaseVersion.Minor", RootNamespace.ThisAssembly.Git.BaseVersion.Minor)] +[assembly: System.Reflection.AssemblyMetadata("GitInfo.BaseVersion.Patch", RootNamespace.ThisAssembly.Git.BaseVersion.Patch)] +[assembly: System.Reflection.AssemblyMetadata("GitInfo.Commits", RootNamespace.ThisAssembly.Git.Commits)] +[assembly: System.Reflection.AssemblyMetadata("GitInfo.Tag", RootNamespace.ThisAssembly.Git.Tag)] +[assembly: System.Reflection.AssemblyMetadata("GitInfo.BaseTag", RootNamespace.ThisAssembly.Git.BaseTag)] +[assembly: System.Reflection.AssemblyMetadata("GitInfo.SemVer.Major", RootNamespace.ThisAssembly.Git.SemVer.Major)] +[assembly: System.Reflection.AssemblyMetadata("GitInfo.SemVer.Minor", RootNamespace.ThisAssembly.Git.SemVer.Minor)] +[assembly: System.Reflection.AssemblyMetadata("GitInfo.SemVer.Patch", RootNamespace.ThisAssembly.Git.SemVer.Patch)] +[assembly: System.Reflection.AssemblyMetadata("GitInfo.SemVer.Label", RootNamespace.ThisAssembly.Git.SemVer.Label)] +[assembly: System.Reflection.AssemblyMetadata("GitInfo.SemVer.DashLabel", RootNamespace.ThisAssembly.Git.SemVer.DashLabel)] +[assembly: System.Reflection.AssemblyMetadata("GitInfo.SemVer.Source", RootNamespace.ThisAssembly.Git.SemVer.Source)] +#endif + +#if LOCALNAMESPACE +namespace _RootNamespace_ +{ +#endif + /// Provides access to the current assembly information. + partial class ThisAssembly + { + /// Provides access to the git information for the current assembly. + public partial class Git + { + /// IsDirty: $GitIsDirty$ + public const bool IsDirty = $GitIsDirty$; + + /// IsDirtyString: $GitIsDirty$ + public const string IsDirtyString = "$GitIsDirty$"; + + /// Branch: $GitBranch$ + public const string Branch = "$GitBranch$"; + + /// Commit: $GitCommit$ + public const string Commit = "$GitCommit$"; + + /// Sha: $GitSha$ + public const string Sha = "$GitSha$"; + + /// Commits on top of base version: $GitCommits$ + public const string Commits = "$GitCommits$"; + + /// Tag: $GitTag$ + public const string Tag = "$GitTag$"; + + /// Base tag: $GitBaseTag$ + public const string BaseTag = "$GitBaseTag$"; + + /// Provides access to the base version information used to determine the . + public partial class BaseVersion + { + /// Major: $GitBaseVersionMajor$ + public const string Major = "$GitBaseVersionMajor$"; + + /// Minor: $GitBaseVersionMinor$ + public const string Minor = "$GitBaseVersionMinor$"; + + /// Patch: $GitBaseVersionPatch$ + public const string Patch = "$GitBaseVersionPatch$"; + } + + /// Provides access to SemVer information for the current assembly. + public partial class SemVer + { + /// Major: $GitSemVerMajor$ + public const string Major = "$GitSemVerMajor$"; + + /// Minor: $GitSemVerMinor$ + public const string Minor = "$GitSemVerMinor$"; + + /// Patch: $GitSemVerPatch$ + public const string Patch = "$GitSemVerPatch$"; + + /// Label: $GitSemVerLabel$ + public const string Label = "$GitSemVerLabel$"; + + /// Label with dash prefix: $GitSemVerDashLabel$ + public const string DashLabel = "$GitSemVerDashLabel$"; + + /// Source: $GitSemVerSource$ + public const string Source = "$GitSemVerSource$"; + } + } + } +#if LOCALNAMESPACE +} +#endif +#pragma warning restore 0436 diff --git a/w32/Setup/GitInfo/GitInfo.targets b/w32/Setup/GitInfo/GitInfo.targets new file mode 100644 index 0000000000..7c587c62d6 --- /dev/null +++ b/w32/Setup/GitInfo/GitInfo.targets @@ -0,0 +1,953 @@ + + + + + + + GitInfo.txt + + $(MSBuildProjectDirectory) + + $([MSBuild]::GetDirectoryNameOfFileAbove($(GitInfoBaseDir), $(GitVersionFile)))\$(GitVersionFile) + + master + 0000000 + 0.1.0 + + $(IntermediateOutputPath)ThisAssembly.GitInfo.g$(DefaultLanguageSourceExtension) + false + true + low + ADDMETADATA + NOMETADATA + + + 0 + MSBuild + + false + $(GitSkipCache) + $(GitSkipCache) + + 2.5.0 + + + + + + GitInfo; + GitVersion; + GitThisAssembly; + GitInfoReport; + $(CoreCompileDependsOn) + + + <_GitBaseVersionExpr Condition="'$(_GitBaseVersionExpr)' == ''">^v?(?<MAJOR>\d+)\.(?<MINOR>\d+)\.(?<PATCH>\d+)(?:\-(?<LABEL>[\dA-Za-z\-\.]+))?$|^(?<LABEL>[\dA-Za-z\-\.]+)\-v?(?<MAJOR>\d+)\.(?<MINOR>\d+)\.(?<PATCH>\d+)$ + + <_GitInfoFile>$(IntermediateOutputPath)GitInfo.cache + + + + + + + + + SetGitExe; + _EnsureGit; + _GitRoot; + _GitInputs; + _GitClearCache; + _GitReadCache; + _GitBranch; + _GitCommit; + _GitPopulateInfo; + + + + + <_ShortShaFormat>%%h + <_LongShaFormat>%%H + + + <_ShortShaFormat>%h + <_LongShaFormat>%H + + + + + + + + + + + + + <_GitCurrentVersion>$([System.Text.RegularExpressions.Regex]::Match("$(_GitOutput)", "\d+\.\d+\.\d+").Value) + + + + + + + + + + + + + + $(_GitOutput.Trim()) + + + + + + + + + + $(_GitOutput.Trim()) + + + + + $([System.IO.Path]::Combine('$(GitRoot)', '.git')) + <_IsGitFile>$([System.IO.File]::Exists('$(GitDir)')) + + + + + + + + + <_IsGitWorkTree>$(_GitIsWorkTree.Trim()) + + + + + + + + + + + + + + + $(_GitCommonDir.Trim()) + + + + <_GitFileContents>$([System.IO.File]::ReadAllText('$(GitDir)')) + $([System.String]::new('$(_GitFileContents)').Substring(7).Trim()) + $([System.IO.Path]::Combine('$(GitRoot)', '$(GitDir)')) + $([System.IO.Path]::GetFullPath('$(GitDir)')) + + + $(GitDir)$([System.IO.Path]::DirectorySeparatorChar) + + + + + + + + + + + + + + <_GitInput Include="$(GitDir)HEAD" /> + <_GitInput Include="$(GitVersionFile)" Condition="Exists('$(GitVersionFile)')" /> + + + + + + + + + + + + + + + + + + + + + + <_GitCachedInfo>$([System.IO.File]::ReadAllText('$(_GitInfoFile)')) + + + + + + + + %(GitInfo.GitBranch) + %(GitInfo.GitCommit) + %(GitInfo.GitSha) + %(GitInfo.GitBaseVersion) + %(GitInfo.GitBaseVersionSource) + %(GitInfo.GitBaseVersionMajor) + %(GitInfo.GitBaseVersionMinor) + %(GitInfo.GitBaseVersionPatch) + %(GitInfo.GitCommits) + %(GitInfo.GitTag) + %(GitInfo.GitBaseTag) + %(GitInfo.GitSemVerMajor) + %(GitInfo.GitSemVerMinor) + %(GitInfo.GitSemVerPatch) + %(GitInfo.GitSemVerLabel) + %(GitInfo.GitSemVerDashLabel) + %(GitInfo.GitSemVerSource) + + + + + + + <_GitHead>$([System.IO.Path]::Combine($(GitDir), 'HEAD')) + <_GitHead>$([System.IO.Path]::GetFullPath($(_GitHead))) + <_GitHead>$([System.IO.File]::ReadAllText('$(_GitHead)')) + $([System.Text.RegularExpressions.Regex]::Match($(_GitHead), '(?<=refs/heads/).+$')) + $(GitBranch.Trim()) + + + + + + + + + $(GitDefaultBranch) + + + + + + + + + + + + + $(GitDefaultCommit) + + + + + + + + + $(GitDefaultCommit) + + + + + + + + $(GitRoot) + $(GitBranch) + $(GitCommit) + $(GitSha) + + + + + + + GitInfo; + _GitBaseVersionBranch; + _GitBaseVersionTagExists; + _GitBaseVersionTag; + _GitBaseVersionFile; + _GitBaseVersionFallback; + _GitValidateBaseVersion; + _GitPopulateVersionInfo; + _GitWriteCache + + + + + + + + + $([System.IO.File]::ReadAllText('$(GitVersionFile)')) + $(GitBaseVersion.Trim()) + + $([System.Text.RegularExpressions.Regex]::IsMatch($(GitBaseVersion), $(_GitBaseVersionExpr))) + + $(IsValidGitBaseVersion.Trim()) + + + + + + <_GitVersionFile>$(GitVersionFile) + $(GitVersionFile) + File + + + + + + + + + + + + + + + + + + + 0 + <_GitLastBump>$(_GitLastBump.Trim()) + <_GitCommitsRelativeTo>$(GitCommitsRelativeTo) + + <_GitCommitsRelativeTo Condition="'$(_GitCommitsRelativeTo)' == '' And '$([System.IO.Path]::GetDirectoryName($(GitVersionFile)))' != ''">"$([System.IO.Path]::GetDirectoryName("$(GitVersionFile)"))" + + <_GitCommitsRelativeTo Condition="'$(_GitCommitsRelativeTo)' == ''">. + + + + + + + + + + + + + + + + + + + + $([System.Text.RegularExpressions.Regex]::IsMatch($(GitBranch), $(_GitBaseVersionExpr))) + + $(IsValidGitBaseVersion.Trim()) + + + + + + $(GitBranch) + GitBranch + Branch + + + + + + + + + + + + 0 + + + + + + + + + + + + + + + + + + + 0 + + + + + + + + + + + + + + + + + + $([System.Text.RegularExpressions.Regex]::IsMatch($(GitBaseTag), $(_GitBaseVersionExpr))) + + $(IsValidGitBaseVersion.Trim()) + + $(GitBaseTag) + + + + + + GitBaseTag + Tag + 0 + + + + + + + + + + + + + + + + 0 + + + + + + + + + $([System.Text.RegularExpressions.Regex]::IsMatch($(GitDefaultVersion), $(_GitBaseVersionExpr))) + + $(IsValidGitDefaultVersion.Trim()) + 0 + + + + + + + + + + + + $(GitDefaultVersion) + Default + + + + + + + + + + + + $([System.Text.RegularExpressions.Regex]::IsMatch($(GitBaseVersion), $(_GitBaseVersionExpr))) + + $(IsValidGitBaseVersion.Trim()) + + + + + + + + + + + $(GitBaseVersion.TrimStart('v')) + $(GitBaseVersion.TrimStart('V')) + $([System.Text.RegularExpressions.Regex]::Match($(GitBaseVersion), $(_GitBaseVersionExpr)).Groups['MAJOR'].Value) + $([System.Text.RegularExpressions.Regex]::Match($(GitBaseVersion), $(_GitBaseVersionExpr)).Groups['MINOR'].Value) + $([System.Text.RegularExpressions.Regex]::Match($(GitBaseVersion), $(_GitBaseVersionExpr)).Groups['PATCH'].Value) + $(GitBaseVersionMajor) + $(GitBaseVersionMinor) + $([MSBuild]::Add('$(GitBaseVersionPatch)', '$(GitCommits)')) + $([System.Text.RegularExpressions.Regex]::Match($(GitBaseVersion), $(_GitBaseVersionExpr)).Groups['LABEL'].Value) + -$(GitSemVerLabel) + + + + + <_GitInfo Include="@(GitInfo -> Distinct())"> + $(GitBaseVersion) + $(GitBaseVersionSource) + $(GitBaseVersionMajor) + $(GitBaseVersionMinor) + $(GitBaseVersionPatch) + $(GitCommits) + $(GitTag) + $(GitBaseTag) + $(GitSemVerMajor) + $(GitSemVerMinor) + $(GitSemVerPatch) + $(GitSemVerLabel) + $(GitSemVerDashLabel) + $(GitSemVerSource) + + + + + + + + + + + <_GitInfoContent>$([System.IO.File]::ReadAllText('$(MSBuildThisFileDirectory)GitInfo.cache.pp')) + + <_GitInfoContent>$(_GitInfoContent.Replace('$GitBranch$', '$(GitBranch)')) + <_GitInfoContent>$(_GitInfoContent.Replace('$GitCommits$', '$(GitCommits)')) + <_GitInfoContent>$(_GitInfoContent.Replace('$GitCommit$', '$(GitCommit)')) + <_GitInfoContent>$(_GitInfoContent.Replace('$GitSha$', '$(GitSha)')) + <_GitInfoContent>$(_GitInfoContent.Replace('$GitBaseVersion$', '$(GitBaseVersion)')) + <_GitInfoContent>$(_GitInfoContent.Replace('$GitBaseVersionSource$', '$(GitBaseVersionSource)')) + <_GitInfoContent>$(_GitInfoContent.Replace('$GitBaseVersionMajor$', '$(GitBaseVersionMajor)')) + <_GitInfoContent>$(_GitInfoContent.Replace('$GitBaseVersionMinor$', '$(GitBaseVersionMinor)')) + <_GitInfoContent>$(_GitInfoContent.Replace('$GitBaseVersionPatch$', '$(GitBaseVersionPatch)')) + <_GitInfoContent>$(_GitInfoContent.Replace('$GitTag$', '$(GitTag)')) + <_GitInfoContent>$(_GitInfoContent.Replace('$GitBaseTag$', '$(GitBaseTag)')) + <_GitInfoContent>$(_GitInfoContent.Replace('$GitSemVerMajor$', '$(GitSemVerMajor)')) + <_GitInfoContent>$(_GitInfoContent.Replace('$GitSemVerMinor$', '$(GitSemVerMinor)')) + <_GitInfoContent>$(_GitInfoContent.Replace('$GitSemVerPatch$', '$(GitSemVerPatch)')) + <_GitInfoContent>$(_GitInfoContent.Replace('$GitSemVerLabel$', '$(GitSemVerLabel)')) + <_GitInfoContent>$(_GitInfoContent.Replace('$GitSemVerDashLabel$', '$(GitSemVerDashLabel)')) + <_GitInfoContent>$(_GitInfoContent.Replace('$GitSemVerSource$', '$(GitSemVerSource)')) + + + + <_GitInfoFileDir>$([System.IO.Path]::GetDirectoryName('$(_GitInfoFile)')) + + + + + + + + + + + + + + + GitInfo; + GitVersion; + _GitInputs; + _GitGenerateThisAssembly + + + + + + + + + + <_GeneratedCodeFiles Include="$(GitInfoThisAssemblyFile)" /> + + + + + + + + <_ThisAssemblyContent>$([System.IO.File]::ReadAllText('$(MSBuildThisFileDirectory)GitInfo$(DefaultLanguageSourceExtension).pp')) + + + <_ThisAssemblyContent Condition="'$(ThisAssemblyNamespace)' != ''">$(_ThisAssemblyContent.Replace('$NamespaceDefine$', 'LOCALNAMESPACE')) + <_ThisAssemblyContent Condition="'$(ThisAssemblyNamespace)' == ''">$(_ThisAssemblyContent.Replace('$NamespaceDefine$', 'GLOBALNAMESPACE')) + <_ThisAssemblyContent>$(_ThisAssemblyContent.Replace('$MetadataDefine$', '$(GitThisAssemblyMetadataDefine)')) + + <_ThisAssemblyContent Condition="'$(ThisAssemblyNamespace)' != ''">$(_ThisAssemblyContent.Replace('RootNamespace.', '$(ThisAssemblyNamespace).')) + <_ThisAssemblyContent Condition="'$(ThisAssemblyNamespace)' == ''">$(_ThisAssemblyContent.Replace('RootNamespace.', '')) + + <_ThisAssemblyContent>$(_ThisAssemblyContent.Replace('_RootNamespace_', '$(ThisAssemblyNamespace)')) + + + <_ThisAssemblyContent Condition="'$(Language)' == 'C#' And '$(GitRoot)' == ''">$(_ThisAssemblyContent.Replace('$GitIsDirty$', 'false')) + <_ThisAssemblyContent Condition="'$(Language)' == 'C#' And '$(GitIsDirty)' == '1'">$(_ThisAssemblyContent.Replace('$GitIsDirty$', 'true')) + <_ThisAssemblyContent Condition="'$(Language)' == 'C#' And '$(GitIsDirty)' == '0'">$(_ThisAssemblyContent.Replace('$GitIsDirty$', 'false')) + + <_ThisAssemblyContent Condition="'$(Language)' == 'VB' And '$(GitRoot)' == ''">$(_ThisAssemblyContent.Replace('$GitIsDirty$', 'False')) + <_ThisAssemblyContent Condition="'$(Language)' == 'VB' And '$(GitIsDirty)' == '1'">$(_ThisAssemblyContent.Replace('$GitIsDirty$', 'True')) + <_ThisAssemblyContent Condition="'$(Language)' == 'VB' And '$(GitIsDirty)' == '0'">$(_ThisAssemblyContent.Replace('$GitIsDirty$', 'False')) + + <_ThisAssemblyContent>$(_ThisAssemblyContent.Replace('$GitBranch$', '$(GitBranch)')) + <_ThisAssemblyContent>$(_ThisAssemblyContent.Replace('$GitCommits$', '$(GitCommits)')) + <_ThisAssemblyContent>$(_ThisAssemblyContent.Replace('$GitCommit$', '$(GitCommit)')) + <_ThisAssemblyContent>$(_ThisAssemblyContent.Replace('$GitSha$', '$(GitSha)')) + <_ThisAssemblyContent>$(_ThisAssemblyContent.Replace('$GitBaseVersion$', '$(GitBaseVersion)')) + <_ThisAssemblyContent>$(_ThisAssemblyContent.Replace('$GitBaseVersionSource$', '$(GitBaseVersionSource)')) + <_ThisAssemblyContent>$(_ThisAssemblyContent.Replace('$GitBaseVersionMajor$', '$(GitBaseVersionMajor)')) + <_ThisAssemblyContent>$(_ThisAssemblyContent.Replace('$GitBaseVersionMinor$', '$(GitBaseVersionMinor)')) + <_ThisAssemblyContent>$(_ThisAssemblyContent.Replace('$GitBaseVersionPatch$', '$(GitBaseVersionPatch)')) + <_ThisAssemblyContent>$(_ThisAssemblyContent.Replace('$GitTag$', '$(GitTag)')) + <_ThisAssemblyContent>$(_ThisAssemblyContent.Replace('$GitBaseTag$', '$(GitBaseTag)')) + <_ThisAssemblyContent>$(_ThisAssemblyContent.Replace('$GitSemVerMajor$', '$(GitSemVerMajor)')) + <_ThisAssemblyContent>$(_ThisAssemblyContent.Replace('$GitSemVerMinor$', '$(GitSemVerMinor)')) + <_ThisAssemblyContent>$(_ThisAssemblyContent.Replace('$GitSemVerPatch$', '$(GitSemVerPatch)')) + <_ThisAssemblyContent>$(_ThisAssemblyContent.Replace('$GitSemVerLabel$', '$(GitSemVerLabel)')) + <_ThisAssemblyContent>$(_ThisAssemblyContent.Replace('$GitSemVerDashLabel$', '$(GitSemVerDashLabel)')) + <_ThisAssemblyContent>$(_ThisAssemblyContent.Replace('$GitSemVerSource$', '$(GitSemVerSource)')) + + + + $([System.IO.Path]::GetDirectoryName('$(GitInfoThisAssemblyFile)')) + + + + + + + + + + git + + + + + + + + + git + + + + + "C:\Program Files\Git\bin\git.exe" + "C:\Program Files (x86)\Git\bin\git.exe" + C:\msysgit\bin\git.exe + + + + + + + + $(MSBuildThisFileDirectory)wslrun.cmd git + $(MSBuildThisFileDirectory)wslpath.cmd + + + + + C:\cygwin\bin\git.exe + C:\cygwin64\bin\git.exe + + + + + C:\cygwin\bin\cygpath.exe + C:\cygwin64\bin\cygpath.exe + + + + + true + + diff --git a/w32/Setup/GitInfo/GitInfo.vb.pp b/w32/Setup/GitInfo/GitInfo.vb.pp new file mode 100644 index 0000000000..cf45487b29 --- /dev/null +++ b/w32/Setup/GitInfo/GitInfo.vb.pp @@ -0,0 +1,91 @@ +' +#Const $NamespaceDefine$ = 1 +#Const $MetadataDefine$ = 1 + +#If ADDMETADATA + + + + + + + + + + + + + + + + +#End If + +#If LOCALNAMESPACE +Namespace Global._RootNamespace_ +#Else +Namespace Global +#End If + ''' Provides access to the git information for the current assembly. + Partial Class ThisAssembly + ''' Provides access to the git information for the current assembly. + Partial Public Class Git + ''' IsDirty: $GitIsDirty$ + Public Const IsDirty As Boolean = $GitIsDirty$ + + ''' IsDirtyString: $GitIsDirty$ + Public Const IsDirtyString As String = "$GitIsDirty$" + + ''' Branch: $GitBranch$ + Public Const Branch As String = "$GitBranch$" + + ''' Commit: $GitCommit$ + Public Const Commit As String = "$GitCommit$" + + ''' Commit: $GitSha$ + Public Const Sha As String = "$GitSha$" + + ''' Commits on top of base version: $GitCommits$ + Public Const Commits As String = "$GitCommits$" + + ''' Tag: $GitTag$ + Public Const Tag As String = "$GitTag$" + + ''' Base tag: $GitBaseTag$ + Public Const BaseTag As String = "$GitBaseTag$" + + ''' Provides access to the base version information used to determine the . + Partial Public Class BaseVersion + ''' Major: $GitBaseVersionMajor$ + Public Const Major As String = "$GitBaseVersionMajor$" + + ''' Minor $GitBaseVersionMinor$ + Public Const Minor As String = "$GitBaseVersionMinor$" + + ''' Patch $GitBaseVersionPatch$ + Public Const Patch As String = "$GitBaseVersionPatch$" + End Class + + ''' Provides access to SemVer information for the current assembly. + Partial Public Class SemVer + ''' Major: $GitSemVerMajor$ + Public Const Major As String = "$GitSemVerMajor$" + + ''' Minor: $GitSemVerMinor$ + Public Const Minor As String = "$GitSemVerMinor$" + + ''' Patch: $GitSemVerPatch$ + Public Const Patch As String = "$GitSemVerPatch$" + + ''' Label: $GitSemVerLabel$ + Public Const Label As String = "$GitSemVerLabel$" + + ''' Label with dash prefix: $GitSemVerDashLabel$ + Public Const DashLabel As String = "$GitSemVerDashLabel$" + + ''' Label with dash prefix: $GitSemVerSource$ + Public Const Source As String = "$GitSemVerVerSource$" + End Class + End Class + End Class +End Namespace diff --git a/w32/Setup/GitInfo/wslpath.cmd b/w32/Setup/GitInfo/wslpath.cmd new file mode 100644 index 0000000000..cc971cee9c --- /dev/null +++ b/w32/Setup/GitInfo/wslpath.cmd @@ -0,0 +1,26 @@ +@echo off +setlocal EnableExtensions EnableDelayedExpansion +REM Usage: wslpath.cmd -w +REM Converts a path from the Linux /mnt/c/... format into Windows format. + +REM Usage: wslpath.cmd -u +REM Converts a path from Windows to Linux format. + +REM Both usages require `wslrun.cmd` in the same directory as this file. + +if exist %0\..\wslrun.cmd set WSLRUN="%0\..\wslrun.cmd" +if exist %CD%\%0\..\wslrun.cmd set WSLRUN="%CD%\%0\..\wslrun.cmd" + +if "%1" == "-w" goto :towindows +if "%1" == "-u" shift /1 + +REM Convert path to Linux +if exist "%1\*" (pushd %1) else (pushd %~dp1) +if ERRORLEVEL 1 goto :eof +%WSLRUN% pwd +popd +goto :eof + +:towindows +REM Convert path to Windows +%WSLRUN% cd "'%2'" ^&^& cmd.exe /c cd diff --git a/w32/Setup/GitInfo/wslrun.cmd b/w32/Setup/GitInfo/wslrun.cmd new file mode 100644 index 0000000000..87cbf87c56 --- /dev/null +++ b/w32/Setup/GitInfo/wslrun.cmd @@ -0,0 +1,11 @@ +@echo off +REM Usage: wslrun.cmd +REM Runs the given command in the Windows Subsystem for Linux bash shell. + +REM Locate bash.exe +REM 32/64 bits causes issues here because it actually redirects the System32 dir +set BASH=bash.exe +if exist C:\Windows\System32\bash.exe set BASH=C:\Windows\System32\bash.exe +if exist C:\Windows\Sysnative\bash.exe set BASH=C:\Windows\Sysnative\bash.exe + +%BASH% -c "%*" diff --git a/w32/Setup/Setup.2015.wixproj b/w32/Setup/Setup.2015.wixproj index 1d12c3f92a..92931d3f7d 100644 --- a/w32/Setup/Setup.2015.wixproj +++ b/w32/Setup/Setup.2015.wixproj @@ -1,5 +1,11 @@  - + + + true + + + + {47213370-b933-487d-9f45-bca26d7e2b6f} 2.0 @@ -780,7 +786,13 @@ - + + + + + + + @@ -789,7 +801,7 @@ - + @@ -798,6 +810,10 @@ Other similar extension points exist, see Wix.targets. --> + + + +