Skip to content

Commit 505c310

Browse files
authored
Merge pull request #1571 from Microsoft/buildNumberGenerationV2
Build number generation v2
2 parents 2e11d2f + 0e02dc9 commit 505c310

18 files changed

Lines changed: 112 additions & 167 deletions

Build/Common.Build.settings

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,4 +144,38 @@
144144
<PropertyGroup>
145145
<CodeAnalysisRuleSet>$(BuildRoot)\Build\xTVS.ruleset</CodeAnalysisRuleSet>
146146
</PropertyGroup>
147+
148+
<PropertyGroup>
149+
<MajorVersion>1</MajorVersion>
150+
<MinorVersion>4</MinorVersion>
151+
152+
<!-- This was reset for Dev15. It needs to eventually be reset to the current year for Dev16 -->
153+
<VersionZeroYear>2016</VersionZeroYear>
154+
</PropertyGroup>
155+
156+
<!-- BUILD_BUILDNUMBER is expected to be set by the build server.
157+
In case of a local build, we'll default to a very
158+
high number so that the locally built assembly is always picked -->
159+
<PropertyGroup Condition="'$(BUILD_BUILDNUMBER)' == ''">
160+
<BuildVersion>42.42.42.42</BuildVersion>
161+
</PropertyGroup>
162+
163+
<PropertyGroup Condition="'$(BUILD_BUILDNUMBER)' != ''">
164+
<VersionCurrentYearOffset>$([MSBuild]::Subtract($([System.Int32]::Parse($(BUILD_BUILDNUMBER.Substring(0,4)))),$(VersionZeroYear)))</VersionCurrentYearOffset>
165+
<VersionCurrentYearOffset Condition=" '$(VersionCurrentYearOffset)' == '0' "></VersionCurrentYearOffset>
166+
167+
<!-- Example version numbers generated by this scheme:
168+
Built on 4/6/2016, targeting Visual Studio 1.4: 1.4.0406.1
169+
Built on 12/6/2017, targeting Visual Studio 1.4: 1.4.11206.1
170+
Built on 4/6/2019, targeting Visual Studio 1.4: 1.4.30406.1 -->
171+
<BuildVersion>$(MajorVersion).$(MinorVersion).$(VersionCurrentYearOffset)$(BUILD_BUILDNUMBER.Substring(4))</BuildVersion>
172+
</PropertyGroup>
173+
174+
<PropertyGroup>
175+
<BuildVersionExtended>$(BuildVersion)</BuildVersionExtended>
176+
<BuildVersionExtended Condition="'$(BUILD_SOURCEVERSION)'!=''">$(BuildVersionExtended) commit:$(BUILD_SOURCEVERSION)</BuildVersionExtended>
177+
178+
<VSIXBuildVersion>$(BuildVersion)</VSIXBuildVersion>
179+
<AssemblyVersion>$(MajorVersion).0.0.0</AssemblyVersion>
180+
</PropertyGroup>
147181
</Project>

Build/Common.Build.targets

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<Import Project="Common.Build.VSSDK.targets" Condition="$(UseVSSDK) or $(UseVSSDKTemplateOnly)" />
44
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" Condition="'$(Language)' == 'C++'" />
55
<Import Project="Common.Build.Wix.targets" Condition="'$(Language)' == 'WiX'" />
6+
<Import Project="fileVersion.targets" Condition="'$(Language)' == 'C#'" />
67

78
<!--
89
Transforms ProjectReference2 items into references that will be built

Build/fileVersion.targets

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
4+
<PropertyGroup>
5+
<GeneratedAssemblyInfoFile>$(IntermediateOutputPath)GeneratedAssemblyInfo$(DefaultLanguageSourceExtension)</GeneratedAssemblyInfoFile>
6+
</PropertyGroup>
7+
8+
<PropertyGroup>
9+
<CoreCompileDependsOn>GenerateAssemblyInfoFile;$(CoreCompileDependsOn)</CoreCompileDependsOn>
10+
</PropertyGroup>
11+
12+
<!-- Depends on PrepareForBuild because the latter is responsible for calling MakeDir(IntermediateOutputPath).
13+
Without it, if we do a design-time build of a project (e.g. in Workspace.LoadSolution) immediately following
14+
a tfpt treeclean, WriteCodeFragment may fail because the obj folder doesn't even exist at that time. -->
15+
<Target Name="GenerateAssemblyInfoFile"
16+
Inputs="$(MSBuildThisFileFullPath)"
17+
Outputs="$(GeneratedAssemblyInfoFile)"
18+
DependsOnTargets="PrepareForBuild"
19+
Condition="'$(Language)' == 'C#' or '$(Language)' == 'VB'">
20+
21+
<Error Condition="'$(BuildVersion)'==''" Text="'BuildVersion' is not defined. Try rebuilding clean. If the problem presists, make sure gdb.settings.targets is included in this project."/>
22+
<Error Condition="'$(AssemblyVersion)'==''" Text="'AssemblyVersion' is not defined. Try rebuilding clean. If the problem presists, make sure gdb.settings.targets is included in this project."/>
23+
24+
<ItemGroup>
25+
<AssemblyAttribute Include="System.Reflection.AssemblyCompanyAttribute">
26+
<_Parameter1>Microsoft Corporation</_Parameter1>
27+
</AssemblyAttribute>
28+
<AssemblyAttribute Include="System.Reflection.AssemblyCopyrightAttribute">
29+
<_Parameter1>© Microsoft Corporation. All rights reserved.</_Parameter1>
30+
</AssemblyAttribute>
31+
<AssemblyAttribute Include="System.Reflection.AssemblyVersionAttribute">
32+
<_Parameter1>$(AssemblyVersion)</_Parameter1>
33+
</AssemblyAttribute>
34+
<AssemblyAttribute Include="System.Reflection.AssemblyFileVersionAttribute">
35+
<_Parameter1>$(BuildVersion)</_Parameter1>
36+
</AssemblyAttribute>
37+
<AssemblyAttribute Include="System.Reflection.AssemblyInformationalVersionAttribute">
38+
<_Parameter1>$(BuildVersionExtended)</_Parameter1>
39+
</AssemblyAttribute>
40+
</ItemGroup>
41+
42+
<WriteCodeFragment AssemblyAttributes="@(AssemblyAttribute)"
43+
Language="$(Language)"
44+
OutputFile="$(GeneratedAssemblyInfoFile)">
45+
<Output TaskParameter="OutputFile" ItemName="Compile" />
46+
<Output TaskParameter="OutputFile" ItemName="FileWrites" />
47+
</WriteCodeFragment>
48+
</Target>
49+
50+
<Target Name="GetVSIXVersion" Outputs="$(VSIXBuildVersion)" />
51+
52+
</Project>

Common/Product/TestAdapter/VisualStudioApp.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ private static DTE GetDTE(int processId)
116116
prefix = "VisualStudio";
117117
}
118118

119-
var progId = $"!{prefix}.DTE.{AssemblyVersionInfo.VSVersion}:{processId}";
119+
var progId = $"!{prefix}.DTE.15.0:{processId}";
120120
object runningObject = null;
121121

122122
IBindCtx bindCtx = null;

Nodejs/Product/AssemblyInfoCommon.cs

Lines changed: 0 additions & 13 deletions
This file was deleted.

Nodejs/Product/AssemblyVersion.cs

Lines changed: 0 additions & 41 deletions
This file was deleted.

Nodejs/Product/InteractiveWindow/Properties/AssemblyInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
[assembly: AssemblyDescription("")]
1010
[assembly: AssemblyConfiguration("")]
1111

12-
[assembly: ProvideCodeBase(AssemblyName = "Microsoft.NodejsTools.InteractiveWindow", CodeBase = "Microsoft.NodejsTools.InteractiveWindow.dll", Version = AssemblyVersionInfo.StableVersion)]
12+
[assembly: ProvideCodeBase(AssemblyName = "Microsoft.NodejsTools.InteractiveWindow", CodeBase = "Microsoft.NodejsTools.InteractiveWindow.dll", Version = "1.0.0.0")]
1313
[assembly: NeutralResourcesLanguage("en", UltimateResourceFallbackLocation.Satellite)]
1414
[assembly: InternalsVisibleTo("TestUtilities.UI, PublicKey=002400000480000094000000060200000024000052534131000400000100010007d1fa57c4aed9f0a32e84aa0faefd0de9e8fd6aec8f87fb03766c834c99921eb23be79ad9d5dcc1dd9ad236132102900b723cf980957fc4e177108fc607774f29e8320e92ea05ece4e821c0a5efe8f1645c4c0c93c1ab99285d622caa652c1dfad63d745d6f2de5f17e5eaf0fc4963d261c8a12436518206dc093344d5ad293")]
1515
[assembly: InternalsVisibleTo("ReplWindowUITests, PublicKey=002400000480000094000000060200000024000052534131000400000100010007d1fa57c4aed9f0a32e84aa0faefd0de9e8fd6aec8f87fb03766c834c99921eb23be79ad9d5dcc1dd9ad236132102900b723cf980957fc4e177108fc607774f29e8320e92ea05ece4e821c0a5efe8f1645c4c0c93c1ab99285d622caa652c1dfad63d745d6f2de5f17e5eaf0fc4963d261c8a12436518206dc093344d5ad293")]

Nodejs/Product/InteractiveWindow/source.extension.vsixmanifest

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
22
<Metadata>
3-
<Identity Id="29102E6C-34F2-4FF1-BA2F-C02ADE3846E8" Version="1.4.0.2" Language="en-US" Publisher="Microsoft" />
3+
<Identity Id="29102E6C-34F2-4FF1-BA2F-C02ADE3846E8" Version="|%CurrentProject%;GetVSIXVersion|" Language="en-US" Publisher="Microsoft" />
44
<DisplayName>Node.js Tools - Interactive Window</DisplayName>
55
<Description xml:space="preserve">Node.js Tools - Interactive Window.</Description>
66
<MoreInfo>http://go.microsoft.com/fwlink/?LinkId=785971</MoreInfo>
@@ -13,12 +13,9 @@
1313
Id specifications are minimums; any SKU equal or 'higher' will accept
1414
them. -->
1515
<Installation>
16-
<InstallationTarget Version="[14.0.0,16.0)" Id="Microsoft.VisualStudio.Community" />
17-
<InstallationTarget Version="[14.0.0,16.0)" Id="Microsoft.VisualStudio.Pro" />
18-
<InstallationTarget Version="[14.0.0,16.0)" Id="Microsoft.VisualStudio.Enterprise" />
19-
<InstallationTarget Version="[14.0.0,16.0)" Id="Microsoft.VisualStudio.VSWinExpress" />
20-
<InstallationTarget Version="[14.0.0,16.0)" Id="Microsoft.VisualStudio.VWDExpress" />
21-
<InstallationTarget Version="[14.0.0,16.0)" Id="Microsoft.VisualStudio.VSWinDesktopExpress" />
16+
<InstallationTarget Version="[15.0.0,16.0)" Id="Microsoft.VisualStudio.Community" />
17+
<InstallationTarget Version="[15.0.0,16.0)" Id="Microsoft.VisualStudio.Pro" />
18+
<InstallationTarget Version="[15.0.0,16.0)" Id="Microsoft.VisualStudio.Enterprise" />
2219
</Installation>
2320
<Prerequisites>
2421
<Prerequisite Id="Microsoft.VisualStudio.Component.CoreEditor" Version="[15.0,16.0)" DisplayName="Visual Studio core editor" />

Nodejs/Product/Nodejs/NodejsPackage.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ namespace Microsoft.NodejsTools
4545
[PackageRegistration(UseManagedResourcesOnly = true)]
4646
// This attribute is used to register the information needed to show this package
4747
// in the Help/About dialog of Visual Studio.
48-
[InstalledProductRegistration("#110", "#112", AssemblyVersionInfo.Version, IconResourceID = 400)]
48+
[InstalledProductRegistration("#110", "#112", "1.0.0.0", IconResourceID = 400)]
4949
[Guid(Guids.NodejsPackageString)]
5050
[ProvideOptionPage(typeof(NodejsGeneralOptionsPage), "Node.js Tools", "General", 114, 115, true)]
5151
[ProvideDebugEngine("Node.js Debugging", typeof(AD7ProgramProvider), typeof(AD7Engine), AD7Engine.DebugEngineId, setNextStatement: false, hitCountBp: true, justMyCodeStepping: false)]

Nodejs/Product/Nodejs/Properties/AssemblyInfo.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@
1717
[assembly: ComVisible(false)]
1818
[assembly: CLSCompliant(false)]
1919
[assembly: NeutralResourcesLanguage("en", UltimateResourceFallbackLocation.Satellite)]
20-
[assembly: ProvideCodeBase(AssemblyName = "Microsoft.NodejsTools", CodeBase = "Microsoft.NodejsTools.dll", Version = AssemblyVersionInfo.StableVersion)]
21-
[assembly: ProvideCodeBase(AssemblyName = "Microsoft.NodejsTools.Npm", CodeBase = "Microsoft.NodejsTools.Npm.dll", Version = AssemblyVersionInfo.StableVersion)]
22-
[assembly: ProvideCodeBase(AssemblyName = "Microsoft.NodejsTools.PressAnyKey", CodeBase = "Microsoft.NodejsTools.PressAnyKey.exe", Version = AssemblyVersionInfo.StableVersion)]
20+
[assembly: ProvideCodeBase(AssemblyName = "Microsoft.NodejsTools", CodeBase = "Microsoft.NodejsTools.dll", Version = "1.0.0.0")]
21+
[assembly: ProvideCodeBase(AssemblyName = "Microsoft.NodejsTools.Npm", CodeBase = "Microsoft.NodejsTools.Npm.dll", Version = "1.0.0.0")]
22+
[assembly: ProvideCodeBase(AssemblyName = "Microsoft.NodejsTools.PressAnyKey", CodeBase = "Microsoft.NodejsTools.PressAnyKey.exe", Version = "1.0.0.0")]
2323
[assembly: ProvideCodeBase(AssemblyName = "Microsoft.NodejsTools.ProjectWizard", CodeBase = "Microsoft.NodejsTools.ProjectWizard.dll", Version = "1.0.0.0")]
24-
[assembly: ProvideCodeBase(AssemblyName = "Microsoft.NodejsTools.TestAdapter", CodeBase = "Microsoft.NodejsTools.TestAdapter.dll", Version = AssemblyVersionInfo.StableVersion)]
24+
[assembly: ProvideCodeBase(AssemblyName = "Microsoft.NodejsTools.TestAdapter", CodeBase = "Microsoft.NodejsTools.TestAdapter.dll", Version = "1.0.0.0")]
2525
[assembly: ProvideCodeBase(AssemblyName = "Microsoft.NodejsTools.Telemetry.15.0", CodeBase = "Microsoft.NodejsTools.Telemetry.15.0.dll", Version = "15.0.1.0")]
2626

2727
[assembly: InternalsVisibleTo("TestUtilities.NodeJS, PublicKey=002400000480000094000000060200000024000052534131000400000100010007d1fa57c4aed9f0a32e84aa0faefd0de9e8fd6aec8f87fb03766c834c99921eb23be79ad9d5dcc1dd9ad236132102900b723cf980957fc4e177108fc607774f29e8320e92ea05ece4e821c0a5efe8f1645c4c0c93c1ab99285d622caa652c1dfad63d745d6f2de5f17e5eaf0fc4963d261c8a12436518206dc093344d5ad293")]

0 commit comments

Comments
 (0)