Skip to content

Commit

Permalink
Using new common build system
Browse files Browse the repository at this point in the history
  • Loading branch information
bradwilson committed Jun 4, 2023
1 parent b77e4b3 commit a2a675e
Show file tree
Hide file tree
Showing 29 changed files with 58 additions and 660 deletions.
1 change: 1 addition & 0 deletions .github/workflows/pull-request.yaml
Expand Up @@ -14,6 +14,7 @@ jobs:
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: true

- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v1
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/push-main.yaml
Expand Up @@ -17,6 +17,7 @@ jobs:
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: true

- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v1
Expand Down
2 changes: 0 additions & 2 deletions .gitignore
@@ -1,5 +1,3 @@
.AssemblyAttributes

##### Copied from https://github.com/github/gitignore/blob/7792e50daeaa6c07460484704671d1dc9f0045a7/VisualStudio.gitignore

## Ignore Visual Studio temporary files, build results, and
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
@@ -0,0 +1,3 @@
[submodule "tools/builder/common"]
path = tools/builder/common
url = https://github.com/xunit/build-tools-v3
110 changes: 0 additions & 110 deletions azure-pipelines.yml

This file was deleted.

22 changes: 17 additions & 5 deletions build.ps1
Expand Up @@ -4,24 +4,36 @@
Set-StrictMode -Version Latest
$ErrorActionPreference = "Stop"

if ($null -eq (Get-Command "git" -ErrorAction Ignore)) {
throw "Could not find 'git'; please install the Git command line tooling"
}

& git submodule status | ForEach-Object {
if ($_[0] -eq '-') {
$pieces = $_.Split(' ')
& git submodule update --init "$($pieces[1])"
Write-Host ""
}
}

if ($null -eq (Get-Command "dotnet" -ErrorAction Ignore)) {
throw "Could not find 'dotnet'; please install the .NET Core SDK"
throw "Could not find 'dotnet'; please install the .NET Core SDK"
}

$version = [Version]$([regex]::matches((&dotnet --version), '^(\d+\.)?(\d+\.)?(\*|\d+)').value)
if ($version.Major -lt 7) {
throw ".NET SDK version ($version) is too low; please install version 7.0 or later"
throw ".NET SDK version ($version) is too low; please install version 7.0 or later"
}

if ($null -eq (Get-Command "msbuild.exe" -ErrorAction Ignore)) {
throw "Could not find 'msbuild.exe'; please run this from a Visual Studio developer shell"
throw "Could not find 'msbuild.exe'; please run this from a Visual Studio developer shell"
}

Push-Location (Split-Path $MyInvocation.MyCommand.Definition)

try {
& dotnet run --project tools/builder --no-launch-profile -- $args
& dotnet run --project tools/builder --no-launch-profile -- $args
}
finally {
Pop-Location
Pop-Location
}
6 changes: 1 addition & 5 deletions global.json
@@ -1,5 +1 @@
{
"msbuild-sdks": {
"MSBuild.Sdk.Extras": "3.0.44"
}
}
{ }
@@ -1,4 +1,4 @@
<Project Sdk="MSBuild.Sdk.Extras">
<Project Sdk="Microsoft.Net.SDK">

<PropertyGroup>
<Title>xUnit.net [Runner: Visual Studio]</Title>
Expand Down Expand Up @@ -61,7 +61,7 @@
<!-- Support deterministic builds (via https://github.com/clairernovotny/DeterministicBuilds) -->
<PropertyGroup>
<ContinuousIntegrationBuild Condition=" '$(GITHUB_ACTIONS)' == 'true' ">true</ContinuousIntegrationBuild>
<TargetFrameworkMonikerAssemblyAttributesPath>$([System.IO.Path]::Combine('$(IntermediateOutputPath)','$(TargetFrameworkMoniker).AssemblyAttributes$(DefaultLanguageSourceExtension)'))</TargetFrameworkMonikerAssemblyAttributesPath>
<TargetFrameworkMonikerAssemblyAttributesPath Condition="'$(TargetFrameworkMoniker)' != ''">$([System.IO.Path]::Combine('$(IntermediateOutputPath)','$(TargetFrameworkMoniker).AssemblyAttributes$(DefaultLanguageSourceExtension)'))</TargetFrameworkMonikerAssemblyAttributesPath>
</PropertyGroup>
<ItemGroup>
<EmbeddedFiles Include="$(GeneratedAssemblyInfoFile)" />
Expand Down
3 changes: 3 additions & 0 deletions tools/builder/Program.cs
@@ -1,5 +1,8 @@
using System.Threading.Tasks;
using McMaster.Extensions.CommandLineUtils;
using Xunit.BuildTools.Models;

namespace Xunit.BuildTools;

public class Program
{
Expand Down
1 change: 1 addition & 0 deletions tools/builder/common
Submodule common added at 754f66

0 comments on commit a2a675e

Please sign in to comment.