Skip to content

Commit

Permalink
Add Visual Studio 2022 CSharp project property page
Browse files Browse the repository at this point in the history
  • Loading branch information
pepone committed Nov 28, 2021
1 parent 4ba9775 commit fcaa91b
Show file tree
Hide file tree
Showing 3 changed files with 112 additions and 47 deletions.
57 changes: 57 additions & 0 deletions msbuild/SliceCompile.CSharp.File.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) ZeroC, Inc. All rights reserved. -->
<Rule
Name="SliceCompile"
DisplayName="File Properties"
PageTemplate="generic"
Description="File Properties"
xmlns="http://schemas.microsoft.com/build/2009/properties">

<Rule.DataSource>
<DataSource Persistence="ProjectFile" HasConfigurationCondition="false" ItemType="SliceCompile" SourceOfDefaultValue="AfterContext"/>
</Rule.DataSource>

<Rule.Categories>
<Category Name="Advanced" DisplayName="Advanced" />
<Category Name="Misc" DisplayName="Misc" />
</Rule.Categories>

<DynamicEnumProperty
Name="{}{ItemType}"
DisplayName="Build Action"
Category="Advanced"
Description="How the file relates to the build and deployment processes."
EnumProvider="ItemTypes" />

<StringProperty
Name="Identity"
Visible="false"
ReadOnly="true"
Category="Misc"
Description="The item specified in the Include attribute.">
<StringProperty.DataSource>
<DataSource Persistence="Intrinsic" ItemType="SliceCompile" PersistedName="Identity" SourceOfDefaultValue="AfterContext" />
</StringProperty.DataSource>
</StringProperty>

<StringProperty
Name="FullPath"
DisplayName="Full Path"
ReadOnly="true"
Category="Misc"
Description="Location of the file.">
<StringProperty.DataSource>
<DataSource Persistence="Intrinsic" ItemType="SliceCompile" PersistedName="FullPath" SourceOfDefaultValue="AfterContext" />
</StringProperty.DataSource>
</StringProperty>

<StringProperty Name="Link" Visible="false">
<StringProperty.DataSource>
<DataSource PersistenceStyle="Attribute" SourceOfDefaultValue="AfterContext" />
</StringProperty.DataSource>
<StringProperty.Metadata>
<NameValuePair Name="DoNotCopyAcrossProjects" Value="true" />
</StringProperty.Metadata>
</StringProperty>

</Rule>
90 changes: 49 additions & 41 deletions msbuild/SliceCompile.CSharp.xaml
Original file line number Diff line number Diff line change
@@ -1,57 +1,65 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 2009-2018 ZeroC, Inc. All rights reserved. -->
<!-- Copyright (c) ZeroC, Inc. All rights reserved. -->
<Rule
Name="SliceCompile"
DisplayName="File Properties"
DisplayName="Ice Builder"
PageTemplate="generic"
Description="File Properties"
Order="201"
Description="Ice Builder project settings"
xmlns="http://schemas.microsoft.com/build/2009/properties">

<Rule.DataSource>
<DataSource Persistence="ProjectFile" HasConfigurationCondition="false" ItemType="SliceCompile" SourceOfDefaultValue="AfterContext"/>
<DataSource
Persistence="ProjectFile"
ItemType=""
Label="IceBuilder"
HasConfigurationCondition="false"
SourceOfDefaultValue="AfterContext"/>
</Rule.DataSource>

<Rule.Categories>
<Category Name="Advanced" DisplayName="Advanced" />
<Category Name="Misc" DisplayName="Misc" />
</Rule.Categories>

<DynamicEnumProperty
Name="{}{ItemType}"
DisplayName="Build Action"
Category="Advanced"
Description="How the file relates to the build and deployment processes."
EnumProvider="ItemTypes" />

<StringProperty
Name="Identity"
Visible="false"
ReadOnly="true"
Category="Misc"
Description="The item specified in the Include attribute.">
<StringProperty.DataSource>
<DataSource Persistence="Intrinsic" ItemType="SliceCompile" PersistedName="Identity" SourceOfDefaultValue="AfterContext" />
</StringProperty.DataSource>
</StringProperty>

<StringProperty
Name="FullPath"
DisplayName="Full Path"
ReadOnly="true"
Category="Misc"
Description="Location of the file.">
Name="OutputDir"
DisplayName="Output Directory"
Description="Directory of C# source files generated by slice2cs."
Subtype="folder"
Category="General">
<StringProperty.DataSource>
<DataSource Persistence="Intrinsic" ItemType="SliceCompile" PersistedName="FullPath" SourceOfDefaultValue="AfterContext" />
<DataSource
Persistence="ProjectFile"
ItemType="SliceCompile"
Label="IceBuilder"
HasConfigurationCondition="false"
SourceOfDefaultValue="AfterContext"/>
</StringProperty.DataSource>
</StringProperty>

<StringProperty Name="Link" Visible="false">
<StringProperty.DataSource>
<DataSource PersistenceStyle="Attribute" SourceOfDefaultValue="AfterContext" />
</StringProperty.DataSource>
<StringProperty.Metadata>
<NameValuePair Name="DoNotCopyAcrossProjects" Value="true" />
</StringProperty.Metadata>
</StringProperty>
<StringListProperty
Name="IncludeDirectories"
DisplayName="Include Directories"
Description="Specifies one or more directories to add to the Slice include path; use semi-colons (;) as directory separators."
Subtype="folder"
Category="General">
<StringListProperty.DataSource>
<DataSource
Persistence="ProjectFile"
ItemType="SliceCompile"
Label="IceBuilder"
HasConfigurationCondition="false"
SourceOfDefaultValue="AfterContext"/>
</StringListProperty.DataSource>
</StringListProperty>

<StringListProperty
DisplayName="Additional Options"
Name="AdditionalOptions"
Description="Additional command-line options to pass to slice2cs.">
<StringListProperty.DataSource>
<DataSource
Persistence="ProjectFile"
ItemType="SliceCompile"
Label="IceBuilder"
HasConfigurationCondition="false"
SourceOfDefaultValue="AfterContext"/>
</StringListProperty.DataSource>
</StringListProperty>
</Rule>
12 changes: 6 additions & 6 deletions msbuild/zeroc.icebuilder.msbuild.csharp.targets
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,17 @@

<ItemGroup>
<PropertyPageSchema Include="$(MSBuildThisFileDirectory)ProjectItemsSchema.xaml" />
<PropertyPageSchema Include="$(MSBuildThisFileDirectory)SliceCompile.CSharp.xaml">
<!-- This capability is used to apply the Slice property page designer -->
<ProjectCapability Include="SliceCompile" />
<PropertyPageSchema Include="$(MSBuildThisFileDirectory)SliceCompile.CSharp.File.xaml">
<Context>BrowseObject;File</Context>
</PropertyPageSchema>
<PropertyPageSchema Include="$(MSBuildThisFileDirectory)SliceCompile.CSharp.xaml">
<Context>Project</Context>
</PropertyPageSchema>
<AvailableItemName Include="SliceCompile"/>
</ItemGroup>

<!-- This capability is used to apply the Slice property page designer -->
<ItemGroup>
<ProjectCapability Include="SliceCompile" />
</ItemGroup>

<!--
Settings that are only supported with MSBuild 15.0 and up. The item Update
attribute is not supported with older MSBuild versions.
Expand Down

0 comments on commit fcaa91b

Please sign in to comment.