novotnyllc / MSBuildSdkExtras

Extra properties for MSBuild SDK projects
MIT License
345 stars 44 forks source link

[Xamarin.iOS10] How to add BundleResource #169

Open thudugala opened 5 years ago

thudugala commented 5 years ago

How to add BundleResource and ImageAsset for iOS. When building Project from VS2019 16.1.4 Windows. Can anyone help ?

in Android, it works

<ItemGroup Condition="$(TargetFramework.StartsWith('MonoAndroid'))">
    <AndroidResource Include="Resources\**\*.png" CopyToOutputDirectory="Never" />
    <AndroidResource Include="Resources\**\*.xml" CopyToOutputDirectory="Never" />
</ItemGroup>

Result image

in iOS, it does not work

<ItemGroup Condition="$(TargetFramework.StartsWith('Xamarin.iOS'))">
     <BundleResource Include="Image\*.png" CopyToOutputDirectory="Never" Pack="true" />
    <ImageAsset Include="Resources\Media.xcassets\AppIcons.appiconset\Contents.json" CopyToOutputDirectory="Never" Pack="true" />
    <ImageAsset Include="Resources\Media.xcassets\AppIcons.appiconset\*.png" CopyToOutputDirectory="Never" Pack="true" />
    <ImageAsset Include="Resources\Media.xcassets\LaunchImages.launchimage\Contents.json" CopyToOutputDirectory="Never" Pack="true" />
  </ItemGroup>
Result Expectation
image image

When building I get output

7>Executing SayHello Task to establish a connection to a Mac Server. 
7>                       Properties: SessionId=18b9a7c7729929acfa82b3620e3d658b, 
7>                          ServerPort=, 
7>                          ServerAddress=, 
7>                          ServerUser=, 
7>                          ServerPassword=, 
7>                          SSHKey=, 
7>                          SSHPassPhrase=,
7>                          AppName=Abel.iOS,
7>                          ContinueOnDisconnected=true
softlion commented 4 years ago

Any workaround ?