Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
171 commits
Select commit Hold shift + click to select a range
73ccd7a
Add interpolated-string handler to IndentedTextWriter
Sergio0694 May 12, 2026
1a2cb46
Refactor IndentedTextWriter overloads and logic
Sergio0694 May 12, 2026
a0e39fa
Correct _writer.Write argument order
Sergio0694 May 15, 2026
013f125
Move isMultiline: true argument before string content at all callsites
Sergio0694 May 15, 2026
958578e
Reshape WriteLineIf overloads to match the canonical Write[Line]/Writ…
Sergio0694 May 15, 2026
8f2f36e
Add conditional AppendInterpolatedStringHandler ctors
Sergio0694 May 15, 2026
bcdcfed
Add XML docs to new WriteIf/WriteLineIf interpolated handler overloads
Sergio0694 May 15, 2026
a4a3e9d
Convert simple if-then-write blocks to WriteIf/WriteLineIf
Sergio0694 May 15, 2026
25e76b0
Add TryAppendInterpolatedStringHandler partial type
Sergio0694 May 15, 2026
fe4fd5a
Switch WriteIf/WriteLineIf to TryAppendInterpolatedStringHandler
Sergio0694 May 15, 2026
6c794ba
Add IIndentedTextWriterCallback factory-callback infrastructure
Sergio0694 May 15, 2026
b7d101d
Add IIndentedTextWriterCallback Format() extension
Sergio0694 May 15, 2026
483ca1c
Add WriteTypedefName/WriteTypeParams callbacks and migrate string cal…
Sergio0694 May 15, 2026
e08b488
Refactor WriteInterfaceMarshaller to use callback interpolation holes
Sergio0694 May 15, 2026
d5afe0d
Rename TryAppendInterpolatedStringHandler -> AppendIf
Sergio0694 May 15, 2026
3331f92
Add interface-typed callback dispatch to AppendFormatted
Sergio0694 May 15, 2026
476a936
Add WriteTypedefNameWithTypeParams writer + callback and migrate stri…
Sergio0694 May 15, 2026
de1c6a7
Refactor MetadataAttributeFactory to use callback interpolation holes
Sergio0694 May 15, 2026
d545585
Merge EmitDicShim*Forwarders into single interpolated raw strings
Sergio0694 May 15, 2026
3dcd301
Refactor file-interface and static-class declarations to use callbacks
Sergio0694 May 16, 2026
440b73d
Refactor StructEnumMarshallerFactory complex-struct emission to use c…
Sergio0694 May 16, 2026
77f0950
Refactor StructEnumMarshallerFactory Box/Unbox/CreateObject to use ca…
Sergio0694 May 16, 2026
1fbde59
Add WriteTypeInheritanceCallback and use it in class/interface declar…
Sergio0694 May 16, 2026
0f1a060
Refactor ReferenceImplFactory blittable get_Value to use callback
Sergio0694 May 16, 2026
25a8056
Add WriteTypeNameCallback and migrate string-returning WriteTypeName …
Sergio0694 May 16, 2026
89478ad
Refactor EventTableFactory and ComponentFactory inline writes to use …
Sergio0694 May 16, 2026
dd1f064
Add WriteProjectionReturnTypeCallback + WriteParameterListCallback
Sergio0694 May 16, 2026
5daa1dd
Add WriteIidExpressionCallback, drop string overload, migrate callers
Sergio0694 May 16, 2026
33c434b
Add WriteIidReferenceExpressionCallback, drop string overload, migrat…
Sergio0694 May 16, 2026
e793176
Add WriteEventTypeCallback (both overloads) and migrate callers
Sergio0694 May 16, 2026
b5c6bc3
Add WriteAbiTypeCallback + WriteEscapedIdentifierCallback paired
Sergio0694 May 16, 2026
bea62f8
Add WriteProjectedSignatureCallback, drop string overload, migrate ca…
Sergio0694 May 16, 2026
9466c26
Add WriteProjectionTypeCallback, drop string overload, migrate callers
Sergio0694 May 16, 2026
04ba16c
Add WriteInterfaceTypeNameForCcwCallback and use it at 4 call sites
Sergio0694 May 16, 2026
dcc78f4
Extract AbiTypeHelpers.GetAbiLocalTypeName and apply at 3 RcwCaller s…
Sergio0694 May 16, 2026
60261d1
Collapse DoAbi branch dispatches: out-param default + out-param write…
Sergio0694 May 16, 2026
a31ffc5
Collapse 4 ConstructorFactory.Composable base-chaining ctors via table
Sergio0694 May 16, 2026
25d9a42
Consolidate event-accessor branches via 'string accessors' local
Sergio0694 May 16, 2026
51fcac5
M15: Consolidate ComponentFactory factory-class emission via 'activat…
Sergio0694 May 16, 2026
4628066
M16: WriteAbiParameterTypesPointerCallback
Sergio0694 May 16, 2026
1b39528
M17: WriteFactoryMethodParametersCallback + WriteFactoryReturnTypeCal…
Sergio0694 May 16, 2026
b5695e2
M18: WriteGuidAttributeCallback
Sergio0694 May 16, 2026
10f3483
M19a: WriteParameterNameWithModifierCallback (per-element)
Sergio0694 May 16, 2026
ac219bf
Suppress blank lines from empty interpolation holes in multiline writes
Sergio0694 May 18, 2026
ab71e6f
R6-6: Collapse DoAbi 22-line dead 4-branch chain to single line
Sergio0694 May 18, 2026
d91b40e
R6-30: Dead code and discard cleanups
Sergio0694 May 18, 2026
27dc60e
R6-20: Extract MarkAllRequiredInterfacesVisited helper
Sergio0694 May 18, 2026
da1bb5c
R6-19: Unify FindPropertyInBaseInterfaces variants via Try- pattern
Sergio0694 May 18, 2026
af01d7a
R6-13: ClassFactory IsOverridableInterface — string.Join instead of W…
Sergio0694 May 18, 2026
802fe12
R6-5: IdentifierEscaping.EscapeIdentifier helper + ParameterInfo.GetE…
Sergio0694 May 18, 2026
32800bb
R6-9: AbiDelegateFactory event-source — reuse WriteParameterNameWithM…
Sergio0694 May 18, 2026
f5f095e
R6-14: Add ITypeDefOrRef.GetStrippedName() extension
Sergio0694 May 18, 2026
da19942
R6-3: WriteCallArgumentsCallback for argument-forwarding loops
Sergio0694 May 18, 2026
bb19428
R6-21: WriteProjectionParameter[Type]Callback for single-parameter sites
Sergio0694 May 18, 2026
a7c1011
R6-22: Consolidate generic interface method emission into one multiline
Sergio0694 May 18, 2026
35016f0
R6-1: Deduplicate WriteDefault/ExclusiveToInterfacesClass
Sergio0694 May 18, 2026
e07f322
R6-2: Callbackify MetadataAttributeFactory Write*Attribute helpers
Sergio0694 May 18, 2026
874e778
R6-15: WritePlatformAttribute callback + GetPlatformAttribute rename
Sergio0694 May 18, 2026
a9a2e3e
R6-8: EmitMarshallerConvertToUn/Managed → callback pair
Sergio0694 May 18, 2026
eef50cd
R6-4: EmitUnsafeAccessors params ReadOnlySpan overload
Sergio0694 May 18, 2026
f3eb8b6
R6-7: Share TypeMap attribute emission template across the 3 writers
Sergio0694 May 18, 2026
7277326
R6-12: Property/event accessor multiline consolidation (partial sweep)
Sergio0694 May 18, 2026
0de9413
R6-27: Collapse ProjectionFileBuilder.WriteDelegate into one declarat…
Sergio0694 May 18, 2026
f402e3c
R6-28: AbiStructFactory field-type helper
Sergio0694 May 18, 2026
5095be3
R6-10a: Extract GetInstanceFields helper in StructEnumMarshallerFactory
Sergio0694 May 18, 2026
f3c28af
R6-18b: Reuse AbiTypeHelpers.GetAbiLocalTypeName at the 2 DoAbi recei…
Sergio0694 May 18, 2026
48e22ee
R7-1: TypeSignature.IsAbiRefLike + IsAbiArrayElementRefLike extensions
Sergio0694 May 19, 2026
1df098c
R7-2: AbiTypeShapeResolver.IsBlittableAbiElement helper
Sergio0694 May 19, 2026
61e9d45
R7-4: ParameterInfo.GetRawName extension
Sergio0694 May 19, 2026
9992410
R7-7: Unify ResolveInterfaceTypeDef into ITypeDefOrRef.ResolveAsTypeD…
Sergio0694 May 19, 2026
47c2722
R7-6: InterfaceImplementation.TryResolveTypeDef helper
Sergio0694 May 19, 2026
79fa44b
R7-8: TypeDefinition.GetNonSpecialMethods iterator
Sergio0694 May 19, 2026
ddb4504
R7-9: InteropTypeNameWriter.GetInteropAssemblyQualifiedName helper
Sergio0694 May 19, 2026
660522c
R7-10, R7-24: MappedTypes.ApplyMapping and IsMapped helpers
Sergio0694 May 19, 2026
ebdfcc5
R7-11: MetadataCache.Find(ns, name) and Find(ITypeDefOrRef) overloads
Sergio0694 May 19, 2026
db13c14
R7-14, R7-28: MethodDefinition accessor-kind + WindowsFoundationMetad…
Sergio0694 May 19, 2026
96eb6b6
R7-15: CustomAttribute.TryGetFixedArgument<T> helper (Try- only)
Sergio0694 May 19, 2026
7befc3c
R7-17, R7-18: ParameterCategory.IsArrayInput + TypeSignature.AsSzArra…
Sergio0694 May 19, 2026
8638591
R7-19: Promote GetParamLocalName/GetParamName to ParameterInfo extens…
Sergio0694 May 19, 2026
488b593
R7-20, R7-22, R7-23: HasNonObjectBaseType/HasNonProjectionBaseClass +…
Sergio0694 May 19, 2026
6f8ccda
R7-27: ITypeDefOrRef.TryGetGenericInstance helper
Sergio0694 May 19, 2026
5a76f0a
R7-30, R7-31, R7-32: Small MethodDefinition + AbiTypeShapeKind helpers
Sergio0694 May 19, 2026
5614dcc
R7-26, R7-35, R7-36: Property accessor set + signature dedup-key + in…
Sergio0694 May 19, 2026
5415dd8
R7-21, R7-29: MethodSignatureInfo.ReturnNameInfo + AbiTypeHelpers.Get…
Sergio0694 May 19, 2026
1fa7980
R7-25: ArrayTempNames helper for InlineArray16/ArrayPool naming
Sergio0694 May 19, 2026
5dccab6
R7-5: MethodSignatureInfo parameter-iteration helpers
Sergio0694 May 19, 2026
c242771
R7-3: MethodSignatureMarshallingFacts record
Sergio0694 May 19, 2026
c193524
R7-12: AbiArrayElementKind classifier + initial migrations
Sergio0694 May 19, 2026
5e3d379
Refactor extension methods' docs & parameter names
Sergio0694 May 19, 2026
010ea42
Refactor extensions and remove event helper
Sergio0694 May 19, 2026
604e370
Remove IndentedTextWriterExtensions.cs
Sergio0694 May 19, 2026
dce660b
Refactor method/property helpers and simplify patterns
Sergio0694 May 19, 2026
4cf4925
Refactor type/name helpers and accessors
Sergio0694 May 19, 2026
5616206
Move StripByRefAndCustomModifiers to AbiTypeHelpers
Sergio0694 May 19, 2026
2df8920
Annotate IsByRefType and tidy TypeSignature extensions
Sergio0694 May 19, 2026
dfd3027
Improve projection writer emission and refactor
Sergio0694 May 19, 2026
549237d
Extract constant formatting to extension
Sergio0694 May 19, 2026
c482846
Remove Embedded projection-mode leftover
Sergio0694 May 19, 2026
8360660
Remove CsWinRTEmbedded* leftover MSBuild properties
Sergio0694 May 19, 2026
c8fc964
Remove Internal/private-projection support end-to-end
Sergio0694 May 19, 2026
a6d5d45
Refine platform scope and keyword initialization
Sergio0694 May 19, 2026
e1e0ac1
Extract signature generation into SignatureGenerator
Sergio0694 May 19, 2026
08fd209
Use GetSignature and avoid string allocation for IID
Sergio0694 May 19, 2026
493de83
Unify IID property emission via Guid + callbacks
Sergio0694 May 19, 2026
a13fc38
Inline TypeMappings static initialization
Sergio0694 May 19, 2026
11f2889
Refactor ContractPlatforms to TryGetPlatform
Sergio0694 May 19, 2026
67b76e5
Always emit projected structs as partial
Sergio0694 May 19, 2026
b3983a9
Tidy AbiClassFactory generic-instance flow + Dispose whitespace
Sergio0694 May 19, 2026
6179b59
Unify SZ-array element type-name ladders via AbiTypeHelpers helpers
Sergio0694 May 19, 2026
4a4bce1
Refactor Additions lookup and usage
Sergio0694 May 19, 2026
64f1b47
Reorder usings and add Callback using
Sergio0694 May 19, 2026
866ee33
Use full type names for filter checks
Sergio0694 May 19, 2026
04378a9
Refactor EmitAbiMethodBodyIfSimple to use writer-managed indentation
Sergio0694 May 20, 2026
abc36d7
Refactor EmitDoAbiBodyIfSimple to use writer-managed indentation
Sergio0694 May 20, 2026
4ecc8ae
Refactor EmitFactoryCallbackClass to use writer-managed indentation
Sergio0694 May 20, 2026
98c637f
Inline standalone manual-indent write in struct ConvertToManaged
Sergio0694 May 20, 2026
857a70b
Move IncreaseIndent earlier and consolidate consecutive WriteLines in…
Sergio0694 May 20, 2026
485716f
Strip leading whitespace from UnsafeAccessor raw strings in EmitDoAbi…
Sergio0694 May 20, 2026
dfd1ae6
Restructure WriteStructEnumMarshallerClass and tidy if-block emissions
Sergio0694 May 20, 2026
714580c
Revert unnecessary raw-string splits and WriteBlock anti-patterns
Sergio0694 May 20, 2026
8627af0
Fix HasNonObjectBaseType incorrectly returning true for System.Object…
Sergio0694 May 20, 2026
3df040c
Remove extra blank line in DoAbi.cs
Sergio0694 May 20, 2026
0c3a099
Normalize indentation in AbiMethodBodyFactory
Sergio0694 May 20, 2026
fe2b84a
Consolidate constant-content WriteLine runs into multiline raw strings
Sergio0694 May 20, 2026
83acb98
Add blank lines above // comments not preceded by blank or '{'
Sergio0694 May 20, 2026
8f64961
Move registry error comment into catch block
Sergio0694 May 20, 2026
17cea95
Unify ITypeDefOrRef extensions
Sergio0694 May 20, 2026
69320b6
Replace ClassFactory.InterfacesEqual with AbiTypeHelpers.InterfacesEq…
Sergio0694 May 20, 2026
acd0042
Inline well-known interface entries into delegate emitter
Sergio0694 May 20, 2026
92a587c
Consolidate attribute lookup on IHasCustomAttribute extensions
Sergio0694 May 20, 2026
24ec564
Adopt GetStrippedName() at type-name strip sites
Sergio0694 May 20, 2026
2c3827b
Use ITypeDefOrRef.FullName and Names() at duplicate-form sites
Sergio0694 May 20, 2026
5923302
Move StripByRefAndCustomModifiers to TypeSignature extension
Sergio0694 May 20, 2026
be5c59f
Add IsByValue() ParameterCategory predicate
Sergio0694 May 20, 2026
79439e0
Use IsArrayInput() at 9 ParameterCategory filter sites
Sergio0694 May 20, 2026
1d1cca9
Add BuildGlobalQualifiedName helper for global::Ns.Name composition
Sergio0694 May 20, 2026
1863978
Add IsReferenceTypeOrGenericInstance shape predicate
Sergio0694 May 20, 2026
b13a0ae
Simplify GetExclusiveToType and AttributedTypes.GetSystemType
Sergio0694 May 20, 2026
1cd5a0b
Delete ClassMembersFactory.ResolveInterface (redundant)
Sergio0694 May 20, 2026
97c10da
Consolidate [UnsafeAccessor] extern emissions into UnsafeAccessorFactory
Sergio0694 May 20, 2026
eaf64b9
Strip backticks inside BuildGlobalQualifiedName
Sergio0694 May 20, 2026
a9f0434
Rename ParameterCategory.IsByValue() to IsScalarInput()
Sergio0694 May 20, 2026
f8c6445
Extract MethodSignatureMarshallingFacts composite checks to resolver …
Sergio0694 May 20, 2026
9ade706
Simplify AbiTypeKindResolver: drop AbiTypeShape wrapper and rename to…
Sergio0694 May 20, 2026
f059676
Rename ParameterCategoryResolver.GetParamCategory to Resolve
Sergio0694 May 20, 2026
7d440eb
Inline ClassifyShape into Resolve
Sergio0694 May 20, 2026
e0bfb8c
Remove dead 'System' shortcut in AbiTypeHelpers.IsRuntimeClassOrInter…
Sergio0694 May 20, 2026
cc421c0
Remove dead .NET-side checks for types absent from .winmd input
Sergio0694 May 20, 2026
5ee464e
Audit System.* special cases in classifiers: delete dead, comment live
Sergio0694 May 20, 2026
df528ac
Replace .Name?.Value/.Namespace?.Value boilerplate with Names()/GetRa…
Sergio0694 May 20, 2026
8d07e7a
Dedupe types using FullName and CollectionsMarshal
Sergio0694 May 20, 2026
fd32e95
Simplify InterfacesEqualByName implementation
Sergio0694 May 20, 2026
a2ad8cc
Use GetRawNamespace to avoid allocations
Sergio0694 May 20, 2026
2f57b5a
Remove ArrayParameters and HasParameterOfCategory
Sergio0694 May 20, 2026
fef9c5a
Remove obsolete class modifier and fast-abi helper
Sergio0694 May 20, 2026
490787a
Reference-projection events & static factory
Sergio0694 May 20, 2026
851a8af
Remove dead code identified by multi-agent fleet analysis
Sergio0694 May 20, 2026
453c14d
Clarify blittable/complex struct classifiers and remove 'almost-blitt…
Sergio0694 May 20, 2026
eb9bae2
Rename ComplexStruct to NonBlittableStruct
Sergio0694 May 20, 2026
fb1b820
Use C# built-in type names in XML docs
Sergio0694 May 20, 2026
688c1e5
Clarify ABI comments: 'non-blittable' and simplify
Sergio0694 May 20, 2026
600e9cf
Fix comment punctuation in ConstructorFactory
Sergio0694 May 20, 2026
9d6c4da
Update phase comment in ProjectionGenerator
Sergio0694 May 21, 2026
24b9cb0
Simplify type categorization with pattern matching
Sergio0694 May 21, 2026
f9426cb
Rename TypeCategory to TypeKind and move it under Models/
Sergio0694 May 21, 2026
249de76
Add TypeDefinition classifier extension properties and migrate direct…
Sergio0694 May 21, 2026
d2a2a82
Introduce TypeKindResolver, move WinRT helpers to TypeDefinitionExten…
Sergio0694 May 21, 2026
4e4b310
Add per-member XML docs to TypeKind; small polish to related helpers
Sergio0694 May 21, 2026
b766080
Rename TypeKind variables to 'kind'
Sergio0694 May 21, 2026
f21c8d3
Fix CS1014 in static factory objref property: restore missing 'get' a…
Sergio0694 May 21, 2026
07959c0
Remove unnecessary cache null checks and inline 'context.Cache' uses …
Sergio0694 May 22, 2026
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
19 changes: 0 additions & 19 deletions docs/private-projection.md

This file was deleted.

83 changes: 5 additions & 78 deletions nuget/Microsoft.Windows.CsWinRT.targets
Original file line number Diff line number Diff line change
Expand Up @@ -230,12 +230,10 @@ Copyright (C) Microsoft Corporation. All rights reserved.

<PropertyGroup>
<CsWinRTResponseFile>$(CsWinRTGeneratedFilesDir)cswinrt.rsp</CsWinRTResponseFile>
<CsWinRTResponseFilePrivateProjection>$(CsWinRTGeneratedFilesDir)cswinrt_internal.rsp</CsWinRTResponseFilePrivateProjection>
<!-- %40 is an MSBuild escape code for the @ character;
https://docs.microsoft.com/en-us/previous-versions/visualstudio/visual-studio-2015/msbuild/msbuild-special-characters?view=vs-2015&redirectedfrom=MSDN
-->
<CsWinRTCommand>"$(CsWinRTExe)" %40"$(CsWinRTResponseFile)"</CsWinRTCommand>
<CsWinRTCommandPrivateProjection>"$(CsWinRTExe)" %40"$(CsWinRTResponseFilePrivateProjection)"</CsWinRTCommandPrivateProjection>
<CsWinRTWindowsMetadataInput Condition="'$(CsWinRTWindowsMetadata)' != ''">-input $(CsWinRTWindowsMetadata)</CsWinRTWindowsMetadataInput>
</PropertyGroup>

Expand All @@ -249,26 +247,14 @@ Copyright (C) Microsoft Corporation. All rights reserved.

<PropertyGroup>
<CsWinRTExcludes Condition="'$(CsWinRTExcludes)' == ''">Windows;Microsoft</CsWinRTExcludes>
<CsWinRTExcludesPrivate Condition="'$(CsWinRTExcludesPrivate)' == ''">Windows;Microsoft</CsWinRTExcludesPrivate>
</PropertyGroup>

<!-- Inputs set by users -->
<ItemGroup>
<CsWinRTExcludePrivateItems Include="$(CsWinRTExcludesPrivate)"/>
<CsWinRTIncludePrivateItems Include="$(CsWinRTIncludesPrivate)"/>
</ItemGroup>

<ItemGroup>
<CsWinRTExcludeItems Include="$(CsWinRTExcludes)"/>
<CsWinRTIncludeItems Include="$(CsWinRTIncludes)"/>
</ItemGroup>

<PropertyGroup>
<CsWinRTPrivateFilters Condition="'$(CsWinRTPrivateFilters)' == ''">
@(CsWinRTExcludePrivateItems->'-exclude %(Identity)', '&#x0d;&#x0a;')
@(CsWinRTIncludePrivateItems->'-include %(Identity)', '&#x0d;&#x0a;')
</CsWinRTPrivateFilters>

<CsWinRTFilters Condition="'$(CsWinRTFilters)' == ''">
@(CsWinRTExcludeItems->'-exclude %(Identity)', '&#x0d;&#x0a;')
@(CsWinRTIncludeItems->'-include %(Identity)', '&#x0d;&#x0a;')
Expand All @@ -280,15 +266,6 @@ Copyright (C) Microsoft Corporation. All rights reserved.
-include WindowsRuntime.Internal
</CsWinRTIncludeWinRTInterop>


<CsWinRTPrivateIncludeWinRTInterop Condition="$(CsWinRTPrivateFilters.Contains('-include Windows&#x0d;&#x0a;')) or $(CsWinRTPrivateFilters.Contains('-include Windows&#x0a;'))">
-input $(CsWinRTInteropMetadata)
-include WindowsRuntime.Internal
</CsWinRTPrivateIncludeWinRTInterop>

<CsWinRTInternalProjection Condition="'$(CsWinRTPrivateProjection)' == 'true'">-internal</CsWinRTInternalProjection>
<CsWinRTEmbeddedProjection Condition="'$(CsWinRTEmbedded)' == 'true'">-embedded</CsWinRTEmbeddedProjection>
<CsWinRTEmbeddedEnums Condition="'$(CsWinRTEmbeddedPublicEnums)' == 'true'">-public_enums</CsWinRTEmbeddedEnums>
<CsWinRTPublicExclusiveTo Condition="'$(CsWinRTPublicExclusiveToInterfaces)' == 'true'">-public_exclusiveto</CsWinRTPublicExclusiveTo>
<CsWinRTDynamicallyInterfaceCastableExclusiveTo Condition="'$(CsWinRTDynamicallyInterfaceCastableExclusiveTo)' == 'true'">-idic_exclusiveto</CsWinRTDynamicallyInterfaceCastableExclusiveTo>
<CsWinRTReferenceProjection Condition="'$(CsWinRTGenerateReferenceProjection)' == 'true'">-reference_projection</CsWinRTReferenceProjection>
Expand All @@ -301,23 +278,10 @@ $(CsWinRTWindowsMetadataInput)
-output "$(CsWinRTGeneratedFilesDir.TrimEnd('\'))"
$(CsWinRTFilters)
$(CsWinRTIncludeWinRTInterop)
$(CsWinRTEmbeddedProjection)
$(CsWinRTEmbeddedEnums)
$(CsWinRTPublicExclusiveTo)
$(CsWinRTDynamicallyInterfaceCastableExclusiveTo)
$(CsWinRTReferenceProjection)
</CsWinRTParams>

<CsWinRTPrivateParams Condition="'$(CsWinRTPrivateParams)' == ''">
$(CsWinRTCommandVerbosity)
-target $(CsWinRTExeTFM)
$(CsWinRTWindowsMetadataInput)
-input @(CsWinRTInputs->'"%(FullPath)"', ' ')
-output "$(CsWinRTGeneratedFilesDir.TrimEnd('\'))"
$(CsWinRTPrivateFilters)
$(CsWinRTPrivateIncludeWinRTInterop)
$(CsWinRTInternalProjection)
</CsWinRTPrivateParams>
</PropertyGroup>

<!--
Expand All @@ -330,7 +294,6 @@ $(CsWinRTInternalProjection)
<CsWinRTContinueOnError>false</CsWinRTContinueOnError>
<CsWinRTContinueOnError Condition="'$(DesignTimeBuild)' == 'true' OR '$(BuildingProject)' != 'true'">true</CsWinRTContinueOnError>
<CsWinRTProjectionExitCode>0</CsWinRTProjectionExitCode>
<CsWinRTPrivateProjectionExitCode>0</CsWinRTPrivateProjectionExitCode>
</PropertyGroup>

<ItemGroup>
Expand All @@ -339,64 +302,47 @@ $(CsWinRTInternalProjection)
<Delete Files="@(CsWinRTFilesToDelete)" />
<MakeDir Directories="$(CsWinRTGeneratedFilesDir)" />
<WriteLinesToFile File="$(CsWinRTResponseFile)" Lines="$(CsWinRTParams)" Overwrite="true" />
<WriteLinesToFile File="$(CsWinRTResponseFilePrivateProjection)" Lines="$(CsWinRTPrivateParams)" Overwrite="true" />

<!--
Reconstruct the include/exclude/input lists for the new C# generator from the historical
CsWinRTFilters/CsWinRTPrivateFilters multi-line strings. Some projects (e.g. the in-repo
CsWinRTFilters multi-line string. Some projects (e.g. the in-repo
Windows.csproj/Windows.UI.Xaml.csproj/WinAppSDK.csproj) set CsWinRTFilters directly with raw
cswinrt.exe-style '-include X' / '-exclude Y' directives; others rely on the default item-based
computation via CsWinRTIncludeItems/CsWinRTExcludeItems. Parsing the final filter strings back
into items handles both cases uniformly.
-->
<ItemGroup>
<_CsWinRTRefFilterLines Include="$([System.Text.RegularExpressions.Regex]::Split('$(CsWinRTFilters)', '[\r\n]+'))" />
<_CsWinRTRefPrivateFilterLines Include="$([System.Text.RegularExpressions.Regex]::Split('$(CsWinRTPrivateFilters)', '[\r\n]+'))" />

<_CsWinRTRefIncludes Include="$([System.String]::Copy('%(_CsWinRTRefFilterLines.Identity)').Trim().Substring(9))"
Condition="$([System.String]::Copy('%(_CsWinRTRefFilterLines.Identity)').Trim().StartsWith('-include '))" />
<_CsWinRTRefExcludes Include="$([System.String]::Copy('%(_CsWinRTRefFilterLines.Identity)').Trim().Substring(9))"
Condition="$([System.String]::Copy('%(_CsWinRTRefFilterLines.Identity)').Trim().StartsWith('-exclude '))" />

<_CsWinRTRefPrivateIncludes Include="$([System.String]::Copy('%(_CsWinRTRefPrivateFilterLines.Identity)').Trim().Substring(9))"
Condition="$([System.String]::Copy('%(_CsWinRTRefPrivateFilterLines.Identity)').Trim().StartsWith('-include '))" />
<_CsWinRTRefPrivateExcludes Include="$([System.String]::Copy('%(_CsWinRTRefPrivateFilterLines.Identity)').Trim().Substring(9))"
Condition="$([System.String]::Copy('%(_CsWinRTRefPrivateFilterLines.Identity)').Trim().StartsWith('-exclude '))" />
</ItemGroup>

<!--
Auto-include WindowsRuntime.Internal (and the matching interop metadata WinMD) when the user
requested the Windows namespace, mirroring the OLD CsWinRTIncludeWinRTInterop /
CsWinRTPrivateIncludeWinRTInterop behavior.
requested the Windows namespace, mirroring the OLD CsWinRTIncludeWinRTInterop behavior.
-->
<ItemGroup>
<_CsWinRTRefHasWindows Include="@(_CsWinRTRefIncludes)" Condition="'%(Identity)' == 'Windows'" />
<_CsWinRTRefPrivateHasWindows Include="@(_CsWinRTRefPrivateIncludes)" Condition="'%(Identity)' == 'Windows'" />
</ItemGroup>
<ItemGroup Condition="'@(_CsWinRTRefHasWindows)' != ''">
<_CsWinRTRefIncludes Include="WindowsRuntime.Internal" />
<_CsWinRTRefInteropInputs Include="$(CsWinRTInteropMetadata)" />
</ItemGroup>
<ItemGroup Condition="'@(_CsWinRTRefPrivateHasWindows)' != ''">
<_CsWinRTRefPrivateIncludes Include="WindowsRuntime.Internal" />
<_CsWinRTRefPrivateInteropInputs Include="$(CsWinRTInteropMetadata)" />
</ItemGroup>

<!--
Build the final input-paths list for each pass: user-provided WinMD inputs + Windows SDK
Build the final input-paths list: user-provided WinMD inputs + Windows SDK
metadata token (if any) + the auto-added interop metadata path (if any).
-->
<ItemGroup>
<_CsWinRTRefInputs Include="@(CsWinRTInputs->'%(FullPath)')" />
<_CsWinRTRefInputs Include="$(CsWinRTWindowsMetadata)" Condition="'$(CsWinRTWindowsMetadata)' != ''" />
<_CsWinRTRefInputs Include="@(_CsWinRTRefInteropInputs)" />

<_CsWinRTRefPrivateInputs Include="@(CsWinRTInputs->'%(FullPath)')" />
<_CsWinRTRefPrivateInputs Include="$(CsWinRTWindowsMetadata)" Condition="'$(CsWinRTWindowsMetadata)' != ''" />
<_CsWinRTRefPrivateInputs Include="@(_CsWinRTRefPrivateInteropInputs)" />
</ItemGroup>

<Message Text="cswinrtprojectionrefgen (public projection): @(_CsWinRTRefInputs->Count()) input(s), @(_CsWinRTRefIncludes->Count()) include(s), @(_CsWinRTRefExcludes->Count()) exclude(s)" Importance="$(CsWinRTMessageImportance)" />
<Message Text="cswinrtprojectionrefgen: @(_CsWinRTRefInputs->Count()) input(s), @(_CsWinRTRefIncludes->Count()) include(s), @(_CsWinRTRefExcludes->Count()) exclude(s)" Importance="$(CsWinRTMessageImportance)" />
<RunCsWinRTProjectionRefGenerator
InputWinMDPaths="@(_CsWinRTRefInputs)"
OutputDirectory="$(CsWinRTGeneratedFilesDir.TrimEnd('\'))"
Expand All @@ -405,8 +351,6 @@ $(CsWinRTInternalProjection)
ExcludeNamespaces="@(_CsWinRTRefExcludes)"
Verbose="$(CsWinRTMessageImportance.Equals('high'))"
Component="$(CsWinRTComponent)"
Embedded="$(CsWinRTEmbedded)"
PublicEnums="$(CsWinRTEmbeddedPublicEnums)"
PublicExclusiveTo="$(CsWinRTPublicExclusiveToInterfaces)"
IdicExclusiveTo="$(CsWinRTDynamicallyInterfaceCastableExclusiveTo)"
ReferenceProjection="$(CsWinRTGenerateReferenceProjection)"
Expand All @@ -416,31 +360,14 @@ $(CsWinRTInternalProjection)
<Output TaskParameter="ExitCode" PropertyName="CsWinRTProjectionExitCode" />
</RunCsWinRTProjectionRefGenerator>

<Message Text="cswinrtprojectionrefgen (private projection): @(_CsWinRTRefPrivateInputs->Count()) input(s), @(_CsWinRTRefPrivateIncludes->Count()) include(s), @(_CsWinRTRefPrivateExcludes->Count()) exclude(s)" Importance="$(CsWinRTMessageImportance)" Condition="'$(CsWinRTPrivateProjection)' == 'true'" />
<RunCsWinRTProjectionRefGenerator
InputWinMDPaths="@(_CsWinRTRefPrivateInputs)"
OutputDirectory="$(CsWinRTGeneratedFilesDir.TrimEnd('\'))"
TargetFramework="$(CsWinRTExeTFM)"
IncludeNamespaces="@(_CsWinRTRefPrivateIncludes)"
ExcludeNamespaces="@(_CsWinRTRefPrivateExcludes)"
Verbose="$(CsWinRTMessageImportance.Equals('high'))"
Component="$(CsWinRTComponent)"
InternalProjection="true"
CsWinRTToolsDirectory="$(CsWinRTRefGenEffectiveToolsDirectory)"
CsWinRTToolsArchitecture="$(CsWinRTToolsArchitecture)"
ContinueOnError="$(CsWinRTContinueOnError)"
Condition="'$(CsWinRTPrivateProjection)' == 'true'">
<Output TaskParameter="ExitCode" PropertyName="CsWinRTPrivateProjectionExitCode" />
</RunCsWinRTProjectionRefGenerator>

<ItemGroup Condition="'$(CsWinRTComponent)' != 'true' and Exists('$(CsWinRTResponseFile)')">
<UpToDateCheckInput Include="@(CsWinRTInputs)" Set="WinMDs" />
<UpToDateCheckInput Include="$(CsWinRTGenTasksAssembly)" Set="WinMDs" />
<UpToDateCheckBuilt Include="$(CsWinRTResponseFile)" Set="WinMDs" />
</ItemGroup>

<!-- Clean the output file if the target failed to indicate it needs to be rebuild including for design time builds which won't trigger OnError. -->
<CallTarget Targets="CsWinRTCleanGenerateProjectionOutputs" Condition="'$(CsWinRTContinueOnError)' == 'true' AND ('$(CsWinRTProjectionExitCode)' != '0' OR '$(CsWinRTPrivateProjectionExitCode)' != '0')" />
<CallTarget Targets="CsWinRTCleanGenerateProjectionOutputs" Condition="'$(CsWinRTContinueOnError)' == 'true' AND '$(CsWinRTProjectionExitCode)' != '0'" />
<OnError ExecuteTargets="CsWinRTCleanGenerateProjectionOutputs" />
</Target>

Expand Down
34 changes: 0 additions & 34 deletions src/WinRT.Generator.Tasks/RunCsWinRTProjectionRefGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,25 +73,6 @@ public sealed class RunCsWinRTProjectionRefGenerator : ToolTask
/// </summary>
public bool Component { get; set; }

/// <summary>
/// Gets or sets whether to generate a private (internal) projection. Mirrors the C++ '-internal' arg.
/// CsWinRT 3.0 leftover; preserved for OLD-target parity.
/// </summary>
public bool InternalProjection { get; set; }

/// <summary>
/// Gets or sets whether to generate an embedded projection. Mirrors the C++ '-embedded' arg.
/// CsWinRT 3.0 leftover; preserved for OLD-target parity.
/// </summary>
public bool Embedded { get; set; }

/// <summary>
/// Gets or sets whether to emit enums as public when used with the embedded option.
/// Mirrors the C++ '-public_enums' arg.
/// CsWinRT 3.0 leftover; preserved for OLD-target parity.
/// </summary>
public bool PublicEnums { get; set; }

/// <summary>
/// Gets or sets whether to make exclusive-to interfaces public in the projection
/// (default is internal). Mirrors the C++ '-public_exclusiveto' arg.
Expand Down Expand Up @@ -258,21 +239,6 @@ protected override string GenerateResponseFileCommands()
AppendResponseFileCommand(args, "--component", "true");
}

if (InternalProjection)
{
AppendResponseFileCommand(args, "--internal", "true");
}

if (Embedded)
{
AppendResponseFileCommand(args, "--embedded", "true");
}

if (PublicEnums)
{
AppendResponseFileCommand(args, "--public-enums", "true");
}

if (PublicExclusiveTo)
{
AppendResponseFileCommand(args, "--public-exclusive-to", "true");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,6 @@ private static ProjectionWriterOptions BuildWriterOptions(ReferenceProjectionGen
AdditionExclude = args.AdditionExcludeNamespaces,
Verbose = args.Verbose,
Component = args.Component,
Internal = args.Internal,
Embedded = args.Embedded,
PublicEnums = args.PublicEnums,
PublicExclusiveTo = args.PublicExclusiveTo,
IdicExclusiveTo = args.IdicExclusiveTo,
ReferenceProjection = args.ReferenceProjection,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,6 @@ public static ReferenceProjectionGeneratorArgs ParseFromResponseFile(string path
AdditionExcludeNamespaces = GetOptionalStringArrayArgument(argsMap, nameof(AdditionExcludeNamespaces)),
Verbose = GetOptionalBoolArgument(argsMap, nameof(Verbose)),
Component = GetOptionalBoolArgument(argsMap, nameof(Component)),
Internal = GetOptionalBoolArgument(argsMap, nameof(Internal)),
Embedded = GetOptionalBoolArgument(argsMap, nameof(Embedded)),
PublicEnums = GetOptionalBoolArgument(argsMap, nameof(PublicEnums)),
PublicExclusiveTo = GetOptionalBoolArgument(argsMap, nameof(PublicExclusiveTo)),
IdicExclusiveTo = GetOptionalBoolArgument(argsMap, nameof(IdicExclusiveTo)),
ReferenceProjection = GetOptionalBoolArgument(argsMap, nameof(ReferenceProjection)),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,27 +46,6 @@ internal sealed partial class ReferenceProjectionGeneratorArgs
[CommandLineArgumentName("--component")]
public bool Component { get; init; }

/// <summary>
/// Gets whether to generate a private (<c>internal</c>) projection.
/// CsWinRT 3.0 leftover; preserved for OLD-target parity.
/// </summary>
[CommandLineArgumentName("--internal")]
public bool Internal { get; init; }

/// <summary>
/// Gets whether to generate an embedded projection.
/// CsWinRT 3.0 leftover; preserved for OLD-target parity.
/// </summary>
[CommandLineArgumentName("--embedded")]
public bool Embedded { get; init; }

/// <summary>
/// Gets whether to emit enums as public when used with the embedded option.
/// CsWinRT 3.0 leftover; preserved for OLD-target parity.
/// </summary>
[CommandLineArgumentName("--public-enums")]
public bool PublicEnums { get; init; }

/// <summary>Gets whether to make exclusive-to interfaces public in the projection.</summary>
[CommandLineArgumentName("--public-exclusive-to")]
public bool PublicExclusiveTo { get; init; }
Expand Down
Loading