Skip to content

Commit

Permalink
Merge pull request #216 from xunit/deterministic
Browse files Browse the repository at this point in the history
build and package updates
  • Loading branch information
clairernovotny committed Jun 2, 2020
2 parents fd7af66 + 32e23f3 commit 49ff47e
Show file tree
Hide file tree
Showing 8 changed files with 191 additions and 107 deletions.
37 changes: 37 additions & 0 deletions Directory.build.props
@@ -0,0 +1,37 @@
<Project>
<PropertyGroup>
<Copyright>Copyright (c) .NET Foundation and Contributors.</Copyright>
<Authors>.NET Foundation and Contributors</Authors>
<Company>.NET Foundation</Company>
<Product>xUnit.net Testing Framework</Product>
<LangVersion>latest</LangVersion>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<PackageIcon>logo-512-transparent.png</PackageIcon>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageProjectUrl>https://github.com/xunit/visualstudio.xunit</PackageProjectUrl>
<DebugType>embedded</DebugType>
<LangVersion>latest</LangVersion>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)src/signing.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Nerdbank.GitVersioning" Version="3.1.91" PrivateAssets="all" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All"/>
</ItemGroup>

<PropertyGroup Condition="'$(TF_BUILD)' == 'true'">
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
</PropertyGroup>

<Target Name="AddCommitHashToAssemblyAttributes" BeforeTargets="GetAssemblyAttributes">
<ItemGroup>
<AssemblyAttribute Include="System.Reflection.AssemblyMetadataAttribute" Condition=" '$(SourceRevisionId)' != '' ">
<_Parameter1>CommitHash</_Parameter1>
<_Parameter2>$(SourceRevisionId)</_Parameter2>
</AssemblyAttribute>
</ItemGroup>
</Target>

</Project>
6 changes: 0 additions & 6 deletions NuGet.Config
@@ -1,12 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear/>
<add key="myget.org/F/xunit" value="https://www.myget.org/F/xunit/api/v3/index.json" protocolVersion="3" />
<add key="myget.org/F/b4ff5f6" value="http://www.myget.org/F/b4ff5f68eccf4f6bbfed74f055f88d8f/api/v3/index.json" protocolVersion="3" />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
</packageSources>
<disabledPackageSources>
<add key="Microsoft and .NET" value="true" />
</disabledPackageSources>
</configuration>
138 changes: 92 additions & 46 deletions azure-pipelines.yml
Expand Up @@ -7,58 +7,104 @@ pr:
- rel/*

pool:
vmImage: vs2017-win2016
vmImage: windows-latest

variables:
BuildConfiguration: Release
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true

steps:
- task: DotNetCoreCLI@2
inputs:
command: custom
custom: tool
arguments: install --tool-path . nbgv
displayName: Install NBGV tool

- script: nbgv cloud
displayName: Set Version
stages:
- stage: Build
jobs:
- job: Build
pool:
vmImage: windows-latest

- task: MSBuild@1
displayName: Build
inputs:
solution: visualstudio.xunit.sln
msbuildArguments: /restore /p:UseDotNetNativeToolchain=false /p:PackageOutputPath=$(Build.ArtifactStagingDirectory)\CI
configuration: $(BuildConfiguration)
maximumCpuCount: true
variables:
BuildConfiguration: Release

- task: MSBuild@1
displayName: Build for Test (ppdb) workaround
inputs:
solution: test/test.xunit.runner.visualstudio/test.xunit.runner.visualstudio.csproj
msbuildArguments: /t:build /p:DebugType=portable
configuration: $(BuildConfiguration)
maximumCpuCount: true
steps:
- task: UseDotNet@2
displayName: Use .NET Core 3.1.x SDK
inputs:
version: 3.1.x
performMultiLevelLookup: true

- task: DotNetCoreCLI@2
inputs:
command: test
projects: test/test.xunit.runner.visualstudio/test.xunit.runner.visualstudio.csproj
arguments: -c $(BuildConfiguration) --no-build --no-restore --collect:"Code Coverage" -s $(System.DefaultWorkingDirectory)/test/CodeCoverage.runsettings
displayName: Run Unit Tests
- task: DotNetCoreCLI@2
inputs:
command: custom
custom: tool
arguments: install --tool-path . nbgv
displayName: Install NBGV tool

- task: PowerShell@2
displayName: Authenticode Artifacts
inputs:
filePath: scripts/Sign-Package.ps1
env:
SignClientUser: $(SignClientUser)
SignClientSecret: $(SignClientSecret)
ArtifactDirectory: $(Build.ArtifactStagingDirectory)
condition: and(succeeded(), not(eq(variables['build.reason'], 'PullRequest')), not(eq(variables['SignClientSecret'], '')), not(eq(variables['SignClientUser'], '')))
- script: nbgv cloud
displayName: Set Version

- task: PublishBuildArtifacts@1
displayName: Publish CI Artifacts
inputs:
pathToPublish: $(Build.ArtifactStagingDirectory)\CI
artifactType: container
artifactName: CI
- task: MSBuild@1
displayName: Build
inputs:
solution: visualstudio.xunit.sln
msbuildArguments: /restore /p:UseDotNetNativeToolchain=false /p:PackageOutputPath=$(Build.ArtifactStagingDirectory)\artifacts
configuration: $(BuildConfiguration)
maximumCpuCount: true

- task: MSBuild@1
displayName: Build for Test (ppdb) workaround
inputs:
solution: test/test.xunit.runner.visualstudio/test.xunit.runner.visualstudio.csproj
msbuildArguments: /t:build /p:DebugType=portable
configuration: $(BuildConfiguration)
maximumCpuCount: true

- task: DotNetCoreCLI@2
inputs:
command: test
projects: test/test.xunit.runner.visualstudio/test.xunit.runner.visualstudio.csproj
arguments: -c $(BuildConfiguration) --no-build --no-restore --collect:"Code Coverage" -s $(System.DefaultWorkingDirectory)/test/CodeCoverage.runsettings
displayName: Run Unit Tests

- publish: $(Build.ArtifactStagingDirectory)\artifacts
displayName: Publish build packages
artifact: BuildPackages

- publish: config
displayName: Publish signing config
artifact: config

- stage: CodeSign
condition: and(succeeded('Build'), not(eq(variables['build.reason'], 'PullRequest')))
jobs:
- deployment: CodeSign
displayName: Code Signing
pool:
vmImage: windows-latest
environment: Code Sign
variables:
- group: SignClient Credentials
strategy:
runOnce:
deploy:
steps:
- task: DotNetCoreCLI@2
inputs:
command: custom
custom: tool
arguments: install --tool-path . SignClient
displayName: Install SignTool tool

- pwsh: |
.\SignClient "Sign" `
--baseDirectory "$(Pipeline.Workspace)\BuildPackages" `
--input "**/*.nupkg" `
--config "$(Pipeline.Workspace)\config\signclient.json" `
--filelist "$(Pipeline.Workspace)\config\filter.txt" `
--user "$(SignClientUser)" `
--secret "$(SignClientSecret)" `
--name "xUnit.net" `
--description "xUnit.net" `
--descriptionUrl "https://github.com/xunit/visualstudio.xunit"
displayName: Sign packages
- publish: $(Pipeline.Workspace)/BuildPackages
displayName: Publish Signed Packages
artifact: SignedPackages
File renamed without changes.
File renamed without changes.
Binary file added logo-512-transparent.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 0 additions & 26 deletions scripts/Sign-Package.ps1

This file was deleted.

91 changes: 62 additions & 29 deletions src/xunit.runner.visualstudio/xunit.runner.visualstudio.csproj
@@ -1,26 +1,15 @@
<Project Sdk="MSBuild.Sdk.Extras">

<PropertyGroup>
<Copyright>Copyright (c) .NET Foundation and Contributors.</Copyright>
<Authors>.NET Foundation and Contributors</Authors>
<Company>.NET Foundation</Company>
<Product>xUnit.net Testing Framework</Product>

<Title>xUnit.net [Runner: Visual Studio]</Title>
<AssemblyTitle>xUnit.net Runner for Visual Studio ($(TargetFramework))</AssemblyTitle>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<AssemblyOriginatorKeyFile>../signing.snk</AssemblyOriginatorKeyFile>
<DebugType>embedded</DebugType>
<LangVersion>latest</LangVersion>
<RootNamespace>Xunit.Runner.VisualStudio</RootNamespace>
<SignAssembly>true</SignAssembly>
<TargetFrameworks>net452;netcoreapp2.1;uap10.0.16299</TargetFrameworks>
<WarningsAsErrors>true</WarningsAsErrors>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<Description>Visual Studio 2017 15.9+ Test Explorer runner for the xUnit.net framework. Capable of running xUnit.net v1.9.2 and v2.0+ tests. Supports .NET 2.0 or later, .NET Core 2.1 or later, and Universal Windows 10.0.16299 or later.</Description>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageIconUrl>https://raw.githubusercontent.com/xunit/media/master/logo-512-transparent.png</PackageIconUrl>
<PackageProjectUrl>https://github.com/xunit/visualstudio.xunit</PackageProjectUrl>

<DevelopmentDependency>true</DevelopmentDependency>
<BuildOutputTargetFolder>build</BuildOutputTargetFolder>
<XunitVersion>2.4.1</XunitVersion>
Expand All @@ -44,29 +33,73 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Nerdbank.GitVersioning" Version="3.1.91" PrivateAssets="all" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
<PackageReference Include="xunit.runner.reporters" Version="$(XunitVersion)" PrivateAssets="All" />
<PackageReference Include="Microsoft.TestPlatform.ObjectModel" Version="16.6.1" PrivateAssets="All" />
</ItemGroup>

<ItemGroup Label="Package">
<None Include="build\xunit.runner.visualstudio.desktop.props" PackagePath="build\net452\xunit.runner.visualstudio.props" Pack="true" />
<None Include="$(NuGetPackageRoot)xunit.runner.reporters\$(XunitVersion)\lib\net452\*.dll" PackagePath="build\net452" Pack="true" Visible="false" />
<None Include="$(NuGetPackageRoot)xunit.runner.utility\$(XunitVersion)\lib\net452\*.dll" PackagePath="build\net452" Pack="true" Visible="false" />
<None Include="$(NuGetPackageRoot)xunit.abstractions\2.0.3\lib\netstandard1.0\*.dll" PackagePath="build\net452" Pack="true" Visible="false" />
<None Include="build\xunit.runner.visualstudio.desktop.props"
PackagePath="build\net452\xunit.runner.visualstudio.props"
Pack="true" />
<None Include="$(NuGetPackageRoot)xunit.runner.reporters\$(XunitVersion)\lib\net452\*.dll"
PackagePath="build\net452"
Pack="true"
Visible="false" />
<None Include="$(NuGetPackageRoot)xunit.runner.utility\$(XunitVersion)\lib\net452\*.dll"
PackagePath="build\net452"
Pack="true"
Visible="false" />
<None Include="$(NuGetPackageRoot)xunit.abstractions\2.0.3\lib\netstandard1.0\*.dll"
PackagePath="build\net452"
Pack="true"
Visible="false" />

<None Include="build\xunit.runner.visualstudio.dotnetcore.props" PackagePath="build\netcoreapp2.1\xunit.runner.visualstudio.props" Pack="true" />
<None Include="$(NuGetPackageRoot)xunit.runner.reporters\$(XunitVersion)\lib\netcoreapp1.0\*.dll" PackagePath="build\netcoreapp2.1" Pack="true" Visible="false" />
<None Include="$(NuGetPackageRoot)xunit.runner.utility\$(XunitVersion)\lib\netcoreapp1.0\*.dll" PackagePath="build\netcoreapp2.1" Pack="true" Visible="false" />
<None Include="$(NuGetPackageRoot)xunit.abstractions\2.0.3\lib\netstandard2.0\*.dll" PackagePath="build\netcoreapp2.1" Pack="true" Visible="false" />
<None Include="build\xunit.runner.visualstudio.dotnetcore.props"
PackagePath="build\netcoreapp2.1\xunit.runner.visualstudio.props"
Pack="true" />
<None Include="$(NuGetPackageRoot)xunit.runner.reporters\$(XunitVersion)\lib\netcoreapp1.0\*.dll"
PackagePath="build\netcoreapp2.1"
Pack="true"
Visible="false" />
<None Include="$(NuGetPackageRoot)xunit.runner.utility\$(XunitVersion)\lib\netcoreapp1.0\*.dll"
PackagePath="build\netcoreapp2.1"
Pack="true"
Visible="false" />
<None Include="$(NuGetPackageRoot)xunit.abstractions\2.0.3\lib\netstandard2.0\*.dll"
PackagePath="build\netcoreapp2.1"
Pack="true"
Visible="false" />

<None Include="build\xunit.runner.visualstudio.uwp.props" PackagePath="build\uap10.0.16299\xunit.runner.visualstudio.props" Pack="true" />
<None Include="build\xunit.runner.visualstudio.uwp.targets" PackagePath="build\uap10.0.16299\xunit.runner.visualstudio.targets" Pack="true" />
<None Include="$(NuGetPackageRoot)xunit.runner.reporters\$(XunitVersion)\lib\netstandard1.5\*.dll" PackagePath="build\uap10.0.16299" Pack="true" Visible="false" />
<None Include="$(NuGetPackageRoot)xunit.runner.utility\$(XunitVersion)\lib\netstandard1.5\*.dll" PackagePath="build\uap10.0.16299" Pack="true" Visible="false" />
<None Include="$(NuGetPackageRoot)xunit.runner.utility\$(XunitVersion)\lib\uap10.0\*.dll" PackagePath="build\uap10.0.16299" Pack="true" Visible="false" />
<None Include="$(NuGetPackageRoot)xunit.runner.utility\$(XunitVersion)\lib\uap10.0\*.pri" PackagePath="build\uap10.0.16299" Pack="true" Visible="false" />
<None Include="..\..\logo-512-transparent.png"
PackagePath="logo-512-transparent.png"
Pack="true" />
<None Include="..\..\License.txt"
PackagePath="License.txt"
Pack="true" />


<None Include="build\xunit.runner.visualstudio.uwp.props"
PackagePath="build\uap10.0.16299\xunit.runner.visualstudio.props"
Pack="true" />
<None Include="build\xunit.runner.visualstudio.uwp.targets"
PackagePath="build\uap10.0.16299\xunit.runner.visualstudio.targets"
Pack="true" />
<None Include="$(NuGetPackageRoot)xunit.runner.reporters\$(XunitVersion)\lib\netstandard1.5\*.dll"
PackagePath="build\uap10.0.16299"
Pack="true"
Visible="false" />
<None Include="$(NuGetPackageRoot)xunit.runner.utility\$(XunitVersion)\lib\netstandard1.5\*.dll"
PackagePath="build\uap10.0.16299"
Pack="true"
Visible="false" />
<None Include="$(NuGetPackageRoot)xunit.runner.utility\$(XunitVersion)\lib\uap10.0\*.dll"
PackagePath="build\uap10.0.16299"
Pack="true"
Visible="false" />
<None Include="$(NuGetPackageRoot)xunit.runner.utility\$(XunitVersion)\lib\uap10.0\*.pri"
PackagePath="build\uap10.0.16299"
Pack="true"
Visible="false" />
</ItemGroup>

</Project>

0 comments on commit 49ff47e

Please sign in to comment.