Skip to content

Commit 76f6b04

Browse files
committed
Use Common paths for Build, Publish and Pack
The new Output paths point to... Build: `~build\...` Restore: `~build\ext` Publish: `~publish\...` Pack: `~publish\{bin,obj}`
1 parent 376f529 commit 76f6b04

9 files changed

+32
-9
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111
# User-specific files (MonoDevelop/Xamarin Studio)
1212
*.userprefs
1313

14+
# Working folders
15+
~build/
16+
~publish/
17+
1418
# Build results
1519
[Dd]ebug/
1620
[Dd]ebugPublic/

Directory.Build.props

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
<When Condition="$(IsCoreProject)">
1414
<PropertyGroup>
1515
<GenerateDocumentationFile>true</GenerateDocumentationFile>
16-
<PackageOutputPath>$(RepositoryDirectory)bin\nupkg</PackageOutputPath>
1716
<GenerateLibraryLayout Condition="$(IsUwpProject)">true</GenerateLibraryLayout>
1817
<TreatWarningsAsErrors Condition="'$(Configuration)' == 'Release'">true</TreatWarningsAsErrors>
1918
</PropertyGroup>

SmokeTests/SmokeTest.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@
119119
<Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" />
120120
<Target Name="BeforeBuild">
121121
<ItemGroup Condition="$(CurrentProject) != 'UWPBaseline' and '$(CurrentProject)' != 'UWPBaselineWinUI'">
122-
<NuGetPackage Include="$(RepositoryDirectory)bin\nupkg\$(CurrentProject).*.nupkg" />
122+
<NuGetPackage Include="$(RepositoryDirectory)~packages\bin\$(CurrentProject).*.nupkg" />
123123
<NuGetPackageFiltered Condition="$([System.Text.RegularExpressions.Regex]::IsMatch('%(Identity)', `$(CurrentProject).([0-9]+)\.([0-9]+)\.([0-9]+)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+[0-9A-Za-z-]+)?.nupkg`))" Include="@(NuGetPackage)" />
124124
</ItemGroup>
125125
<Error Condition="'@(NuGetPackageFiltered)' == '' and $(CurrentProject) != 'UWPBaseline' and '$(CurrentProject)' != 'UWPBaselineWinUI'" Text="NuGet '$(CurrentProject).[SEMVER].nupkg' doesn't exist!" />

SmokeTests/SmokeTests.proj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282

8383
<Target Name="CheckNuGetPackages">
8484
<PropertyGroup>
85-
<NuGetOutputPath>$(MSBuildThisFileDirectory)..\bin\nupkg</NuGetOutputPath>
85+
<NuGetOutputPath>$(MSBuildThisFileDirectory)..\~packages\bin</NuGetOutputPath>
8686
</PropertyGroup>
8787
<ItemGroup>
8888
<NuGetPackage Include="$(NuGetOutputPath)\*.nupkg" />

SmokeTests/nuget.config

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<configuration>
22
<packageSources>
33
<clear />
4-
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
5-
<add key="Local" value="..\bin\nupkg" />
4+
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
5+
<add key="Local" value="..\~packages\bin" />
66
</packageSources>
77
</configuration>

azure-pipelines.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,13 +91,13 @@ jobs:
9191
env:
9292
SignClientUser: $(SignClientUser)
9393
SignClientSecret: $(SignClientSecret)
94-
ArtifactDirectory: bin\nupkg
94+
ArtifactDirectory: ~packages\bin
9595
condition: and(succeeded(), not(eq(variables['build.reason'], 'PullRequest')), not(eq(variables['SignClientSecret'], '')), not(eq(variables['SignClientUser'], '')))
9696

9797
- task: PublishPipelineArtifact@1
9898
displayName: Publish Package Artifacts
9999
inputs:
100-
targetPath: .\bin\nupkg
100+
targetPath: .\~packages\bin
101101
artifactName: Packages
102102

103103
### Smoke Tests ###
@@ -111,7 +111,7 @@ jobs:
111111
displayName: Download NuGet Packages Artifact
112112
inputs:
113113
artifact: Packages
114-
path: .\bin\nupkg
114+
path: .\~packages\bin
115115

116116
- task: DotNetCoreCLI@2
117117
inputs:

build/Windows.Toolkit.Common.props

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,19 @@
4444
<ContinuousIntegrationBuild>$(TF_BUILD)</ContinuousIntegrationBuild>
4545
</PropertyGroup>
4646

47+
<PropertyGroup>
48+
<!-- Common Outputs -->
49+
<BuildDir>~build\</BuildDir>
50+
<PublishDir>~publish\</PublishDir>
51+
<!-- Build Outputs -->
52+
<BaseOutputPath>$(BuildDir)bin\</BaseOutputPath>
53+
<BaseIntermediateOutputPath>$(BuildDir)obj\</BaseIntermediateOutputPath>
54+
<!-- Restore Outputs-->
55+
<MSBuildProjectExtensionsPath>$(BuildDir)ext\</MSBuildProjectExtensionsPath>
56+
<RestoreOutputPath>$(MSBuildProjectExtensionsPath)</RestoreOutputPath>
57+
<!-- Pack Outputs -->
58+
<PackageOutputPath>$(MSBuildProjectDirectory)$(PublishDir)bin\</PackageOutputPath>
59+
<NuSpecOutputPath>$(MSBuildProjectDirectory)$(PublishDir)obj\</NuSpecOutputPath>
60+
</PropertyGroup>
61+
4762
</Project>

build/Windows.Toolkit.Common.targets

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@
1212
<PackageTags Condition="'$(PackageTags)' == ''">$(CommonTags)</PackageTags>
1313
</PropertyGroup>
1414

15+
<PropertyGroup>
16+
<!-- Exclude files and folders from build and publish across all projects -->
17+
<DefaultItemExcludes>$(BuildDir)**;$(PublishDir)**;$(DefaultItemExcludes)</DefaultItemExcludes>
18+
</PropertyGroup>
19+
1520
<ItemGroup Condition="$(IsPackable)">
1621
<None Include="$(BuildToolsDirectory)nuget.png" Pack="true" PackagePath="\Icon.png" />
1722
<None Include="$(RepositoryDirectory)License.md" Pack="true" PackagePath="\" />

build/Windows.Toolkit.VisualStudio.Design.targets

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project>
22

33
<PropertyGroup>
4-
<ParentProjectOutputPath>..\$(ParentProjectName)\bin\$(Configuration)\$(ParentTargetFramework)\</ParentProjectOutputPath>
4+
<ParentProjectOutputPath>..\$(ParentProjectName)\~build\bin\$(Configuration)\$(ParentTargetFramework)\</ParentProjectOutputPath>
55
<OutputPath>$(ParentProjectOutputPath)Design\</OutputPath>
66
</PropertyGroup>
77

0 commit comments

Comments
 (0)