From 4d89a5eed1f9d9956e1b446bba6ed56d7d8670ee Mon Sep 17 00:00:00 2001 From: Matthias Gernand Date: Fri, 17 Dec 2021 20:31:30 +0100 Subject: [PATCH] Fixed versioning. (#5) --- Fluxera.ValueObject.sln | 11 ++- GitVersion.yml | 5 -- azure-pipelines.yml | 72 ++----------------- .../Directory.Build.props | 18 ++--- .../Fluxera.ValueObject.csproj | 13 ++-- .../Properties/AssemblyInfo.cs | 4 -- src/SolutionInfo.cs | 18 ----- tests/Directory.Build.props | 17 +++++ .../Fluxera.ValueObject.UnitTests.csproj | 2 +- 9 files changed, 48 insertions(+), 112 deletions(-) rename Directory.Build.props => src/Directory.Build.props (68%) delete mode 100644 src/Fluxera.ValueObject/Properties/AssemblyInfo.cs delete mode 100644 src/SolutionInfo.cs create mode 100644 tests/Directory.Build.props diff --git a/Fluxera.ValueObject.sln b/Fluxera.ValueObject.sln index 0527add..f2b7085 100644 --- a/Fluxera.ValueObject.sln +++ b/Fluxera.ValueObject.sln @@ -7,7 +7,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".items", ".items", "{75AC41 ProjectSection(SolutionItems) = preProject .gitignore = .gitignore azure-pipelines.yml = azure-pipelines.yml - Directory.Build.props = Directory.Build.props GitVersion.yml = GitVersion.yml global.json = global.json icon.png = icon.png @@ -16,12 +15,18 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".items", ".items", "{75AC41 EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{DF28D730-99B3-4811-AAC7-725A73B3F668}" + ProjectSection(SolutionItems) = preProject + src\Directory.Build.props = src\Directory.Build.props + EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{F18D2D58-282C-4D93-8D9A-3A76CF98F018}" + ProjectSection(SolutionItems) = preProject + tests\Directory.Build.props = tests\Directory.Build.props + EndProjectSection EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Fluxera.ValueObject", "src\Fluxera.ValueObject\Fluxera.ValueObject.csproj", "{0112DE42-7C32-4ECC-A5C1-6839C63A689C}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Fluxera.ValueObject", "src\Fluxera.ValueObject\Fluxera.ValueObject.csproj", "{0112DE42-7C32-4ECC-A5C1-6839C63A689C}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Fluxera.ValueObject.UnitTests", "tests\Fluxera.ValueObject.UnitTests\Fluxera.ValueObject.UnitTests.csproj", "{6F6CAF72-1D71-434B-AD09-7A9216669502}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Fluxera.ValueObject.UnitTests", "tests\Fluxera.ValueObject.UnitTests\Fluxera.ValueObject.UnitTests.csproj", "{6F6CAF72-1D71-434B-AD09-7A9216669502}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/GitVersion.yml b/GitVersion.yml index c17eaa2..0093d88 100644 --- a/GitVersion.yml +++ b/GitVersion.yml @@ -1,6 +1 @@ -next-version: 6.0.0 mode: Mainline - -branches: - master: - regex: ^master$|^main$ \ No newline at end of file diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 3d43ca7..574b1b7 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -7,40 +7,31 @@ trigger: variables: BuildConfiguration: Release - DotNetCoreVersion: 6.0.100 + DotNetCoreVersion: 6.0.101 stages: - stage: BuildAndTest jobs: - job: BuildAndTest pool: - vmImage: 'windows-latest' + name: Default steps: - checkout: self persistCredentials: 'true' clean: true - # Run GitVersion to acquire the current build version. - - task: GitVersion@5 - displayName: 'Acquire and Apply Version' - inputs: - updateAssemblyInfo: true - updateAssemblyInfoFilename: 'src/SolutionInfo.cs' - additionalArguments: '/ensureassemblyinfo' - configFilePath: 'GitVersion.yml' # Install the desired .NET SDK. - task: UseDotNet@2 displayName: 'Acquire .NET SDK' inputs: packageType: 'sdk' version: $(DotNetCoreVersion) - includePreviewVersions: true + includePreviewVersions: false # Build all projects. - task: DotNetCoreCLI@2 displayName: 'Build Projects' inputs: projects: '**/*.csproj' arguments: '--configuration $(BuildConfiguration)' - nugetConfigPath: NuGet.config # Run all available tests. - task: DotNetCoreCLI@2 displayName: 'Execute Tests' @@ -49,70 +40,19 @@ stages: projects: '**/*Tests/*.csproj' arguments: '--configuration $(BuildConfiguration)' nobuild: true - # Set the version to a environment variable. This will be used in the NuGet pack task. - - script: echo %Action%%SemVerEnv% - displayName: 'Set Package Version Variable' - env: - Action: '##vso[task.setvariable variable=NuGetPackageVersion]' - SemVerEnv: $(GitVersion.SemVer) # Create the NuGet packages. - task: DotNetCoreCLI@2 - displayName: 'NuGet Pack Packages' + displayName: 'Pack Packages' inputs: command: 'pack' packagesToPack: 'src/**/*.csproj' nobuild: true - versioningScheme: 'byEnvVar' - versionEnvVar: 'NuGetPackageVersion' verbosityPack: Minimal includesymbols: false # Copy created NuGet packages to the builds artifacts directory. - task: PublishBuildArtifacts@1 - displayName: 'NuGet Publish Package Artifacts' + displayName: 'Publish Package Artifacts' inputs: PathtoPublish: '$(Build.ArtifactStagingDirectory)' ArtifactName: 'drop' - publishLocation: 'Container' -#- stage: DeployPackages -# dependsOn: BuildAndTest -# # Only publish packages for main, develop (alpha) and release (beta) branches. -# condition: and(succeeded('BuildAndTest'), or(eq(variables['Build.SourceBranch'], 'refs/heads/main'), eq(variables['Build.SourceBranch'], 'refs/heads/develop'), startsWith(variables['Build.SourceBranch'], 'refs/heads/release/'))) -# jobs: -# - job: DeployPackages -# pool: -# vmImage: 'windows-latest' -# steps: -# - checkout: self -# persistCredentials: 'true' -# clean: true -# # Run GitVersion to acquire the current build version. -# - task: GitVersion@5 -# displayName: 'Acquire and Apply Version' -# inputs: -# updateAssemblyInfo: false -# configFilePath: 'GitVersion.yml' -# # Download the created packages. -# - task: DownloadBuildArtifacts@0 -# inputs: -# buildType: 'current' -# downloadType: 'single' -# artifactName: 'drop' -# downloadPath: '$(System.ArtifactsDirectory)' -# # Publish the NuGet packages to the package feed. -# # https://www.programmingwithwolfgang.com/azure-devops-publish-nuget/ -# - task: DotNetCoreCLI@2 -# condition: not(contains(variables['Build.BuildNumber'], '-ci')) -# displayName: 'NuGet Push Packages' -# inputs: -# command: custom -# custom: nuget -# arguments: > -# push $(System.ArtifactsDirectory)/**/*.nupkg -# -s https://api.nuget.org/v3/index.json -# -k $(NuGetApiKey) -# #command: 'push' -# #packagesToPush: '$(System.ArtifactsDirectory)/**/*.nupkg' -# #nuGetFeedType: 'external' -# #publishFeedCredentials: 'Foundation' -# #verbosityRestore: Normal -# #includesymbols: false \ No newline at end of file + publishLocation: 'Container' \ No newline at end of file diff --git a/Directory.Build.props b/src/Directory.Build.props similarity index 68% rename from Directory.Build.props rename to src/Directory.Build.props index a8ab161..258670c 100644 --- a/Directory.Build.props +++ b/src/Directory.Build.props @@ -2,21 +2,16 @@ latest - false enable disable + true + true Fluxera Software Development GmbH - Copyright © 2014-2021 Fluxera Software Development GmbH. All rights reserved. Fluxera Software Foundation - - - - 6.0.0 - 6.0.0 - 6.0.0 + Copyright © 2014-2021 Fluxera Software Development GmbH. All rights reserved. @@ -30,7 +25,12 @@ en git MIT - True + true + + + + + \ No newline at end of file diff --git a/src/Fluxera.ValueObject/Fluxera.ValueObject.csproj b/src/Fluxera.ValueObject/Fluxera.ValueObject.csproj index 3dfebd4..bf5ad92 100644 --- a/src/Fluxera.ValueObject/Fluxera.ValueObject.csproj +++ b/src/Fluxera.ValueObject/Fluxera.ValueObject.csproj @@ -5,14 +5,11 @@ - fluxera;library;ddd;value-object + Fluxera.ValueObject An extendable guard implementation. + fluxera;library;ddd;value-object - - - - true @@ -25,7 +22,11 @@ - + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + \ No newline at end of file diff --git a/src/Fluxera.ValueObject/Properties/AssemblyInfo.cs b/src/Fluxera.ValueObject/Properties/AssemblyInfo.cs deleted file mode 100644 index b05ba67..0000000 --- a/src/Fluxera.ValueObject/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,4 +0,0 @@ -using System.Reflection; - -[assembly: AssemblyTitle("Fluxera.ValueObject")] -[assembly: AssemblyDescription("A value objects library.")] diff --git a/src/SolutionInfo.cs b/src/SolutionInfo.cs deleted file mode 100644 index b8d71fb..0000000 --- a/src/SolutionInfo.cs +++ /dev/null @@ -1,18 +0,0 @@ -// - -using System.Reflection; -using System.Resources; - -#if DEBUG -[assembly: AssemblyConfiguration("Debug")] -#else -[assembly: AssemblyConfiguration("Release")] -#endif - -[assembly: AssemblyCompany("Fluxera Software Development GmbH")] -[assembly: AssemblyProduct("Fluxera Software Foundation")] -[assembly: AssemblyCopyright("Copyright © 2014-2021 Fluxera Software Development GmbH. All rights reserved.")] -[assembly: NeutralResourcesLanguage("en")] -[assembly: AssemblyVersion("6.0.0")] -[assembly: AssemblyFileVersion("6.0.0")] -[assembly: AssemblyInformationalVersion("6.0.0")] diff --git a/tests/Directory.Build.props b/tests/Directory.Build.props new file mode 100644 index 0000000..ed7150c --- /dev/null +++ b/tests/Directory.Build.props @@ -0,0 +1,17 @@ + + + + latest + enable + disable + false + false + + + + Fluxera Software Development GmbH + Fluxera Software Foundation + Copyright © 2014-2021 Fluxera Software Development GmbH. All rights reserved. + + + \ No newline at end of file diff --git a/tests/Fluxera.ValueObject.UnitTests/Fluxera.ValueObject.UnitTests.csproj b/tests/Fluxera.ValueObject.UnitTests/Fluxera.ValueObject.UnitTests.csproj index e6aa102..b5eeb92 100644 --- a/tests/Fluxera.ValueObject.UnitTests/Fluxera.ValueObject.UnitTests.csproj +++ b/tests/Fluxera.ValueObject.UnitTests/Fluxera.ValueObject.UnitTests.csproj @@ -13,7 +13,7 @@ - +