summaryrefslogtreecommitdiff
path: root/.nuspec/Xamarin.Forms.targets
blob: 37959c40712a539b8bfa6a87fda4e38a34efd9a4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
	<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>
		<_DefaultXamlItemsEnabled>False</_DefaultXamlItemsEnabled>
		<_DefaultXamlItemsEnabled Condition="'$(EnableDefaultItems)'=='' And '$(EnableDefaultXamlItems)'=='True' And '$(EnableDefaultEmbeddedResourceItems)'=='True'">True</_DefaultXamlItemsEnabled>
	</PropertyGroup>

	<Import Project="$(MSBuildThisFileDirectory)Xamarin.Forms.DefaultItems.targets" Condition="'$(_DefaultXamlItemsEnabled)'=='True'" />

	<PropertyGroup>
		<CoreCompileDependsOn>
			XamlG;
			$(CoreCompileDependsOn);
		</CoreCompileDependsOn>
	</PropertyGroup>
  
	<PropertyGroup>
		<CompileDependsOn>
			$(CompileDependsOn);
			XamlC;
		</CompileDependsOn>
	</PropertyGroup>
  
	<Target Name="UpdateDesignTimeXaml" DependsOnTargets="XamlG"/>
  
	<Target Name="XamlG" DependsOnTargets="$(XamlGDependsOn)"/>
  
	<PropertyGroup>
		<XamlGDependsOn>
			_PreXamlG;
			_CollectXamlFiles;
			_CoreXamlG;
		</XamlGDependsOn>
	</PropertyGroup>
  
	<Target Name="_PreXamlG">
		<MakeDir Directories="$(IntermediateOutputPath)"/>
	</Target>
  
	<Target Name="_CollectXamlFiles">
		<ItemGroup>
			<_XamlResources Include="@(EmbeddedResource)" Condition="'%(Extension)' == '.xaml' AND '$(DefaultLanguageSourceExtension)' == '.cs'"/>
		</ItemGroup>
		<FixedCreateCSharpManifestResourceName ResourceFiles="@(_XamlResources)" RootNamespace="$(RootNamespace)">
			<Output TaskParameter="ResourceFilesWithManifestResourceNames" ItemName="XamlFiles" />
		</FixedCreateCSharpManifestResourceName>
		<ItemGroup>
			<XamlGFiles Include="@(XamlFiles->'$(IntermediateOutputPath)%(ManifestResourceName).g$(DefaultLanguageSourceExtension)')"/>
			<Compile Include="@(XamlGFiles)"/>
			<FileWrites Include="@(XamlGFiles)"/>
		</ItemGroup>
	</Target>
  
	<Target Name="_CoreXamlG"
		Inputs = "@(XamlFiles)"
		Outputs = "$(IntermediateOutputPath)%(ManifestResourceName).g$(DefaultLanguageSourceExtension)">
		<XamlGTask
			Source="@(XamlFiles)"
			Language = "$(Language)"
			AssemblyName = "$(AssemblyName)"
			OutputFile = "$(IntermediateOutputPath)%(ManifestResourceName).g$(DefaultLanguageSourceExtension)">
		</XamlGTask>
	</Target>
  
	<Target Name="XamlC">
		<XamlCTask
			Assembly = "$(IntermediateOutputPath)$(TargetFileName)"
			ReferencePath = "@(ReferencePath)"
			Verbosity = "2"
			OptimizeIL = "true"
			DebugSymbols = "$(DebugSymbols)"
			DebugType = "$(DebugType)"/>
	</Target>
</Project>