Skip to content

Commit f7fbd2e

Browse files
authored
Fixed build and pack based to respect updated .NET Core tooling behavior (#64)
* Fixed build and pack based to respect updated .NET Core tooling behavior. * Removed unnecessary parameter from dotnet build.
1 parent 2a71ab5 commit f7fbd2e

File tree

4 files changed

+18
-7
lines changed

4 files changed

+18
-7
lines changed

build.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ if ($RestoreOnly)
3535
else
3636
{
3737
# Build
38-
dotnet build -o "$BuildRelativePath" -c $BuildConfig "$Solution" | Tee-Object -FilePath "$LogDirectory\build.log"
38+
dotnet build -c $BuildConfig "$Solution" /p:OutDir=$BuildRelativePath | Tee-Object -FilePath "$LogDirectory\build.log"
3939
}
4040

4141
exit $LASTEXITCODE

pack.ps1

+15-4
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,26 @@ $ErrorActionPreference = "Stop"
1515
$PrebuiltBinariesDir = "bin\BuildOutput"
1616
$PublishRelativePath = "bin\PackageOutput"
1717
$LogDirectory = "$PSScriptRoot\buildlogs"
18-
$Solution = "$PSScriptRoot\Microsoft.FeatureManagement.sln"
18+
19+
$targetProjects = @(
20+
21+
"Microsoft.FeatureManagement",
22+
"Microsoft.FeatureManagement.AspNetCore"
23+
)
1924

2025
# Create the log directory.
2126
if ((Test-Path -Path $LogDirectory) -ne $true) {
2227
New-Item -ItemType Directory -Path $LogDirectory | Write-Verbose
2328
}
2429

25-
#
26-
# The build system expects pre-built binaries to be in the folder pointed to by 'OutDir'.
27-
dotnet pack -o "$PublishRelativePath" /p:OutDir=$PrebuiltBinariesDir "$Solution" --no-build | Tee-Object -FilePath "$LogDirectory\build.log"
30+
foreach ($project in $targetProjects)
31+
{
32+
$projectPath = "$PSScriptRoot\src\$project\$project.csproj"
33+
$outputPath = "$PSScriptRoot\src\$project\$PublishRelativePath"
34+
35+
#
36+
# The build system expects pre-built binaries to be in the folder pointed to by 'OutDir'.
37+
dotnet pack -o "$outputPath" /p:OutDir=$PrebuiltBinariesDir "$projectPath" --no-build | Tee-Object -FilePath "$LogDirectory\build.log"
38+
}
2839

2940
exit $LASTEXITCODE

src/Microsoft.FeatureManagement.AspNetCore/Microsoft.FeatureManagement.AspNetCore.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
</PropertyGroup>
3232

3333
<Target Name="PrepublishScript" BeforeTargets="PrepareForPublish">
34-
<Copy SourceFiles="$(DocumentationFile)" DestinationFolder="$(PublishDir)\XMLComments" SkipUnchangedFiles="false" />
34+
<Copy SourceFiles="$(DocumentationFile)" DestinationFolder="$(OutDir)\XMLComments" SkipUnchangedFiles="false" />
3535
</Target>
3636

3737
</Project>

src/Microsoft.FeatureManagement/Microsoft.FeatureManagement.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
</PropertyGroup>
3131

3232
<Target Name="PrepublishScript" BeforeTargets="PrepareForPublish">
33-
<Copy SourceFiles="$(DocumentationFile)" DestinationFolder="$(PublishDir)\XMLComments" SkipUnchangedFiles="false" />
33+
<Copy SourceFiles="$(DocumentationFile)" DestinationFolder="$(OutDir)\XMLComments" SkipUnchangedFiles="false" />
3434
</Target>
3535

3636
</Project>

0 commit comments

Comments
 (0)