Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace AssemblyVersion with Version #2494

Merged
merged 4 commits into from
Feb 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions .github/workflows/dotnetcore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,9 @@ jobs:
with:
dotnet-version: 8.0.x

- name: update versions
run: .\updateAssemblyInfo.ps1

# Build and test
- name: Restore packages
run: dotnet restore Wilson.sln

- name: Run the tests
run: dotnet test Wilson.sln

# Run baseline package validation
- name: Pack
run: .\pack.ps1
run: dotnet pack Product.proj --no-restore --no-build
21 changes: 21 additions & 0 deletions Product.proj
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<Project DefaultTargets="Build">
<PropertyGroup>
<PreviewVersionSuffix Condition="'$(PreviewVersionSuffix)' == ''">preview-$([System.DateTime]::Now.AddYears(-2019).Year)$([System.DateTime]::Now.ToString("MMddHHmmss"))</PreviewVersionSuffix>
</PropertyGroup>

<Target Name="Build">
<MSBuild Projects="Wilson.sln" Targets="Build" Properties="PreviewVersionSuffix=$(PreviewVersionSuffix)" />
</Target>
<Target Name="restore">
<MSBuild Projects="Wilson.sln" Targets="restore" Properties="PreviewVersionSuffix=$(PreviewVersionSuffix)" />
</Target>
<Target Name="clean">
<MSBuild Projects="Wilson.sln" Targets="clean" Properties="PreviewVersionSuffix=$(PreviewVersionSuffix)" />
</Target>
<Target Name="pack">
<MSBuild Projects="Wilson.sln" Targets="pack" Properties="PreviewVersionSuffix=$(PreviewVersionSuffix)" />
</Target>
<Target Name="VSTest">
<MSBuild Projects="Wilson.sln" Targets="VSTest" Properties="PreviewVersionSuffix=$(PreviewVersionSuffix)" />
</Target>
</Project>
19 changes: 15 additions & 4 deletions build/common.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,13 @@

<Import Project="dependencies.props" />
<Import Project="targets.props" />
<Import Project="version.props" />

<PropertyGroup>
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)35MSSharedLib1024.snk</AssemblyOriginatorKeyFile>
<Authors>Microsoft</Authors>
<Copyright>© Microsoft Corporation. All rights reserved.</Copyright>
<Company>Microsoft Corporation.</Company>
<DelaySign>true</DelaySign>
<GenerateAssemblyVersionAttribute>false</GenerateAssemblyVersionAttribute>
<GenerateAssemblyFileVersionAttribute>false</GenerateAssemblyFileVersionAttribute>
<GenerateAssemblyInformationalVersionAttribute>false</GenerateAssemblyInformationalVersionAttribute>
<OutputTypeEx>library</OutputTypeEx>
<Product>Microsoft IdentityModel</Product>
<RepositoryType>git</RepositoryType>
Expand All @@ -34,6 +30,21 @@
<LangVersion>12</LangVersion>
</PropertyGroup>

<!-- Wilson version -->
<PropertyGroup>
<WilsonCurrentVersion>7.3.2</WilsonCurrentVersion>

<PreviewVersionSuffix Condition="'$(PreviewVersionSuffix)' == '' and '$(BuildingInsideVisualStudio)' != 'true'">preview-$([System.DateTime]::Now.AddYears(-2019).Year)$([System.DateTime]::Now.ToString("MMddHHmmss"))</PreviewVersionSuffix>
<!--VS re-evaluates the variables, so having seconds or minutes creates an infinite loop of package updates-->
<PreviewVersionSuffix Condition="'$(PreviewVersionSuffix)' == '' and '$(BuildingInsideVisualStudio)' == 'true'">preview-$([System.DateTime]::Now.AddYears(-2019).Year)$([System.DateTime]::Now.ToString("MMddHH"))</PreviewVersionSuffix>
<IsCustomPreview>$(WilsonVersion.Contains("-"))</IsCustomPreview>
<Version Condition="'$(WilsonVersion)' != ''">$(WilsonVersion)</Version>
<VersionSuffix Condition="'$(WilsonVersion)' == ''">$(PreviewVersionSuffix)</VersionSuffix>
<VersionPrefix Condition="'$(WilsonVersion)' == ''">$(WilsonCurrentVersion)</VersionPrefix>
<FileVersion Condition="'$(WilsonVersion)' != '' and '$(IsCustomPreview)' != 'true' ">$(WilsonVersion).$([System.DateTime]::Now.AddYears(-2019).Year)$([System.DateTime]::Now.ToString("MMdd"))</FileVersion>
<FileVersion Condition="'$(WilsonVersion)' == ''">$(WilsonCurrentVersion).$([System.DateTime]::Now.AddYears(-2019).Year)$([System.DateTime]::Now.ToString("MMdd"))</FileVersion>
</PropertyGroup>

<PropertyGroup>
<EnablePackageValidation>true</EnablePackageValidation>
<PackageValidationBaselineVersion>7.0.0</PackageValidationBaselineVersion>
Expand Down
45 changes: 26 additions & 19 deletions build/releaseBuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ variables:
- group: Middleware
- name: BuildPlatform
value: 'any cpu'
- name: BuildConfiguration
value: 'release'

# The following variables are set in the release build UI:
# BuildConfiguration: 'debug|release'
# WilsonVersion: ''. Full version number

jobs:
- job: build
Expand All @@ -29,6 +31,12 @@ jobs:
timeoutInMinutes: 360

steps:
- script: echo $(BuildConfiguration)
displayName: 'display Build Configuration'

- script: echo $(WilsonVersion)
displayName: 'display WilsonVersion'

- task: UseDotNet@2
displayName: 'Use .NET Core sdk 2.x'
inputs:
Expand Down Expand Up @@ -63,19 +71,11 @@ jobs:
regedit /s .\build\strongNameBypass.reg
displayName: 'Strong Name Bypass'

- task: PowerShell@2
displayName: 'Update Assembly Info'
inputs:
targetType: filePath
filePath: ./updateAssemblyInfo.ps1
arguments: '-packageType $(BuildConfiguration)'

- task: DotNetCoreCLI@2
displayName: Build
inputs:
command: 'custom'
projects: 'wilson.sln'
custom: 'msbuild'
command: 'build'
projects: 'Product.proj'
arguments: '/r:True /p:Configuration=$(BuildConfiguration) /p:Platform="Any CPU" /verbosity:m /p:SourceLinkCreate=true'

- task: PowerShell@2
Expand Down Expand Up @@ -135,12 +135,19 @@ jobs:
#Sign Wilson 7x task group
- template: template-sign-wilson.yaml

- task: PowerShell@2
displayName: Pack
inputs:
targetType: filePath
filePath: ./pack.ps1
arguments: '-buildType $(BuildConfiguration) C:\hostedtoolcache\windows\dotnet'
- task: DotNetCoreCLI@2
displayName: 'Pack libraries'
inputs:
command: 'pack'
arguments: '--no-restore'
packDirectory: '$(Build.SourcesDirectory)\artifacts'
nobuild: true
verbosityPack: 'Minimal'
configuration: $(BuildConfiguration)
packagesToPack: 'Product.proj'
feedsToUse: 'config'
nugetConfigPath: Nuget.config
externalFeedCredentials: 'Internal Analyzers'

- task: EsrpCodeSigning@4
displayName: 'Sign Nuget Packages'
Expand Down Expand Up @@ -190,7 +197,7 @@ jobs:
continueOnError: true

- task: AzureArtifacts.manifest-generator-task.manifest-generator-task.ManifestGeneratorTask@0
displayName: 'Manifest Generator '
displayName: 'Manifest Generator'
inputs:
BuildDropPath: '$(Build.SourcesDirectory)\src'
ManifestDirPath: '$(Build.SourcesDirectory)\artifacts'
Expand Down
2 changes: 0 additions & 2 deletions buildConfiguration.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
<dotnetArchitecture>x64</dotnetArchitecture>
<nugetVersion>3.5.0-rc-1285</nugetVersion>
FuPingFranco marked this conversation as resolved.
Show resolved Hide resolved
<runtimes>net461,netstandard2.0</runtimes>
<assemblyVersion>7.3.2</assemblyVersion>
<nugetSuffix>preview</nugetSuffix>
<projects>
<src>
<project name="Microsoft.IdentityModel.Logging" />
Expand Down
3 changes: 3 additions & 0 deletions buildTestPack.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
dotnet build /r Product.proj
dotnet test --no-restore --no-build Product.proj
dotnet pack --no-restore --no-build Product.proj
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
using System.Reflection;
using System.Runtime.InteropServices;

[assembly: AssemblyInformationalVersion("0.0.1")]
[assembly: AssemblyFileVersion("0.0.1")]
[assembly: AssemblyMetadata("Serviceable", "True")]
[assembly: AssemblyVersion("0.0.1")]
[assembly: CLSCompliant(true)]
[assembly: ComVisible(false)]
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

[assembly: AssemblyInformationalVersion("0.0.1")]
[assembly: AssemblyFileVersion("0.0.1")]
[assembly: AssemblyMetadata("Serviceable", "True")]
[assembly: AssemblyVersion("0.0.1")]
[assembly: CLSCompliant(true)]
[assembly: ComVisible(false)]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
using System.Reflection;
using System.Runtime.InteropServices;

[assembly: AssemblyInformationalVersion("0.0.1")]
[assembly: AssemblyFileVersion("0.0.1")]
[assembly: AssemblyMetadata("Serviceable", "True")]
[assembly: AssemblyVersion("0.0.1")]
[assembly: CLSCompliant(true)]
[assembly: ComVisible(false)]
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

[assembly: AssemblyInformationalVersion("0.0.1")]
[assembly: AssemblyFileVersion("0.0.1")]
[assembly: AssemblyMetadata("Serviceable", "True")]
[assembly: AssemblyVersion("0.0.1")]
[assembly: CLSCompliant(true)]
[assembly: ComVisible(false)]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
using System.Reflection;
using System.Runtime.InteropServices;

[assembly: AssemblyInformationalVersion("0.0.1")]
[assembly: AssemblyFileVersion("0.0.1")]
[assembly: AssemblyMetadata("Serviceable", "True")]
[assembly: AssemblyVersion("0.0.1")]
[assembly: CLSCompliant(true)]
[assembly: ComVisible(false)]
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
using System.Reflection;
using System.Runtime.InteropServices;

[assembly: AssemblyInformationalVersion("0.0.1")]
[assembly: AssemblyFileVersion("0.0.1")]
[assembly: AssemblyMetadata("Serviceable", "True")]
[assembly: AssemblyVersion("0.0.1")]
[assembly: CLSCompliant(true)]
[assembly: ComVisible(false)]
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
using System.Reflection;
using System.Runtime.InteropServices;

[assembly: AssemblyInformationalVersion("0.0.1")]
[assembly: AssemblyFileVersion("0.0.1")]
[assembly: AssemblyMetadata("Serviceable", "True")]
[assembly: AssemblyVersion("0.0.1")]
[assembly: CLSCompliant(true)]
[assembly: ComVisible(false)]
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

[assembly: AssemblyInformationalVersion("0.0.1")]
[assembly: AssemblyFileVersion("0.0.1")]
[assembly: AssemblyMetadata("Serviceable", "True")]
[assembly: AssemblyVersion("0.0.1")]
[assembly: CLSCompliant(true)]
[assembly: ComVisible(false)]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

[assembly: AssemblyInformationalVersion("0.0.1")]
[assembly: AssemblyFileVersion("0.0.1")]
[assembly: AssemblyMetadata("Serviceable", "True")]
[assembly: AssemblyVersion("0.0.1")]
[assembly: CLSCompliant(true)]
[assembly: ComVisible(false)]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

[assembly: AssemblyInformationalVersion("0.0.1")]
[assembly: AssemblyFileVersion("0.0.1")]
[assembly: AssemblyMetadata("Serviceable", "True")]
[assembly: AssemblyVersion("0.0.1")]
[assembly: CLSCompliant(true)]
[assembly: ComVisible(false)]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
using System.Reflection;
using System.Runtime.InteropServices;

[assembly: AssemblyInformationalVersion("0.0.1")]
[assembly: AssemblyFileVersion("0.0.1")]
[assembly: AssemblyMetadata("Serviceable", "True")]
[assembly: AssemblyVersion("0.0.1")]
[assembly: CLSCompliant(true)]
[assembly: ComVisible(false)]
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;


[assembly: AssemblyInformationalVersion("0.0.1")]
[assembly: AssemblyFileVersion("0.0.1")]
[assembly: AssemblyMetadata("Serviceable", "True")]
[assembly: AssemblyVersion("0.0.1")]
[assembly: CLSCompliant(true)]
[assembly: ComVisible(false)]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

[assembly: AssemblyInformationalVersion("0.0.1")]
[assembly: AssemblyFileVersion("0.0.1")]
[assembly: AssemblyMetadata("Serviceable", "True")]
[assembly: AssemblyVersion("0.0.1")]
[assembly: CLSCompliant(true)]
[assembly: ComVisible(false)]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

[assembly: AssemblyInformationalVersion("0.0.1")]
[assembly: AssemblyFileVersion("0.0.1")]
[assembly: AssemblyMetadata("Serviceable", "True")]
[assembly: AssemblyVersion("0.0.1")]
[assembly: CLSCompliant(true)]
[assembly: ComVisible(false)]

Expand Down
3 changes: 0 additions & 3 deletions src/Microsoft.IdentityModel.Xml/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

[assembly: AssemblyInformationalVersion("0.0.1")]
[assembly: AssemblyFileVersion("0.0.1")]
[assembly: AssemblyMetadata("Serviceable", "True")]
[assembly: AssemblyVersion("0.0.1")]
[assembly: CLSCompliant(true)]
[assembly: ComVisible(false)]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

[assembly: AssemblyInformationalVersion("0.0.1")]
[assembly: AssemblyFileVersion("0.0.1")]
[assembly: AssemblyMetadata("Serviceable", "True")]
[assembly: AssemblyVersion("0.0.1")]
[assembly: CLSCompliant(true)]
[assembly: ComVisible(false)]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<OutputType>Exe</OutputType>
<PublishTrimmed>true</PublishTrimmed>
<TrimMode>full</TrimMode>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
</PropertyGroup>

<ItemGroup>
Expand Down
Loading
Loading