基本上我创建了一个Xamarin插件
multi-targeting
就像在
url
解释。在项目配置中,我定义如下
<TargetFrameworks>netstandard2.0;Xamarin.iOS10;Xamarin.TVOS10;MonoAndroid90;MonoAndroid10.0;tizen40;</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' == 'Windows_NT' ">$(TargetFrameworks);uap10.0.16299;</TargetFrameworks>
所以我的目标是多个框架。
<ItemGroup Condition=" $(TargetFramework.StartsWith('MonoAndroid')) ">
<Compile Include="**\*.android.cs" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.2" />
<PackageReference Include="Plugin.CurrentActivity" Version="2.1.0.4" />
<PackageReference Include="Xamarin.Android.Support.Annotations" Version="28.0.0.3" />
<PackageReference Include="Xamarin.Android.Google.BillingClient" Version="2.0.3" />
</ItemGroup>
现在我的问题是我希望同样的插件也能为亚马逊应用程序工作。它也是一个以单安卓为目标的安卓系统。它有自己的包和代码。
在我的解决方案中,我已经分离为myApp.Droid和myApp.Amazon.Droid。所以基本上在同一个解决方案中,我有两个android项目。谷歌1,亚马逊1。我的问题是我怎样才能使这种情况像;
-
如果目标项目名称包含“amazon”,则仅在此项目上安装某些文件。
-
如果不存在/else,请安装在默认的MonoAndroid项目上。