Skip to content

Commit

Permalink
Use Common paths for Build, Publish and Pack
Browse files Browse the repository at this point in the history
The new Output paths point to...

Build: `~build\...`
Restore: `~build\ext`
Publish: `~publish\...`
Pack: `~publish\{bin,obj}`
  • Loading branch information
Nirmal4G committed Aug 14, 2021
1 parent 25f525c commit 430b18b
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 9 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs

# Working folders
~build/
~publish/

# Build results
[Dd]ebug/
[Dd]ebugPublic/
Expand Down
1 change: 0 additions & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
<When Condition="$(IsCoreProject)">
<PropertyGroup>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<PackageOutputPath>$(RepositoryDirectory)bin\nupkg</PackageOutputPath>
<GenerateLibraryLayout Condition="$(IsUwpProject)">true</GenerateLibraryLayout>
<TreatWarningsAsErrors Condition="'$(Configuration)' == 'Release'">true</TreatWarningsAsErrors>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion SmokeTests/SmokeTest.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
<Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" />
<Target Name="BeforeBuild">
<ItemGroup Condition="$(CurrentProject) != 'UWPBaseline' and '$(CurrentProject)' != 'UWPBaselineWinUI'">
<NuGetPackage Include="$(RepositoryDirectory)bin\nupkg\$(CurrentProject).*.nupkg" />
<NuGetPackage Include="$(RepositoryDirectory)~packages\bin\$(CurrentProject).*.nupkg" />
<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)" />
</ItemGroup>
<Error Condition="'@(NuGetPackageFiltered)' == '' and $(CurrentProject) != 'UWPBaseline' and '$(CurrentProject)' != 'UWPBaselineWinUI'" Text="NuGet '$(CurrentProject).[SEMVER].nupkg' doesn't exist!" />
Expand Down
2 changes: 1 addition & 1 deletion SmokeTests/SmokeTests.proj
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@

<Target Name="CheckNuGetPackages">
<PropertyGroup>
<NuGetOutputPath>$(MSBuildThisFileDirectory)..\bin\nupkg</NuGetOutputPath>
<NuGetOutputPath>$(MSBuildThisFileDirectory)..\~packages\bin</NuGetOutputPath>
</PropertyGroup>
<ItemGroup>
<NuGetPackage Include="$(NuGetOutputPath)\*.nupkg" />
Expand Down
4 changes: 2 additions & 2 deletions SmokeTests/nuget.config
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<configuration>
<packageSources>
<clear />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
<add key="Local" value="..\bin\nupkg" />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
<add key="Local" value="..\~packages\bin" />
</packageSources>
</configuration>
6 changes: 3 additions & 3 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,13 @@ jobs:
env:
SignClientUser: $(SignClientUser)
SignClientSecret: $(SignClientSecret)
ArtifactDirectory: bin\nupkg
ArtifactDirectory: ~packages\bin
condition: and(succeeded(), not(eq(variables['build.reason'], 'PullRequest')), not(eq(variables['SignClientSecret'], '')), not(eq(variables['SignClientUser'], '')))

- task: PublishPipelineArtifact@1
displayName: Publish Package Artifacts
inputs:
targetPath: .\bin\nupkg
targetPath: .\~packages\bin
artifactName: Packages

### Smoke Tests ###
Expand All @@ -111,7 +111,7 @@ jobs:
displayName: Download NuGet Packages Artifact
inputs:
artifact: Packages
path: .\bin\nupkg
path: .\~packages\bin

- task: DotNetCoreCLI@2
inputs:
Expand Down
15 changes: 15 additions & 0 deletions build/Windows.Toolkit.Common.props
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,19 @@
<ContinuousIntegrationBuild>$(TF_BUILD)</ContinuousIntegrationBuild>
</PropertyGroup>

<PropertyGroup>
<!-- Common Outputs -->
<BuildDir>~build\</BuildDir>
<PublishDir>~publish\</PublishDir>
<!-- Build Outputs -->
<BaseOutputPath>$(BuildDir)bin\</BaseOutputPath>
<BaseIntermediateOutputPath>$(BuildDir)obj\</BaseIntermediateOutputPath>
<!-- Restore Outputs-->
<MSBuildProjectExtensionsPath>$(BuildDir)ext\</MSBuildProjectExtensionsPath>
<RestoreOutputPath>$(MSBuildProjectExtensionsPath)</RestoreOutputPath>
<!-- Pack Outputs -->
<NuSpecOutputPath>$(MSBuildProjectDirectory)$(PublishDir)obj\</NuSpecOutputPath>
<PackageOutputPath>$(MSBuildProjectDirectory)$(PublishDir)bin\</PackageOutputPath>
</PropertyGroup>

</Project>
2 changes: 1 addition & 1 deletion build/Windows.Toolkit.VisualStudio.Design.targets
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project>

<PropertyGroup>
<ParentProjectOutputPath>..\$(ParentProjectName)\bin\$(Configuration)\$(ParentTargetFramework)\</ParentProjectOutputPath>
<ParentProjectOutputPath>..\$(ParentProjectName)\~build\bin\$(Configuration)\$(ParentTargetFramework)\</ParentProjectOutputPath>
<OutputPath>$(ParentProjectOutputPath)Design\</OutputPath>
</PropertyGroup>

Expand Down

0 comments on commit 430b18b

Please sign in to comment.