[mtouch tests] Use a different default app name for service extensions.
Otherwise it might end up clashing with the main app's name, preventing code sharing.
This commit is contained in:
Родитель
18a6bf4690
Коммит
a1a141b4ca
|
@ -421,11 +421,11 @@ namespace Xamarin
|
||||||
using (var extension = new MTouchTool ()) {
|
using (var extension = new MTouchTool ()) {
|
||||||
// Create a library with the same name as the root assembly
|
// Create a library with the same name as the root assembly
|
||||||
var tmp = extension.CreateTemporaryDirectory ();
|
var tmp = extension.CreateTemporaryDirectory ();
|
||||||
var dll = CompileTestAppCode ("library", tmp, "public class X {}");
|
var dll = CompileTestAppCode ("library", tmp, "public class X {}", appName: "testApp");
|
||||||
|
|
||||||
extension.Linker = MTouchLinker.DontLink; // fastest.
|
extension.Linker = MTouchLinker.DontLink; // fastest.
|
||||||
extension.Extension = true;
|
extension.Extension = true;
|
||||||
extension.CreateTemporararyServiceExtension (extraArg: $"-r:{Quote (dll)}", extraCode: "class Z { static void Y () { System.Console.WriteLine (typeof (X)); } }");
|
extension.CreateTemporararyServiceExtension (extraArg: $"-r:{Quote (dll)}", extraCode: "class Z { static void Y () { System.Console.WriteLine (typeof (X)); } }", appName: "testApp");
|
||||||
extension.CreateTemporaryCacheDirectory ();
|
extension.CreateTemporaryCacheDirectory ();
|
||||||
extension.References = new [] { dll };
|
extension.References = new [] { dll };
|
||||||
extension.AssertExecute (MTouchAction.BuildSim, "extension build");
|
extension.AssertExecute (MTouchAction.BuildSim, "extension build");
|
||||||
|
|
|
@ -475,10 +475,10 @@ namespace Xamarin
|
||||||
File.WriteAllText (Path.Combine (app, "Info.plist"), CreatePlist (Profile, appName));
|
File.WriteAllText (Path.Combine (app, "Info.plist"), CreatePlist (Profile, appName));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void CreateTemporararyServiceExtension (string code = null, string extraCode = null, string extraArg = null)
|
public void CreateTemporararyServiceExtension (string code = null, string extraCode = null, string extraArg = null, string appName = "testServiceExtension")
|
||||||
{
|
{
|
||||||
var testDir = CreateTemporaryDirectory ();
|
var testDir = CreateTemporaryDirectory ();
|
||||||
var app = Path.Combine (testDir, "testApp.appex");
|
var app = Path.Combine (testDir, $"{appName}.appex");
|
||||||
Directory.CreateDirectory (app);
|
Directory.CreateDirectory (app);
|
||||||
|
|
||||||
if (code == null) {
|
if (code == null) {
|
||||||
|
@ -493,7 +493,7 @@ public partial class NotificationService : UNNotificationServiceExtension
|
||||||
code += extraCode;
|
code += extraCode;
|
||||||
|
|
||||||
AppPath = app;
|
AppPath = app;
|
||||||
RootAssembly = MTouch.CompileTestAppLibrary (testDir, code: code, profile: Profile, extraArg: extraArg);
|
RootAssembly = MTouch.CompileTestAppLibrary (testDir, code: code, profile: Profile, extraArg: extraArg, appName: appName);
|
||||||
|
|
||||||
File.WriteAllText (Path.Combine (app, "Info.plist"),
|
File.WriteAllText (Path.Combine (app, "Info.plist"),
|
||||||
@"<?xml version=""1.0"" encoding=""UTF-8""?>
|
@"<?xml version=""1.0"" encoding=""UTF-8""?>
|
||||||
|
|
Загрузка…
Ссылка в новой задаче