-
Couldn't load subscription status.
- Fork 379
Add CMake File API support to Microsoft.DotNet.CMake.Sdk #16233
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Copilot
wants to merge
10
commits into
main
Choose a base branch
from
copilot/update-cmake-sdk-file-api
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
ce43af6
Initial plan
Copilot 9853820
Add CMake File API integration tasks and targets
Copilot c21baa8
Fix File API path handling and complete implementation
Copilot 6b4def4
Complete CMake File API integration
Copilot 7eaec0c
Remove accidentally committed nuget.exe
Copilot d5a1e0c
Address PR review feedback
Copilot ad3848c
Remove unreferenced CopyNativeProjectBinaries target
Copilot 82e7b52
Use BuildTask base class and LINQ for cleaner code
Copilot d7b41b6
Seal all types and add CMake File API documentation
Copilot f02c537
Remove redundant VSWhereVersion property
Copilot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
40 changes: 34 additions & 6 deletions
40
src/Microsoft.DotNet.CMake.Sdk/Microsoft.DotNet.CMake.Sdk.csproj
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,19 +1,47 @@ | ||
| <Project Sdk="Microsoft.Build.NoTargets"> | ||
| <Project Sdk="Microsoft.NET.Sdk"> | ||
|
|
||
| <PropertyGroup> | ||
| <TargetFramework>$(NetToolCurrent)</TargetFramework> | ||
| <TargetFrameworks>$(NetToolCurrent);$(NetFrameworkToolCurrent)</TargetFrameworks> | ||
| <IsPackable>true</IsPackable> | ||
| <IsBuildTaskProject>true</IsBuildTaskProject> | ||
| <Description>Common toolset for calling into CMake from MSBuild and easily reference native assets from managed projects.</Description> | ||
| <PackageType>MSBuildSdk</PackageType> | ||
| <NoWarn>$(NoWarn);NU5128</NoWarn> | ||
| <NoWarn>$(NoWarn);NU5128;CS0649</NoWarn> | ||
| <SuppressDependenciesWhenPacking>true</SuppressDependenciesWhenPacking> | ||
| <EnableDefaultItems>false</EnableDefaultItems> | ||
| </PropertyGroup> | ||
|
|
||
| <ItemGroup> | ||
| <None Include="**/*.props;**/*.targets" | ||
| <PackageReference Include="Microsoft.Build.Utilities.Core" /> | ||
| <PackageReference Include="Microsoft.Build.Framework" /> | ||
| </ItemGroup> | ||
|
|
||
| <ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework'"> | ||
| <PackageReference Include="System.Text.Json" /> | ||
| </ItemGroup> | ||
|
|
||
| <ItemGroup> | ||
| <Compile Include="src\**\*.cs" /> | ||
| </ItemGroup> | ||
|
|
||
| <ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework'"> | ||
| <Compile Include="..\Common\Internal\AssemblyResolver.cs" /> | ||
| <Compile Include="..\Common\Internal\AssemblyResolution.cs" /> | ||
| <Compile Include="..\Common\Internal\BuildTask.Desktop.cs" /> | ||
| <Reference Include="WindowsBase" /> | ||
| </ItemGroup> | ||
|
|
||
| <ItemGroup> | ||
| <Compile Include="..\Common\Internal\BuildTask.cs" /> | ||
| </ItemGroup> | ||
|
|
||
| <ItemGroup> | ||
| <None Include="build\**\*.props;build\**\*.targets" | ||
| Pack="true" | ||
| PackagePath="build\%(RecursiveDir)%(Filename)%(Extension)" /> | ||
| <None Include="sdk\**\*.props;sdk\**\*.targets" | ||
| Pack="true" | ||
| PackagePath="%(RecursiveDir)%(Filename)%(Extension)" /> | ||
| <None Include="$(RepoRoot)LICENSE.TXT;$(RepoRoot)THIRD-PARTY-NOTICES.TXT" Pack="true" PackagePath="%(Filename)%(Extension)" /> | ||
| PackagePath="sdk\%(RecursiveDir)%(Filename)%(Extension)" /> | ||
| </ItemGroup> | ||
|
|
||
| </Project> | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jkoritzinsky marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,84 @@ | ||
| // Licensed to the .NET Foundation under one or more agreements. | ||
| // The .NET Foundation licenses this file to you under the MIT license. | ||
|
|
||
| using System.Collections.Generic; | ||
| using System.Text.Json.Serialization; | ||
|
|
||
| namespace Microsoft.DotNet.CMake.Sdk | ||
| { | ||
| /// <summary> | ||
| /// C# object models for the CMake File API. | ||
| /// These types represent a subset of the CMake File API that we use for discovering build artifacts. | ||
| /// | ||
| /// For the full CMake File API specification, see: | ||
| /// https://cmake.org/cmake/help/latest/manual/cmake-file-api.7.html | ||
| /// | ||
| /// Specifically, we use: | ||
| /// - Index file: https://cmake.org/cmake/help/latest/manual/cmake-file-api.7.html#index-file | ||
| /// - Codemodel object (v2): https://cmake.org/cmake/help/latest/manual/cmake-file-api.7.html#codemodel-version-2 | ||
| /// </summary> | ||
|
|
||
| internal sealed class CMakeFileApiIndex | ||
| { | ||
| public CMakeFileApiIndexReply Reply { get; set; } | ||
| } | ||
|
|
||
| internal sealed class CMakeFileApiIndexReply | ||
| { | ||
| [JsonPropertyName("client-Microsoft.DotNet.CMake.Sdk")] | ||
| public CMakeFileApiClientReply ClientReply { get; set; } | ||
| } | ||
|
|
||
| internal sealed class CMakeFileApiClientReply | ||
| { | ||
| [JsonPropertyName("codemodel-v2")] | ||
| public CMakeFileApiIndexCodeModel CodemodelV2 { get; set; } | ||
| } | ||
|
|
||
| internal sealed class CMakeFileApiIndexCodeModel | ||
| { | ||
| public string JsonFile { get; set; } | ||
| } | ||
|
|
||
| internal sealed class CMakeCodeModel | ||
| { | ||
| public CMakeCodeModelPaths Paths { get; set; } | ||
| public List<CMakeConfiguration> Configurations { get; set; } | ||
| } | ||
|
|
||
| internal sealed class CMakeCodeModelPaths | ||
| { | ||
| public string Source { get; set; } | ||
| public string Build { get; set; } | ||
| } | ||
|
|
||
| internal sealed class CMakeConfiguration | ||
| { | ||
| public string Name { get; set; } | ||
| public List<CMakeDirectory> Directories { get; set; } | ||
| public List<CMakeTarget> Targets { get; set; } | ||
| } | ||
|
|
||
| internal sealed class CMakeDirectory | ||
| { | ||
| public string Source { get; set; } | ||
| public string Build { get; set; } | ||
| public List<int> TargetIndexes { get; set; } | ||
| } | ||
|
|
||
| internal sealed class CMakeTarget | ||
| { | ||
| public string Name { get; set; } | ||
| public string JsonFile { get; set; } | ||
| } | ||
|
|
||
| internal sealed class CMakeTargetDetails | ||
| { | ||
| public List<CMakeArtifact> Artifacts { get; set; } | ||
| } | ||
|
|
||
| internal sealed class CMakeArtifact | ||
| { | ||
| public string Path { get; set; } | ||
| } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.