Skip to content

Commit 0b3b508

Browse files
authored
fix 13174 - make fsharp build sourcebuild friendly again (#13239)
* fix 13174 * missed one * path seperators * oops * Oh yeah projects moved * packonly * remove debug from package build * cleanup
1 parent ebd32a7 commit 0b3b508

File tree

7 files changed

+45
-7
lines changed

7 files changed

+45
-7
lines changed

eng/Build.ps1

+3-1
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ param (
6161
[string]$officialSkipTests = "false",
6262
[switch]$noVisualStudio,
6363
[switch]$sourceBuild,
64+
[switch]$skipBuild,
6465

6566
[parameter(ValueFromRemainingArguments = $true)][string[]]$properties)
6667

@@ -114,6 +115,7 @@ function Print-Usage() {
114115
Write-Host " -useGlobalNuGetCache Use global NuGet cache."
115116
Write-Host " -noVisualStudio Only build fsc and fsi as .NET Core applications. No Visual Studio required. '-configuration', '-verbosity', '-norestore', '-rebuild' are supported."
116117
Write-Host " -sourceBuild Simulate building for source-build."
118+
Write-Host " -skipbuild Skip building product"
117119
Write-Host ""
118120
Write-Host "Command line arguments starting with '/p:' are passed through to MSBuild."
119121
}
@@ -458,7 +460,7 @@ try {
458460
}
459461

460462
$script:BuildMessage = "Failure building product"
461-
if ($restore -or $build -or $rebuild -or $pack -or $sign -or $publish) {
463+
if ($restore -or $build -or $rebuild -or $pack -or $sign -or $publish -and -not $skipBuild) {
462464
if ($noVisualStudio) {
463465
BuildSolution "FSharp.sln"
464466
}

src/Compiler/FSharp.Compiler.Service.fsproj

-1
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,6 @@
483483
<ProjectReference Include="$(MSBuildThisFileDirectory)..\FSharp.DependencyManager.Nuget\FSharp.DependencyManager.Nuget.fsproj" />
484484
</ItemGroup>
485485

486-
487486
<ItemGroup Condition="'$(FSHARPCORE_USE_PACKAGE)' != 'true'">
488487
<ProjectReference Include="$(MSBuildThisFileDirectory)..\FSharp.Core\FSharp.Core.fsproj" />
489488
</ItemGroup>

src/Directory.Build.props

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
<DisableImplicitFSharpCoreReference>true</DisableImplicitFSharpCoreReference>
1616
<UseStandardResourceNames>false</UseStandardResourceNames>
1717
<PackageOutputPath>$(ArtifactsPackagesDir)\$(Configuration)</PackageOutputPath>
18+
<ShouldUnsetParentConfigurationAndPlatform>false</ShouldUnsetParentConfigurationAndPlatform>
1819
</PropertyGroup>
1920

2021
</Project>

src/FSharp.Build/FSharp.Build.fsproj

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44

55
<PropertyGroup>
66
<OutputType>Library</OutputType>
7-
<TargetFramework Condition="'$(Configuration)' != 'Proto'">netstandard2.0</TargetFramework>
8-
<TargetFrameworks Condition="'$(Configuration)' == 'Proto'">netstandard2.0</TargetFrameworks>
7+
<TargetFrameworks>netstandard2.0</TargetFrameworks>
98
<AssemblyName>FSharp.Build</AssemblyName>
109
<NoWarn>$(NoWarn);75</NoWarn> <!-- InternalCommandLineOption -->
1110
<AllowCrossTargeting>true</AllowCrossTargeting>

src/Microsoft.FSharp.Compiler/Microsoft.FSharp.Compiler.csproj

+38-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,13 @@
1111
<NoDefaultExcludes>true</NoDefaultExcludes>
1212
</PropertyGroup>
1313

14+
<PropertyGroup>
15+
<ArcadeSdkDir Condition="'$(ArcadeSdkDir)' == ''">$(NuGetPackageRoot)microsoft.dotnet.arcade.sdk\$(ArcadeSdkVersion)\</ArcadeSdkDir>
16+
<_BuildReleasePackagesTargets>$(ArcadeSdkDir)tools\BuildReleasePackages.targets</_BuildReleasePackagesTargets>
17+
</PropertyGroup>
18+
19+
<Import Project="$(_BuildReleasePackagesTargets)" />
20+
1421
<ItemGroup>
1522
<NuspecProperty Include="fSharpCorePreviewPackageVersion=$(FSCorePackageVersionValue)-$(VersionSuffix)" />
1623
<NuspecProperty Include="fSharpCorePackageVersion=$(FSCorePackageVersionValue)" />
@@ -19,6 +26,36 @@
1926
<NuspecProperty Include="artifactsPackagesDir=$(ArtifactsPackagesDir)" />
2027
</ItemGroup>
2128

22-
<Target Name="Build" />
29+
<ItemGroup>
30+
<ProjectReference Include="$(MSBuildThisFileDirectory)..\fsi\fsiProject\fsi.fsproj" />
31+
<ProjectReference Include="$(MSBuildThisFileDirectory)..\fsc\fscProject\fsc.fsproj" />
32+
</ItemGroup>
33+
34+
<ItemGroup>
35+
<DependentProjects Include="$(MSBuildThisFileDirectory)..\FSharp.Core\FSharp.Core.fsproj">
36+
<AdditionalProperties>TargetFrameworks=netstandard2.1;netstandard2.0</AdditionalProperties>
37+
</DependentProjects>
38+
<DependentProjects Include="$(MSBuildThisFileDirectory)..\FSharp.Build\FSharp.Build.fsproj">
39+
<AdditionalProperties>TargetFrameworks=netstandard2.0</AdditionalProperties>
40+
</DependentProjects>
41+
<DependentProjects Include="$(MSBuildThisFileDirectory)..\FSharp.Compiler.Interactive.Settings\FSharp.Compiler.Interactive.Settings.fsproj">
42+
<AdditionalProperties>TargetFrameworks=netstandard2.0</AdditionalProperties>
43+
</DependentProjects>
44+
<DependentProjects Include="$(MSBuildThisFileDirectory)..\FSharp.DependencyManager.Nuget\FSharp.DependencyManager.Nuget.fsproj">
45+
<AdditionalProperties>TargetFrameworks=netstandard2.0</AdditionalProperties>
46+
</DependentProjects>
47+
<DependentProjects Include="$(MSBuildThisFileDirectory)..\Compiler\FSharp.Compiler.Service.fsproj">
48+
<AdditionalProperties>TargetFrameworks=netstandard2.0</AdditionalProperties>
49+
</DependentProjects>
50+
</ItemGroup>
51+
52+
<Target Name="PackDependentProjectsCore">
53+
<MSBuild Projects="@(DependentProjects)" Targets="Pack" Properties="Restore=true;Pack=true;BUILD_PUBLICSIGN=$(BUILD_PUBLICSIGN)" />
54+
</Target>
55+
56+
<Target Name="PackDependentProjects"
57+
BeforeTargets="Build"
58+
DependsOnTargets="PackDependentProjectsCore;PackageReleasePackages">
59+
</Target>
2360

2461
</Project>
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
// See https://aka.ms/new-console-template for more information
1+
// See https://aka.ms/new-console-template for more information
22
return 0;

vsintegration/Vsix/VisualFSharpFull/VisualFSharp.Core.targets

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
<NgenArchitecture>All</NgenArchitecture>
3434
<NgenPriority>2</NgenPriority>
3535
<Private>True</Private>
36-
<AdditionalProperties>TargetFramework=$(DependencyTargetFramework)</AdditionalProperties>
36+
<AdditionalProperties>TargetFramework=netstandard2.0</AdditionalProperties>
3737
</ProjectReference>
3838

3939
<ProjectReference Include="$(FSharpSourcesRoot)\FSharp.Compiler.Interactive.Settings\FSharp.Compiler.Interactive.Settings.fsproj">

0 commit comments

Comments
 (0)