Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/memory/API_MAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Repo-wide entry points and the formal public-API tracking rules. Layer-specific
| Command | Purpose |
|---------|---------|
| `build.sh` / `Build.cmd` | Full solution build (Arcade). |
| `dotnet restore <project-or-solution>` | Restores dependencies and, on the first restore in a clone, validates checkout line endings and Windows long-path support. A successful validation is cached at `artifacts/developer-settings-validated.txt`. |
| `dotnet build Compilers.slnf` | Compiler-only build. |
| `dotnet build Ide.slnf` | IDE-only build. |
| `dotnet build Razor.slnf` | Razor compiler & tooling-only build. |
Expand Down
2 changes: 1 addition & 1 deletion .github/memory/FILE_MAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ This file is a **top-level map only**. For per-area directory detail, read the m

| Path | Status | Purpose |
|------|--------|---------|
| `eng/` | Config / Generated | Arcade build engineering. Pipeline definitions and templates live in `eng/pipelines/`; `eng/common/` is DARC-synced and must not be hand-edited. `eng/generate-compiler-code.cs` regenerates compiler code. |
| `eng/` | Config / Generated | Arcade build engineering. Shared project and solution build targets live in `eng/targets/`; pipeline definitions and templates live in `eng/pipelines/`; `eng/common/` is DARC-synced and must not be hand-edited. `eng/generate-compiler-code.cs` regenerates compiler code. |
| `docs/` | Active | Contributor & design docs. New docs use kebab-case filenames in the right subdirectory. |
| Root | Config | Entry points & solution filters: `build.sh`/`Build.cmd`, `test.sh`/`Test.cmd`, `Roslyn.slnx`, `Compilers.slnf`, `Ide.slnf`, `Razor.slnf`, `global.json`, `Directory.*.props/targets`, `Directory.Packages.props`. |
3 changes: 3 additions & 0 deletions Directory.Solution.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<Project>
<Import Project="eng\targets\DeveloperSettings.targets" />
Comment thread
mwiemer-microsoft marked this conversation as resolved.
</Project>
32 changes: 32 additions & 0 deletions eng/targets/DeveloperSettings.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<!-- Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. See the LICENSE file in the project root for more information. -->

<!--
Validate developer machine settings are correct:
- For Windows, long paths are enabled
- For all platforms, file line endings match platform line endings
-->
<Project>
<PropertyGroup>
<_RoslynDeveloperSettingsValidationCacheFile>$(MSBuildThisFileDirectory)..\..\artifacts\developer-settings-validated.txt</_RoslynDeveloperSettingsValidationCacheFile>
</PropertyGroup>

<Target Name="_ValidateDeveloperSettings" BeforeTargets="Restore" Condition="!Exists('$(_RoslynDeveloperSettingsValidationCacheFile)')">
<PropertyGroup>
<_RoslynBuildRunsOnWindows>$([MSBuild]::IsOSPlatform('Windows'))</_RoslynBuildRunsOnWindows>
<_RoslynSourceHasCarriageReturns>$([System.IO.File]::ReadAllText('$(MSBuildThisFileFullPath)').Contains($([System.Char]::ConvertFromUtf32(13))))</_RoslynSourceHasCarriageReturns>
<_RoslynLongPathsEnabled Condition="'$(_RoslynBuildRunsOnWindows)' == 'True'">$([MSBuild]::GetRegistryValueFromView('HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\FileSystem', 'LongPathsEnabled', null, RegistryView.Registry64, RegistryView.Registry32))</_RoslynLongPathsEnabled>
</PropertyGroup>

<Message Importance="Low"
Text="Validating developer settings: IsWindows=$(_RoslynBuildRunsOnWindows), SourceHasCarriageReturns=$(_RoslynSourceHasCarriageReturns), LongPathsEnabled=$(_RoslynLongPathsEnabled)" />
<Error Condition="'$(_RoslynSourceHasCarriageReturns)' != '$(_RoslynBuildRunsOnWindows)'"
Text="Source file line endings do not match the current platform. Re-clone the repository with the correct Git line-ending settings." />
<Error Condition="'$(_RoslynBuildRunsOnWindows)' == 'True' and '$(_RoslynLongPathsEnabled)' != '1'"
Text="Long paths are required for this project. Please run eng\enable-long-paths.reg" />

<MakeDir Directories="$(MSBuildThisFileDirectory)..\..\artifacts" />
<WriteLinesToFile File="$(_RoslynDeveloperSettingsValidationCacheFile)"
Lines="[$([System.DateTime]::UtcNow.ToString('O'))] Developer settings validated"
Overwrite="true" />
</Target>
</Project>
11 changes: 2 additions & 9 deletions eng/targets/Imports.targets
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<Project>
<Import Project="VisualStudio.targets" Condition="'$(UsingToolVSSDK)' == 'true'"/>
<Import Project="XUnit.targets" Condition="'$(IsTestProject)' == 'true'" />
<Import Project="DeveloperSettings.targets" />

<!--
Work around .editorconfig evaluation bugs in command line builds.
Expand Down Expand Up @@ -183,15 +184,7 @@

<SingleError Text="The msbuild version $(MSBuildVersion) is below the minimum required version $(MinimumMSBuildVersion)"
Condition="$(_VersionComparisonResult) &lt; 0"/>
</Target>

<Target Name="_CheckLongPathSupport" BeforeTargets="BeforeBuild" Condition="'$(MSBuildRuntimeType)' == 'Full'">
<PropertyGroup>
<_RoslynLongPathsEnabled>$([MSBuild]::GetRegistryValueFromView('HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\FileSystem', 'LongPathsEnabled', null, RegistryView.Registry64, RegistryView.Registry32))</_RoslynLongPathsEnabled>
</PropertyGroup>

<Warning Condition="'$(_RoslynLongPathsEnabled)' != '1'" Text="Long paths are required for this project. Please run eng\enable-long-paths.reg" />
</Target>
</Target>

<!--
This target is used to copy referenced projects to a sub-directory vs. the direct output
Expand Down