Skip to content

Commit

Permalink
Set plain dotnet build in devcontainer (#14991)
Browse files Browse the repository at this point in the history
* Set plain dotnet build in devcontainer

* Set output explicitly

* Update launch and tasks specs
  • Loading branch information
vzarytovskii authored Mar 29, 2023
1 parent 56123ad commit 9fae71f
Show file tree
Hide file tree
Showing 9 changed files with 44 additions and 37 deletions.
3 changes: 3 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,6 @@ RUN apt-get update \

# Switch back to dialog for any ad-hoc use of apt-get
ENV DEBIAN_FRONTEND=dialog

# Make sure we can build using plain dotnet
ENV BUILDING_USING_DOTNET=true
3 changes: 3 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"stopAtEntry": false,
"justMyCode": true,
"enableStepFiltering": true,
"requireExactSource": false,
"symbolOptions": {
"searchMicrosoftSymbolServer": true,
"searchNuGetOrgSymbolServer": true
Expand Down Expand Up @@ -62,6 +63,7 @@
"stopAtEntry": false,
"justMyCode": true,
"enableStepFiltering": true,
"requireExactSource": false,
"symbolOptions": {
"searchMicrosoftSymbolServer": true,
"searchNuGetOrgSymbolServer": true
Expand All @@ -84,6 +86,7 @@
},
"justMyCode": true,
"enableStepFiltering": false,
"requireExactSource": false
}
]
}
53 changes: 16 additions & 37 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,52 +15,45 @@
},
"tasks": [
{
"label": "Full Build (Debug)",
"command": "./build.sh",
"label": "Build (Debug)",
"command": "dotnet",
"type": "shell",
"args": [
"-c Debug"
"build",
"-c Debug",
"FSharp.Compiler.Service.sln"
],
"windows": {
"command": "${workspaceFolder}/Build.cmd",
"command": "dotnet",
"args": [
"build",
"-c Debug",
"-noVisualStudio"
"FSharp.Compiler.Service.sln"
],
},
"problemMatcher": "$msCompile",
"group": "build",
},
{
"label": "Full Build (Release)",
"command": "./build.sh",
"label": "Build (Release)",
"command": "dotnet",
"type": "shell",
"args": [
"-c Release"
"build",
"-c Release",
"FSharp.Compiler.Service.sln"
],
"windows": {
"command": "${workspaceFolder}/Build.cmd",
"command": "dotnet",
"args": [
"build",
"-c Release",
"-noVisualStudio"
"FSharp.Compiler.Service.sln"
],
},
"problemMatcher": "$msCompile",
"group": "build",
},
{
"label": "Rebuild (Debug)",
"command": "dotnet",
"type": "shell",
"args": [
"build",
"-c",
"Debug",
"${workspaceFolder}/FSharp.sln"
],
"problemMatcher": "$msCompile",
"group": "build",
},
{
"label": "Update xlf files",
"command": "./build.sh",
Expand All @@ -75,20 +68,6 @@
},
"problemMatcher": "$msCompile",
"group": "build"
},
{
"label": "Run tests (all but integration)",
"command": "./build.sh",
"type": "shell",
"args": [
"-testAllButIntegration"
],
"windows": {
"command": "${workspaceFolder}/Build.cmd",
},
"problemMatcher": "$msCompile",
"group": "test"
}
// TODO: Add more test tasks if necessary.
]
}
1 change: 1 addition & 0 deletions eng/Build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ function BuildSolution([string] $solutionName) {
/p:TestTargetFrameworks=$testTargetFrameworks `
/p:DotNetBuildFromSource=$sourceBuild `
/p:CompressAllMetadata=$CompressAllMetadata `
/p:BUILDING_USING_DOTNET=false `
/v:$verbosity `
$suppressExtensionDeployment `
@properties
Expand Down
1 change: 1 addition & 0 deletions eng/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,7 @@ function BuildSolution {
/p:QuietRestore=$quiet_restore \
/p:QuietRestoreBinaryLog="$binary_log" \
/p:ArcadeBuildFromSource=$source_build \
/p:BUILDING_USING_DOTNET=false \
$properties
fi
}
Expand Down
5 changes: 5 additions & 0 deletions src/Compiler/FSharp.Compiler.Service.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,11 @@
</None>
</ItemGroup>

<PropertyGroup Condition="'$(BUILDING_USING_DOTNET)' == 'true'">
<OutputPath>$(ArtifactsDir)/bin/$(MSBuildProjectName)/$(Configuration)/</OutputPath>
<IntermediateOutputPath>$(ArtifactsDir)obj/$(MSBuildProjectName)/$(Configuration)/</IntermediateOutputPath>
</PropertyGroup>

<ItemGroup Condition="'$(BUILDING_USING_DOTNET)' == 'true'">
<!-- We are setting TFM explicitly here, since we are only using fslexyacc's dlls in msbuild -->
<ProjectReference Include="$(RepoRoot)\buildtools\fslex\fslex.fsproj" ReferenceOutputAssembly="False">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@
<CompressMetadata Condition="'$(CompressAllMetadata)' != 'true'">false</CompressMetadata>
</PropertyGroup>

<PropertyGroup Condition="'$(BUILDING_USING_DOTNET)' == 'true'">
<OutputPath>$(ArtifactsDir)/bin/$(MSBuildProjectName)/$(Configuration)/</OutputPath>
<IntermediateOutputPath>$(ArtifactsDir)obj/$(MSBuildProjectName)/$(Configuration)/</IntermediateOutputPath>
</PropertyGroup>

<Target Name="CopyToBuiltBin" BeforeTargets="BuiltProjectOutputGroup" AfterTargets="CoreCompile">
<PropertyGroup>
<BuildOutputGroupLocation>$(BaseOutputPath)\$(Configuration)\$(TargetFramework)</BuildOutputGroupLocation>
Expand Down
5 changes: 5 additions & 0 deletions src/fsc/fscProject/fsc.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@
<PlatformTarget Condition="'$(TargetFramework)' == 'net472'">x86</PlatformTarget>
</PropertyGroup>

<PropertyGroup Condition="'$(BUILDING_USING_DOTNET)' == 'true'">
<OutputPath>$(ArtifactsDir)/bin/$(MSBuildProjectName)/$(Configuration)/</OutputPath>
<IntermediateOutputPath>$(ArtifactsDir)obj/$(MSBuildProjectName)/$(Configuration)/</IntermediateOutputPath>
</PropertyGroup>

<Import Project="$([MSBuild]::GetPathOfFileAbove('fsc.targets', '$(MSBuildThisFileDirectory)../'))" />

</Project>
5 changes: 5 additions & 0 deletions src/fsi/fsiProject/fsi.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@
<PlatformTarget Condition="'$(TargetFramework)' == 'net472'">x86</PlatformTarget>
</PropertyGroup>

<PropertyGroup Condition="'$(BUILDING_USING_DOTNET)' == 'true'">
<OutputPath>$(ArtifactsDir)/bin/$(MSBuildProjectName)/$(Configuration)/</OutputPath>
<IntermediateOutputPath>$(ArtifactsDir)obj/$(MSBuildProjectName)/$(Configuration)/</IntermediateOutputPath>
</PropertyGroup>

<Import Project="$([MSBuild]::GetPathOfFileAbove('fsi.targets', '$(MSBuildThisFileDirectory)../'))" />

</Project>

0 comments on commit 9fae71f

Please sign in to comment.