protected override void ProcessProject() { base.ProcessProject(); if (MonoNativeInfo == null) { return; } MonoNativeInfo.AddProjectDefines(inputProject); inputProject.AddAdditionalDefines("MONO_NATIVE_MAC"); XmlDocument info_plist = new XmlDocument(); var target_info_plist = Path.Combine(TargetDirectory, "Info" + Suffix + ".plist"); info_plist.LoadWithoutNetworkAccess(Path.Combine(TargetDirectory, "Info-mac.plist")); BundleIdentifier = info_plist.GetCFBundleIdentifier(); var plist_min_version = info_plist.GetPListStringValue("LSMinimumSystemVersion"); info_plist.SetPListStringValue("LSMinimumSystemVersion", GetMinimumOSVersion(plist_min_version)); inputProject.FixInfoPListInclude(Suffix); Harness.Save(info_plist, target_info_plist); }
void CreateTodayContainerProject() { var csproj = new XmlDocument(); var suffix = Suffix; csproj.LoadWithoutNetworkAccess(Path.Combine(Harness.TodayContainerTemplate, "TodayContainer.csproj")); csproj.SetOutputPath("bin\\$(Platform)\\$(Configuration)" + suffix, false); csproj.SetIntermediateOutputPath("obj\\$(Platform)\\$(Configuration)" + suffix); csproj.SetProjectReferenceValue("TodayExtension.csproj", "Name", Path.GetFileNameWithoutExtension(TodayExtensionProjectPath)); csproj.SetProjectReferenceValue("TodayExtension.csproj", "Project", TodayExtensionGuid); csproj.SetProjectReferenceInclude("TodayExtension.csproj", TodayExtensionProjectPath.Replace('/', '\\')); csproj.FixCompileInclude("Main.cs", Path.Combine(Harness.TodayContainerTemplate, "Main.cs").Replace('/', '\\')); csproj.FixInfoPListInclude(suffix); TodayContainerGuid = "{" + Harness.NewStableGuid().ToString().ToUpper() + "}"; ProjectGuid = TodayContainerGuid; csproj.SetProjectGuid(TodayContainerGuid); if (MonoNativeInfo != null) { MonoNativeInfo.AddProjectDefines(csproj); csproj.AddAdditionalDefines("MONO_NATIVE_TODAY"); } Harness.Save(csproj, TodayContainerProjectPath); XmlDocument info_plist = new XmlDocument(); var target_info_plist = Path.Combine(TargetDirectory, $"Info{suffix}.plist"); info_plist.LoadWithoutNetworkAccess(Path.Combine(Harness.TodayContainerTemplate, "Info.plist")); info_plist.SetCFBundleIdentifier(BundleIdentifier); info_plist.SetCFBundleName(Name); info_plist.SetMinimumOSVersion(GetMinimumOSVersion("8.0")); Harness.Save(info_plist, target_info_plist); }
void CreateTodayExtensionProject() { var csproj = inputProject; var suffix = Suffix + "-extension"; csproj.SetProjectTypeGuids("{EE2C853D-36AF-4FDB-B1AD-8E90477E2198};" + LanguageGuid); csproj.SetOutputPath("bin\\$(Platform)\\$(Configuration)" + suffix); csproj.SetIntermediateOutputPath("obj\\$(Platform)\\$(Configuration)" + suffix); csproj.SetImport(IsFSharp ? "$(MSBuildExtensionsPath)\\Xamarin\\iOS\\Xamarin.iOS.AppExtension.FSharp.targets" : "$(MSBuildExtensionsPath)\\Xamarin\\iOS\\Xamarin.iOS.AppExtension.CSharp.targets"); csproj.FixInfoPListInclude(suffix); csproj.SetOutputType("Library"); csproj.AddAdditionalDefines("XAMCORE_2_0;XAMCORE_3_0;TODAY_EXTENSION"); var ext = IsFSharp ? "fs" : "cs"; csproj.AddCompileInclude("TodayExtensionMain." + ext, Path.Combine(Harness.TodayExtensionTemplate, "TodayExtensionMain." + ext), true); csproj.AddInterfaceDefinition(Path.Combine(Harness.TodayExtensionTemplate, "TodayView.storyboard").Replace('/', '\\')); csproj.SetExtraLinkerDefs("extra-linker-defs" + ExtraLinkerDefsSuffix + ".xml"); csproj.FixProjectReferences("-today"); if (MonoNativeInfo != null) { MonoNativeInfo.AddProjectDefines(csproj); csproj.AddAdditionalDefines("MONO_NATIVE_TODAY"); } Harness.Save(csproj, TodayExtensionProjectPath); TodayExtensionGuid = csproj.GetProjectGuid(); XmlDocument info_plist = new XmlDocument(); var target_info_plist = Path.Combine(TargetDirectory, $"Info{suffix}.plist"); info_plist.LoadWithoutNetworkAccess(Path.Combine(TargetDirectory, "Info.plist")); BundleIdentifier = info_plist.GetCFBundleIdentifier() + "-today"; info_plist.SetCFBundleIdentifier(BundleIdentifier + ".todayextension"); info_plist.SetMinimumOSVersion(GetMinimumOSVersion("8.0")); info_plist.AddPListStringValue("CFBundlePackageType", "XPC!"); info_plist.SetCFBundleDisplayName(Name); info_plist.AddPListKeyValuePair("NSExtension", "dict", @" <key>NSExtensionMainStoryboard</key> <string>TodayView</string> <key>NSExtensionPointIdentifier</key> <string>com.apple.widget-extension</string> "); Harness.Save(info_plist, target_info_plist); }
protected override void ExecuteInternal() { if (MonoNativeInfo == null) { return; } MonoNativeInfo.AddProjectDefines(inputProject); inputProject.AddAdditionalDefines("MONO_NATIVE_IOS"); inputProject.FixInfoPListInclude(Suffix); inputProject.SetExtraLinkerDefs("extra-linker-defs" + ExtraLinkerDefsSuffix + ".xml"); Harness.Save(inputProject, ProjectPath); XmlDocument info_plist = new XmlDocument(); var target_info_plist = Path.Combine(TargetDirectory, "Info" + Suffix + ".plist"); info_plist.LoadWithoutNetworkAccess(Path.Combine(TargetDirectory, "Info.plist")); info_plist.SetMinimumOSVersion(GetMinimumOSVersion(info_plist.GetMinimumOSVersion())); Harness.Save(info_plist, target_info_plist); }
void AutoConfigureIOS() { var test_suites = new string [] { "monotouch-test", "framework-test", "mini", "interdependent-binding-projects" }; var library_projects = new string [] { "BundledResources", "EmbeddedResources", "bindings-test", "bindings-test2", "bindings-framework-test" }; var fsharp_test_suites = new string [] { "fsharp" }; var fsharp_library_projects = new string [] { "fsharplibrary" }; var bcl_suites = new string [] { "mscorlib", "System.Data", "System.Net.Http", "System.Web.Services", "System.Xml", "Mono.Data.Sqlite", "System.IO.Compression", "System.IO.Compression.FileSystem", "System.ServiceModel", "System.IdentityModel", }; var bcl_skip_watchos = new string [] { "Mono.Data.Tds", }; IOSTestProjects.Add(new iOSTestProject(Path.GetFullPath(Path.Combine(RootDirectory, "bcl-test/mscorlib/mscorlib-0.csproj")), false)); IOSTestProjects.Add(new iOSTestProject(Path.GetFullPath(Path.Combine(RootDirectory, "bcl-test/mscorlib/mscorlib-1.csproj")), false)); foreach (var p in test_suites) { IOSTestProjects.Add(new iOSTestProject(Path.GetFullPath(Path.Combine(RootDirectory, p + "/" + p + ".csproj"))) { Name = p }); } foreach (var p in fsharp_test_suites) { IOSTestProjects.Add(new iOSTestProject(Path.GetFullPath(Path.Combine(RootDirectory, p + "/" + p + ".fsproj"))) { Name = p }); } foreach (var p in library_projects) { IOSTestProjects.Add(new iOSTestProject(Path.GetFullPath(Path.Combine(RootDirectory, p + "/" + p + ".csproj")), false) { Name = p }); } foreach (var p in fsharp_library_projects) { IOSTestProjects.Add(new iOSTestProject(Path.GetFullPath(Path.Combine(RootDirectory, p + "/" + p + ".fsproj")), false) { Name = p }); } foreach (var p in bcl_suites) { BCLTestInfo bclTestInfo = new BCLTestInfo(this, p); IOSTestProjects.Add(new iOSTestProject(Path.GetFullPath(Path.Combine(RootDirectory, "bcl-test/" + p + "/" + p + ".csproj"))) { SkipwatchOSVariation = bcl_skip_watchos.Contains(p), BCLInfo = bclTestInfo, Name = p }); } IOSTestProjects.Add(new iOSTestProject(Path.GetFullPath(Path.Combine(RootDirectory, "introspection", "iOS", "introspection-ios.csproj"))) { Name = "introspection" }); IOSTestProjects.Add(new iOSTestProject(Path.GetFullPath(Path.Combine(RootDirectory, "linker", "ios", "dont link", "dont link.csproj"))) { Configurations = new string [] { "Debug", "Release" } }); IOSTestProjects.Add(new iOSTestProject(Path.GetFullPath(Path.Combine(RootDirectory, "linker", "ios", "link all", "link all.csproj"))) { Configurations = new string [] { "Debug", "Release" } }); IOSTestProjects.Add(new iOSTestProject(Path.GetFullPath(Path.Combine(RootDirectory, "linker", "ios", "link sdk", "link sdk.csproj"))) { Configurations = new string [] { "Debug", "Release" } }); foreach (var flavor in new MonoNativeFlavor[] { MonoNativeFlavor.Compat, MonoNativeFlavor.Unified }) { var monoNativeInfo = new MonoNativeInfo(this, flavor); var iosTestProject = new iOSTestProject(monoNativeInfo.ProjectPath, generateVariations: false) { MonoNativeInfo = monoNativeInfo, Name = monoNativeInfo.ProjectName }; IOSTestProjects.Add(iosTestProject); } // add all the tests that are using the precompiled mono assemblies var monoImportTestFactory = new BCLTestImportTargetFactory(this); IOSTestProjects.AddRange(monoImportTestFactory.GetiOSBclTargets()); WatchOSContainerTemplate = Path.GetFullPath(Path.Combine(RootDirectory, "templates/WatchContainer")); WatchOSAppTemplate = Path.GetFullPath(Path.Combine(RootDirectory, "templates/WatchApp")); WatchOSExtensionTemplate = Path.GetFullPath(Path.Combine(RootDirectory, "templates/WatchExtension")); TodayContainerTemplate = Path.GetFullPath(Path.Combine(RootDirectory, "templates", "TodayContainer")); TodayExtensionTemplate = Path.GetFullPath(Path.Combine(RootDirectory, "templates", "TodayExtension")); }