Skip to content
This repository was archived by the owner on Jan 12, 2024. It is now read-only.

Commit e0aac12

Browse files
committed
Add PackageFile build action support to package project
Also make the default included readme a package file instead.
1 parent 5946bcf commit e0aac12

5 files changed

Lines changed: 77 additions & 5 deletions

File tree

src/VisualStudio/NuGet.Packaging.VisualStudio.15/Templates/Projects/Nuget/Package/Package.nuproj

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,7 @@
2929
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'" />
3030

3131
<ItemGroup>
32-
<None Include="Readme.txt">
33-
<IncludeInPackage>true</IncludeInPackage>
34-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
35-
</None>
32+
<PackageFile Include="Readme.txt" />
3633
</ItemGroup>
3734

3835
<Import Project="$(MSBuildToolsPath)\Microsoft.Common.targets" />

src/VisualStudio/NuGet.Packaging.VisualStudio/NuGet.Packaging.VisualStudio.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,10 @@
182182
<SubType>Designer</SubType>
183183
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
184184
</Content>
185+
<Content Include="Rules\PackageFile.xaml">
186+
<SubType>Designer</SubType>
187+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
188+
</Content>
185189
<Page Include="Views\AddPlatformImplementationView.xaml">
186190
<SubType>Designer</SubType>
187191
<Generator>MSBuild:Compile</Generator>
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Rule Name="PackageFile"
3+
DisplayName="Package File"
4+
PageTemplate="generic"
5+
Description="Package file items"
6+
xmlns="http://schemas.microsoft.com/build/2009/properties">
7+
8+
<Rule.DataSource>
9+
<DataSource Persistence="ProjectFile"
10+
HasConfigurationCondition="False"
11+
ItemType="PackageFile" />
12+
</Rule.DataSource>
13+
<Rule.Categories>
14+
<Category Name="Advanced"
15+
DisplayName="Advanced" />
16+
<Category Name="Misc"
17+
DisplayName="Misc" />
18+
</Rule.Categories>
19+
20+
<DynamicEnumProperty Name="{}{ItemType}"
21+
DisplayName="Build Action"
22+
Category="Advanced"
23+
Description="How the file relates to the build and deployment processes."
24+
EnumProvider="ItemTypes" />
25+
26+
<StringProperty Name="Identity"
27+
DisplayName="File Name"
28+
ReadOnly="true"
29+
Category="Misc"
30+
Description="Name of the file or folder.">
31+
<StringProperty.DataSource>
32+
<DataSource Persistence="Intrinsic"
33+
ItemType="PackageFile"
34+
PersistedName="Identity" />
35+
</StringProperty.DataSource>
36+
</StringProperty>
37+
38+
<StringProperty Name="FullPath"
39+
DisplayName="Full Path"
40+
ReadOnly="true"
41+
Category="Misc"
42+
Description="Location of the file.">
43+
<StringProperty.DataSource>
44+
<DataSource Persistence="Intrinsic"
45+
ItemType="PackageFile"
46+
PersistedName="FullPath" />
47+
</StringProperty.DataSource>
48+
</StringProperty>
49+
50+
<BoolProperty Name="Visible"
51+
Visible="false" />
52+
<StringProperty Name="Link"
53+
Visible="false" />
54+
<StringProperty Name="Extension"
55+
Visible="False">
56+
<StringProperty.DataSource>
57+
<DataSource Persistence="Intrinsic"
58+
ItemType="PackageFile"
59+
PersistedName="Extension" />
60+
</StringProperty.DataSource>
61+
</StringProperty>
62+
</Rule>

src/VisualStudio/NuGet.Packaging.VisualStudio/Rules/ProjectItemsSchema.xaml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<ProjectSchemaDefinitions xmlns="http://schemas.microsoft.com/build/2009/properties">
33

4-
<ItemType Name="None"
4+
<ItemType Name="PackageFile"
5+
DisplayName="Package File" />
6+
7+
<ContentType Name="PackageFile"
8+
DisplayName="Package File"
9+
ItemType="PackageFile">
10+
</ContentType>
11+
12+
<ItemType Name="None"
513
DisplayName="None" />
614

715
<ItemType Name="Content"

src/VisualStudio/NuGet.Packaging.VisualStudio/Targets/NuGet.Packaging.Authoring.targets

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ Copyright (c) .NET Foundation. All rights reserved.
3535
<Context>BrowseObject</Context>
3636
</PropertyPageSchema>
3737
<PropertyPageSchema Include="
38+
$(ProjectSystemRulesDir)PackageFile.xaml;
3839
$(ProjectSystemRulesDir)folder.xaml;
3940
$(ProjectSystemRulesDir)none.xaml;
4041
$(ProjectSystemRulesDir)content.xaml">

0 commit comments

Comments
 (0)