diff --git a/Build.cmd b/Build.cmd
index ad5548493..22f0b2f9d 100644
--- a/Build.cmd
+++ b/Build.cmd
@@ -1,2 +1,2 @@
@echo off
-powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0eng\build.ps1""" -build -restore %*"
+powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0eng\build.ps1""" -build -restore -binaryLog %*"
diff --git a/FSharpBuild.Directory.Build.props b/FSharpBuild.Directory.Build.props
index acb67e379..ff7a1b670 100644
--- a/FSharpBuild.Directory.Build.props
+++ b/FSharpBuild.Directory.Build.props
@@ -54,20 +54,9 @@
true
-
-
- false
+
+
false
- https://github.com/Microsoft/visualfsharp
- git
-
-
-
- <_DotGitDir>$(RepoRoot).git
- <_HeadFileContent Condition="Exists('$(_DotGitDir)/HEAD')">$([System.IO.File]::ReadAllText('$(_DotGitDir)/HEAD').Trim())
- <_RefPath Condition="$(_HeadFileContent.StartsWith('ref: '))">$(_DotGitDir)/$(_HeadFileContent.Substring(5))
- $(BUILD_SOURCEVERSION)
- $([System.IO.File]::ReadAllText('$(_RefPath)').Trim())
diff --git a/azure-pipelines.yml b/azure-pipelines.yml
index fda3daa4e..6b5ef88ad 100644
--- a/azure-pipelines.yml
+++ b/azure-pipelines.yml
@@ -314,28 +314,6 @@ stages:
- script: .\tests\EndToEndBuildTests\EndToEndBuildTests -c Release
displayName: End to end build tests
- # Source Build Linux - disabled until MSBuild/NuGet issues are resolved
- # - ${{ if eq(variables['Build.Reason'], 'PullRequest') }}:
- # - job: SourceBuild_Linux
- # pool:
- # vmImage: ubuntu-latest
- # steps:
- # - checkout: self
- # clean: true
- # - script: ./eng/cibuild.sh --configuration Release /p:DotNetBuildFromSource=true /p:FSharpSourceBuild=true
- # displayName: Build
- # - script: dotnet build $(Build.SourcesDirectory)/eng/DumpPackageRoot/DumpPackageRoot.csproj
- # displayName: Dump NuGet cache contents
- # condition: failed()
- # - task: PublishBuildArtifacts@1
- # displayName: Publish NuGet cache contents
- # inputs:
- # PathtoPublish: '$(Build.SourcesDirectory)/artifacts/NugetPackageRootContents'
- # ArtifactName: 'NuGetPackageContents SourceBuild_Linux'
- # publishLocation: Container
- # continueOnError: true
- # condition: failed()
-
# Source Build Windows
- ${{ if eq(variables['Build.Reason'], 'PullRequest') }}:
- job: SourceBuild_Windows
@@ -344,19 +322,23 @@ stages:
steps:
- checkout: self
clean: true
- - script: eng\CIBuild.cmd -configuration Release -noSign /p:DotNetBuildFromSource=true /p:FSharpSourceBuild=true
+ - script: eng\CIBuild.cmd -configuration Release -noSign -prepareMachine -sourceBuild
displayName: Build
- - script: dotnet build $(Build.SourcesDirectory)/eng/DumpPackageRoot/DumpPackageRoot.csproj
- displayName: Dump NuGet cache contents
- condition: failed()
- - task: PublishBuildArtifacts@1
- displayName: Publish NuGet cache contents
+ - task: PublishPipelineArtifact@1
+ displayName: Publish Logs
inputs:
- PathtoPublish: '$(Build.SourcesDirectory)\artifacts\NugetPackageRootContents'
- ArtifactName: 'NuGetPackageContents SourceBuild_Windows'
+ targetPath: '$(Build.SourcesDirectory)/artifacts/log/Release'
+ artifactName: 'SourceBuild_Windows Logs'
+ continueOnError: true
+ condition: not(succeeded())
+ - task: PublishBuildArtifacts@1
+ displayName: Publish Logs
+ inputs:
+ PathtoPublish: '$(Build.SourcesDirectory)/artifacts/log/Release'
+ ArtifactName: 'SourceBuild_Windows_Test'
publishLocation: Container
continueOnError: true
- condition: failed()
+ condition: not(succeeded())
# Up-to-date - disabled due to it being flaky
#- job: UpToDate_Windows
@@ -371,6 +353,49 @@ stages:
# filePath: eng\tests\UpToDate.ps1
# arguments: -configuration $(_BuildConfig) -ci -binaryLog
+ # Source Build Semi-Official
+ # used until https://github.com/dotnet/source-build/issues/1795 is fixed
+ - ${{ if eq(variables['Build.Reason'], 'PullRequest') }}:
+ - job: SourceBuild_Official
+ pool:
+ name: NetCorePublic-Pool
+ queue: BuildPool.Ubuntu.1604.amd64.Open
+ timeoutInMinutes: 90
+ steps:
+ - checkout: self
+ clean: true
+ - script: ./eng/cibuild.sh --configuration Release --prepareMachine --docker --sourceBuild
+ displayName: Build
+ - task: PublishPipelineArtifact@1
+ displayName: Publish Logs
+ inputs:
+ targetPath: '$(Build.SourcesDirectory)/artifacts/log/Release'
+ artifactName: 'SourceBuild_Official Logs'
+ continueOnError: true
+ condition: not(succeeded())
+ - task: PublishBuildArtifacts@1
+ displayName: Publish Logs
+ inputs:
+ PathtoPublish: '$(Build.SourcesDirectory)/artifacts/log/Release'
+ ArtifactName: 'SourceBuild_Official_Test'
+ publishLocation: Container
+ continueOnError: true
+ condition: not(succeeded())
+
+ # Arcade-powered source build
+ # turned off until https://github.com/dotnet/source-build/issues/1795 is fixed
+ # - template: /eng/common/templates/jobs/jobs.yml
+ # parameters:
+ # enablePublishUsingPipelines: true
+ # enablePublishBuildArtifacts: true
+ # enablePublishBuildAssets: true
+ # artifacts:
+ # publish:
+ # artifacts: true
+ # manifests: true
+ # runSourceBuild: true
+ # sourceBuildParameters:
+ # includeDefaultManagedPlatform: true
#---------------------------------------------------------------------------------------------------------------------#
# Post Build #
diff --git a/build.sh b/build.sh
index 6c74895c0..dee2796f9 100755
--- a/build.sh
+++ b/build.sh
@@ -13,4 +13,4 @@ while [[ -h $source ]]; do
done
scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"
-"$scriptroot/eng/build.sh" --build --restore $@
+"$scriptroot/eng/build.sh" --build --restore --binaryLog $@
diff --git a/eng/Build.ps1 b/eng/Build.ps1
index cc66ea91e..62c759ab3 100644
--- a/eng/Build.ps1
+++ b/eng/Build.ps1
@@ -58,6 +58,7 @@ param (
[switch]$testpack,
[string]$officialSkipTests = "false",
[switch]$noVisualStudio,
+ [switch]$sourceBuild,
[parameter(ValueFromRemainingArguments=$true)][string[]]$properties)
@@ -108,6 +109,7 @@ function Print-Usage() {
Write-Host " -prepareMachine Prepare machine for CI run, clean up processes after build"
Write-Host " -useGlobalNuGetCache Use global NuGet cache."
Write-Host " -noVisualStudio Only build fsc and fsi as .NET Core applications. No Visual Studio required. '-configuration', '-verbosity', '-norestore', '-rebuild' are supported."
+ Write-Host " -sourceBuild Simulate building for source-build."
Write-Host ""
Write-Host "Command line arguments starting with '/p:' are passed through to MSBuild."
}
@@ -154,10 +156,11 @@ function Process-Arguments() {
$script:pack = $True;
}
+ if ($sourceBuild) {
+ $script:testpack = $False;
+ }
+
foreach ($property in $properties) {
- if ($property.StartsWith("/p:DotNetBuildFromSource=true", "InvariantCultureIgnoreCase")) {
- $script:testpack = $False;
- }
if (!$property.StartsWith("/p:", "InvariantCultureIgnoreCase")) {
Write-Host "Invalid argument: $property"
Print-Usage
@@ -220,6 +223,7 @@ function BuildSolution() {
/p:QuietRestore=$quietRestore `
/p:QuietRestoreBinaryLog=$binaryLog `
/p:TestTargetFrameworks=$testTargetFrameworks `
+ /p:DotNetBuildFromSource=$sourceBuild `
/v:$verbosity `
$suppressExtensionDeployment `
@properties
diff --git a/eng/build.sh b/eng/build.sh
index 32af25330..c83bc6905 100755
--- a/eng/build.sh
+++ b/eng/build.sh
@@ -30,6 +30,7 @@ usage()
echo " --docker Run in a docker container if applicable"
echo " --skipAnalyzers Do not run analyzers during build operations"
echo " --prepareMachine Prepare machine for CI run, clean up processes after build"
+ echo " --sourceBuild Simulate building for source-build"
echo ""
echo "Command line arguments starting with '/p:' are passed through to MSBuild."
}
@@ -130,14 +131,12 @@ while [[ $# > 0 ]]; do
;;
--docker)
docker=true
- shift
- continue
+ ;;
+ --sourcebuild)
+ source_build=true
;;
/p:*)
properties="$properties $1"
- if [[ "$1" == "/p:dotnetbuildfromsource=true" ]]; then
- source_build=true
- fi
;;
*)
echo "Invalid argument: $1"
@@ -279,6 +278,7 @@ function BuildSolution {
/p:ContinuousIntegrationBuild=$ci \
/p:QuietRestore=$quiet_restore \
/p:QuietRestoreBinaryLog="$binary_log" \
+ /p:DotNetBuildFromSource=$source_build \
$properties
}
diff --git a/setup/Swix/Directory.Build.targets b/setup/Swix/Directory.Build.targets
index 7e50ced3f..5e826e8da 100644
--- a/setup/Swix/Directory.Build.targets
+++ b/setup/Swix/Directory.Build.targets
@@ -15,7 +15,7 @@
+ Condition="'$(DotNetBuildFromSource)' != 'true' AND '$(ArcadeBuildFromSource)' != 'true'">