diff options
author | Mikayla Hutchinson <m.j.hutchinson@gmail.com> | 2017-08-15 14:21:42 -0400 |
---|---|---|
committer | Rui Marinho <me@ruimarinho.net> | 2017-08-15 19:21:42 +0100 |
commit | b6c1b60fa65889c87f7d42a6fbe8a6c9411f0c37 (patch) | |
tree | 390b8b9cd71880b4d3b7a2601a66237487886daa /.nuspec | |
parent | 2747cdc7a6b34dd336d1a017f4653a6b43c58699 (diff) | |
download | xamarin-forms-b6c1b60fa65889c87f7d42a6fbe8a6c9411f0c37.tar.gz xamarin-forms-b6c1b60fa65889c87f7d42a6fbe8a6c9411f0c37.tar.bz2 xamarin-forms-b6c1b60fa65889c87f7d42a6fbe8a6c9411f0c37.zip |
Automatically add XAML items to Sdk-style projects (#1101)
By default, Compile/EmbeddedResource/None items are added to Sdk-style
projects by wildcard. Use the same logic to add XAML files and fix
up the item metadata.
Diffstat (limited to '.nuspec')
-rw-r--r-- | .nuspec/Xamarin.Forms.nuspec | 2 | ||||
-rw-r--r-- | .nuspec/Xamarin.Forms.props | 16 | ||||
-rw-r--r-- | .nuspec/Xamarin.Forms.targets | 6 |
3 files changed, 23 insertions, 1 deletions
diff --git a/.nuspec/Xamarin.Forms.nuspec b/.nuspec/Xamarin.Forms.nuspec index 8a50c78c..f500e5e9 100644 --- a/.nuspec/Xamarin.Forms.nuspec +++ b/.nuspec/Xamarin.Forms.nuspec @@ -118,12 +118,14 @@ <!--Xaml PCL Stuff--> <file src="Xamarin.Forms.targets" target="build\portable-win+net45+wp80+win81+wpa81\Xamarin.Forms$IdAppend$.targets" /> + <file src="Xamarin.Forms.props" target="build\portable-win+net45+wp80+win81+wpa81\Xamarin.Forms$IdAppend$.props" /> <file src="..\Xamarin.Forms.Build.Tasks\bin\$Configuration$\Xamarin.Forms.Build.Tasks.dll" target="build\portable-win+net45+wp80+win81+wpa81" /> <file src="..\Xamarin.Forms.Build.Tasks\bin\$Configuration$\Xamarin.Forms.Core.dll" target="build\portable-win+net45+wp80+win81+wpa81" /> <file src="..\Xamarin.Forms.Build.Tasks\bin\$Configuration$\Xamarin.Forms.Xaml.dll" target="build\portable-win+net45+wp80+win81+wpa81" /> <!--Xaml netstandard Stuff--> <file src="Xamarin.Forms.targets" target="build\netstandard1.0\Xamarin.Forms$IdAppend$.targets" /> + <file src="Xamarin.Forms.props" target="build\netstandard1.0\Xamarin.Forms$IdAppend$.props" /> <file src="..\Xamarin.Forms.Build.Tasks\bin\$Configuration$\Xamarin.Forms.Build.Tasks.dll" target="build\netstandard1.0" /> <file src="..\Xamarin.Forms.Build.Tasks\bin\$Configuration$\Xamarin.Forms.Core.dll" target="build\netstandard1.0" /> <file src="..\Xamarin.Forms.Build.Tasks\bin\$Configuration$\Xamarin.Forms.Xaml.dll" target="build\netstandard1.0" /> diff --git a/.nuspec/Xamarin.Forms.props b/.nuspec/Xamarin.Forms.props new file mode 100644 index 00000000..a675c89e --- /dev/null +++ b/.nuspec/Xamarin.Forms.props @@ -0,0 +1,16 @@ +<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + + <!-- + When using Sdk-style projects and default embedded resource items are enabled, automatically + add the XAML files and fix up item metadata to pair them with code files. + This is in the props file, not the targets file, so that projects can remove/update these items. + The default value for EnableDefaultXamlItems is set in the targets, which works because + the property evaluation pass comes before the item evaluation pass. + --> + <ItemGroup Condition="'$(EnableDefaultItems)'=='True' and '$(EnableDefaultXamlItems)'=='True' and '$(EnableDefaultEmbeddedResourceItems)'=='True'"> + <None Remove="**\*.xaml" Condition="'$(EnableDefaultNoneItems)'=='True'" /> + <Compile Update="**\*.xaml$(DefaultLanguageSourceExtension)" DependentUpon="%(Filename)" SubType="Code" /> + <EmbeddedResource Include="**\*.xaml" Exclude="$(DefaultItemExcludes);$(DefaultExcludesInProjectFolder)" SubType="Designer" Generator="MSBuild:UpdateDesignTimeXaml" /> + </ItemGroup> + +</Project>
\ No newline at end of file diff --git a/.nuspec/Xamarin.Forms.targets b/.nuspec/Xamarin.Forms.targets index 2274c1ee..e414dbe9 100644 --- a/.nuspec/Xamarin.Forms.targets +++ b/.nuspec/Xamarin.Forms.targets @@ -2,7 +2,11 @@ <UsingTask TaskName="Xamarin.Forms.Build.Tasks.XamlGTask" AssemblyFile="Xamarin.Forms.Build.Tasks.dll"/> <UsingTask TaskName="Xamarin.Forms.Build.Tasks.FixedCreateCSharpManifestResourceName" AssemblyFile="Xamarin.Forms.Build.Tasks.dll"/> <UsingTask TaskName="Xamarin.Forms.Build.Tasks.XamlCTask" AssemblyFile="Xamarin.Forms.Build.Tasks.dll"/> - + + <PropertyGroup> + <EnableDefaultXamlItems Condition="'$(EnableDefaultXamlItems)'==''">True</EnableDefaultXamlItems> + </PropertyGroup> + <PropertyGroup> <CoreCompileDependsOn> XamlG; |