Skip to content

Commit 2663416

Browse files
committed
Avoid multiple operations for various things
eg. No need to do build versioning during a test! Also fixes the versioning of the tool - now just stops the build, not the versioning of it.
1 parent b9854f2 commit 2663416

5 files changed

Lines changed: 9 additions & 5 deletions

File tree

.appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ environment:
88

99
build_script:
1010
- ps: dotnet build -c $env:BUILD_CONFIGURATION
11-
- ps: dotnet test --results-directory $env:BUILD_ARTIFACT_PATH/test-results
11+
- ps: dotnet test --results-directory $env:BUILD_ARTIFACT_PATH/test-results /p:SkipBuildVersioning=true
1212
- ps: dotnet pack --no-build -c $env:BUILD_CONFIGURATION /p:PackageOutputPath=$env:BUILD_ARTIFACT_PATH
1313

1414
test: false

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
- name: Build
3737
run: dotnet build -c Release --no-restore
3838
- name: Test with Coverage
39-
run: dotnet test --logger trx --results-directory ${{env.BUILD_ARTIFACT_PATH}}/coverage --collect "XPlat Code Coverage" --settings CodeCoverage.runsettings
39+
run: dotnet test --logger trx --results-directory ${{env.BUILD_ARTIFACT_PATH}}/coverage --collect "XPlat Code Coverage" --settings CodeCoverage.runsettings /p:SkipBuildVersioning=true
4040
- name: Pack
4141
run: dotnet pack -c Release --no-build /p:PackageOutputPath=${{env.BUILD_ARTIFACT_PATH}}
4242
- name: Publish artifacts

TurnerSoftware.BuildVersioning.sln

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "global", "global", "{790239
1818
.codecov.yml = .codecov.yml
1919
.editorconfig = .editorconfig
2020
.gitignore = .gitignore
21+
azure-pipelines.yml = azure-pipelines.yml
2122
CodeCoverage.runsettings = CodeCoverage.runsettings
2223
License.txt = License.txt
2324
README.md = README.md
@@ -28,7 +29,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{EC91FA7D
2829
tests\Directory.Build.props = tests\Directory.Build.props
2930
EndProjectSection
3031
EndProject
31-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TurnerSoftware.BuildVersioning.Tests", "tests\TurnerSoftware.BuildVersioning.Tests\TurnerSoftware.BuildVersioning.Tests.csproj", "{F97BCD71-3D0E-4B36-8BE5-B401A05E0829}"
32+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TurnerSoftware.BuildVersioning.Tests", "tests\TurnerSoftware.BuildVersioning.Tests\TurnerSoftware.BuildVersioning.Tests.csproj", "{F97BCD71-3D0E-4B36-8BE5-B401A05E0829}"
3233
EndProject
3334
Global
3435
GlobalSection(SolutionConfigurationPlatforms) = preSolution

azure-pipelines.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ jobs:
1313
steps:
1414
- script: dotnet build -c $(BUILD_CONFIGURATION)
1515
displayName: 'Build Application'
16+
17+
- script: dotnet test /p:SkipBuildVersioning=true
18+
displayName: 'Build Application'
1619

1720
- script: dotnet pack --no-build -c $(BUILD_CONFIGURATION) /p:PackageOutputPath=$(BUILD_ARTIFACT_PATH)
1821
displayName: 'Pack Build'

src/TurnerSoftware.BuildVersioning.Tool/TurnerSoftware.BuildVersioning.Tool.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
<PropertyGroup>
1111
<BuildVersioningToolPath>bin/$(Configuration)/$(TargetFramework)/TurnerSoftware.BuildVersioning.Tool.dll</BuildVersioningToolPath>
12-
<SelfHostedBuildVersioning Condition="$(DesignTimeBuild) != 'true' AND $(SkipBuildVersioning) != 'true' AND !Exists($(BuildVersioningToolPath))">true</SelfHostedBuildVersioning>
12+
<SelfHostedBuildVersioning Condition="$(DesignTimeBuild) != 'true' AND $(SkipBuildVersioning) != 'true'">true</SelfHostedBuildVersioning>
1313
<BuildVersioningToolPath>../../TurnerSoftware.BuildVersioning.Tool/$(BuildVersioningToolPath)</BuildVersioningToolPath>
1414
</PropertyGroup>
1515

@@ -19,7 +19,7 @@
1919

2020
<!-- Self-hosting Support -->
2121
<Import Project="../TurnerSoftware.BuildVersioning/build/TurnerSoftware.BuildVersioning.targets" Condition="$(SelfHostedBuildVersioning) == 'true'" />
22-
<Target Name="_SelfHostedBuildVersioning" BeforeTargets="BeforeBuild" Condition="$(SelfHostedBuildVersioning) == 'true'">
22+
<Target Name="_SelfHostedBuildVersioning" BeforeTargets="BeforeBuild" Condition="$(SelfHostedBuildVersioning) == 'true' AND !Exists($(BuildVersioningToolPath))">
2323
<Message Importance="high" Text="BuildVersioning-SelfHosting: Establishing a baseline build to provide versioning support" />
2424
<Exec Command="dotnet build TurnerSoftware.BuildVersioning.Tool.csproj -c $(Configuration) -v quiet --nologo /p:SkipBuildVersioning=true" StandardOutputImportance="low"></Exec>
2525
<Message Importance="high" Text="BuildVersioning-SelfHosting: Baseline build has been completed" />

0 commit comments

Comments
 (0)