4 <_ResourceItemsWithTargetPath>
5 <TizenProfile>$(AllTizenProfiles)</TizenProfile>
6 <CopyToOutputDirectory>Never</CopyToOutputDirectory>
7 </_ResourceItemsWithTargetPath>
11 <AllTizenProfilesItems Include="$(AllTizenProfiles.Split(';'))" />
12 <SupportedProfilesItems Include="$(SupportedProfiles.Split(';'))" Condition="'$(SupportedProfiles)' != ''" />
15 <Target Name="GenerateProfileFileList" Outputs="%(AllTizenProfilesItems.Identity)">
18 <_TargetProfile>%(AllTizenProfilesItems.Identity)</_TargetProfile>
19 <_IsProfileMatch>false</_IsProfileMatch>
20 <_IsProfileMatch Condition="'%(SupportedProfilesItems.Identity)' == '$(_TargetProfile)'">true</_IsProfileMatch>
23 <AssignTargetPath Files="@(None)" RootFolder="$(MSBuildProjectDirectory)">
24 <Output TaskParameter="AssignedFiles" ItemName="_ItemsWithTargetPath" />
28 <_ResourceItemsWithTargetPath Include="@(_ItemsWithTargetPath)"
29 Condition="$([System.String]::new('%(_ItemsWithTargetPath.TargetPath)').StartsWith('res/', System.StringComparison.OrdinalIgnoreCase))" />
30 <_ResourceItemsWithTargetPath Remove="@(_ResourceItemsWithTargetPath)"
31 Condition="'%(CopyToOutputDirectory)' == '' Or '%(CopyToOutputDirectory)' == 'Never'" />
34 <GetProfileMatchedItems
35 Items="@(_ResourceItemsWithTargetPath)"
36 TargetProfile="$(_TargetProfile)">
37 <Output TaskParameter="MatchedItems" ItemName="_ProfileResourceItemsWithTargetPath" />
38 </GetProfileMatchedItems>
41 <_ProfilePreloadItems Include="$(OutDir)*.preload" />
45 <_ProfileFiles Include="$(TargetFileName)" Condition="'$(_IsProfileMatch)' == 'true'" />
46 <_ProfileFiles Include="%(_ProfileResourceItemsWithTargetPath.TargetPath)" Condition="'$(_IsProfileMatch)' == 'true'" />
47 <_ProfileFiles Include="@(_ProfilePreloadItems->'%(Filename)%(Extension)')" Condition="'$(_IsProfileMatch)' == 'true'" />
48 <_ProfileFiles Include="ref/$(TargetFileName)" Condition="'$(_IsProfileMatch)' == 'false'" />
51 <WriteLinesToFile File="$(OutDir)$(TargetName).$(_TargetProfile).filelist"
53 Lines="@(_ProfileFiles)" />
58 TaskName="GetProfileMatchedItems"
59 TaskFactory="RoslynCodeTaskFactory"
60 AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.Core.dll">
62 <Items Required="true" ParameterType="Microsoft.Build.Framework.ITaskItem[]" />
63 <TargetProfile Required="true" />
64 <MatchedItems ParameterType="Microsoft.Build.Framework.ITaskItem[]" Output="true" />
67 <Using Namespace="System" />
68 <Using Namespace="System.IO" />
69 <Using Namespace="System.Linq" />
70 <Using Namespace="System.Collections.Generic" />
71 <Code Type="Fragment" Language="cs">
73 var _matchedItems = new List<ITaskItem>();
74 foreach (var item in Items) {
75 string tizenProfile = item.GetMetadata("TizenProfile");
76 if (!string.IsNullOrEmpty(tizenProfile)) {
77 string[] profiles = tizenProfile.Split(';');
78 if (profiles.Any(TargetProfile.Equals)) {
79 _matchedItems.Add(item);
83 MatchedItems = _matchedItems.ToArray();