void CreateWatchOSContainerProject() { var csproj = new XmlDocument(); csproj.LoadWithoutNetworkAccess(Path.Combine(Harness.WatchOSContainerTemplate, "Container.csproj")); csproj.FindAndReplace("%CONTAINER_PATH%", Path.GetFullPath(Harness.WatchOSContainerTemplate).Replace('/', '\\') + "\\"); csproj.FindAndReplace("%WATCHAPP_CSPROJ%", Path.GetFileName(WatchOSAppProjectPath)); csproj.SetProjectReferenceValue(Path.GetFileName(WatchOSAppProjectPath), "Name", Path.GetFileNameWithoutExtension(WatchOSAppProjectPath)); WatchOSGuid = "{" + Harness.NewStableGuid().ToString().ToUpper() + "}"; csproj.SetProjectGuid(WatchOSGuid); csproj.FixInfoPListInclude(Suffix); if (MonoNativeInfo != null) { csproj.AddAdditionalDefines("MONO_NATIVE_WATCH"); MonoNativeHelper.AddProjectDefines(csproj, MonoNativeInfo.Flavor); MonoNativeHelper.RemoveSymlinkMode(csproj); } Harness.Save(csproj, WatchOSProjectPath); XmlDocument info_plist = new XmlDocument(); var target_info_plist = Path.Combine(TargetDirectory, $"Info{Suffix}.plist"); info_plist.LoadWithoutNetworkAccess(Path.Combine(Harness.WatchOSContainerTemplate, "Info.plist")); info_plist.SetCFBundleIdentifier(BundleIdentifier); info_plist.SetCFBundleName(Name); info_plist.SetMinimumOSVersion("9.0"); Harness.Save(info_plist, target_info_plist); }
void CreateWatchOSAppProject() { var csproj = new XmlDocument(); var suffix = Suffix + "-app"; csproj.LoadWithoutNetworkAccess(Path.Combine(Harness.WatchOSAppTemplate, "App.csproj")); csproj.FindAndReplace("%WATCHAPP_PATH%", Path.GetFullPath(Harness.WatchOSAppTemplate).Replace('/', '\\') + "\\"); csproj.FindAndReplace("%WATCHEXTENSION_CSPROJ%", Path.GetFileName(WatchOSExtensionProjectPath)); csproj.SetProjectReferenceValue(Path.GetFileName(WatchOSExtensionProjectPath), "Project", WatchOSExtensionGuid); csproj.SetProjectReferenceValue(Path.GetFileName(WatchOSExtensionProjectPath), "Name", Path.GetFileNameWithoutExtension(WatchOSExtensionProjectPath)); WatchOSAppGuid = "{" + Harness.NewStableGuid().ToString().ToUpper() + "}"; csproj.SetProjectGuid(WatchOSAppGuid); csproj.FixInfoPListInclude(suffix); if (MonoNativeInfo != null) { csproj.AddAdditionalDefines("MONO_NATIVE_WATCH"); MonoNativeHelper.AddProjectDefines(csproj, MonoNativeInfo.Flavor); MonoNativeHelper.RemoveSymlinkMode(csproj); } Harness.Save(csproj, WatchOSAppProjectPath); XmlDocument info_plist = new XmlDocument(); var target_info_plist = Path.Combine(TargetDirectory, $"Info{Suffix}-app.plist"); info_plist.LoadWithoutNetworkAccess(Path.Combine(Harness.WatchOSAppTemplate, "Info.plist")); info_plist.SetCFBundleIdentifier(BundleIdentifier + ".watchkitapp"); info_plist.SetPListStringValue("WKCompanionAppBundleIdentifier", BundleIdentifier); info_plist.SetPListStringValue("CFBundleName", Name); info_plist.SetMinimumOSVersion(GetMinimumOSVersion(info_plist.GetMinimumOSVersion())); Harness.Save(info_plist, target_info_plist); }
protected void CreateExecutableProject() { ProcessProject(); if (Harness.Mac) { ProjectGuid = "{" + Harness.NewStableGuid().ToString().ToUpper() + "}"; inputProject.SetProjectGuid(ProjectGuid); } else { inputProject.FixArchitectures(SimulatorArchitectures, DeviceArchitectures); inputProject.FixInfoPListInclude(Suffix); inputProject.SetExtraLinkerDefs("extra-linker-defs" + Suffix + ".xml"); } Harness.Save(inputProject, ProjectPath); if (!Harness.Mac) { ProjectGuid = inputProject.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(); info_plist.SetMinimumOSVersion(GetMinimumOSVersion(info_plist.GetMinimumOSVersion())); info_plist.SetUIDeviceFamily(UIDeviceFamily); Harness.Save(info_plist, target_info_plist); } }
void CreateTodayContainerProject() { var csproj = new XmlDocument(); var suffix = "-today"; 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); Harness.Save(csproj, TodayContainerProjectPath); XmlDocument info_plist = new XmlDocument(); var target_info_plist = Path.Combine(TargetDirectory, "Info-today.plist"); info_plist.LoadWithoutNetworkAccess(Path.Combine(Harness.TodayContainerTemplate, "Info.plist")); info_plist.SetCFBundleIdentifier(BundleIdentifier); info_plist.SetCFBundleName(Name); info_plist.SetMinimumOSVersion("6.0"); Harness.Save(info_plist, target_info_plist); }
protected override void PostProcessExecutableProject() { base.PostProcessExecutableProject(); ProjectGuid = "{" + Harness.NewStableGuid().ToString().ToUpper() + "}"; inputProject.SetProjectGuid(ProjectGuid); }
void CreateWatchOSContainerProject() { var csproj = new XmlDocument(); csproj.LoadWithoutNetworkAccess(Path.Combine(Harness.WatchOSContainerTemplate, "Container.csproj")); csproj.FindAndReplace("%CONTAINER_PATH%", Path.GetFullPath(Harness.WatchOSContainerTemplate).Replace('/', '\\') + "\\"); csproj.FindAndReplace("%WATCHAPP_CSPROJ%", Path.GetFileName(WatchOSAppProjectPath)); csproj.SetProjectReferenceValue(Path.GetFileName(WatchOSAppProjectPath), "Name", Path.GetFileNameWithoutExtension(WatchOSAppProjectPath)); WatchOSGuid = "{" + Harness.NewStableGuid().ToString().ToUpper() + "}"; csproj.SetProjectGuid(WatchOSGuid); Harness.Save(csproj, WatchOSProjectPath); XmlDocument info_plist = new XmlDocument(); var target_info_plist = Path.Combine(TargetDirectory, "Info-watchos.plist"); info_plist.LoadWithoutNetworkAccess(Path.Combine(Harness.WatchOSContainerTemplate, "Info.plist")); info_plist.SetCFBundleIdentifier(BundleIdentifier); info_plist.SetCFBundleName(Name); Harness.Save(info_plist, target_info_plist); }
void CreateWatchOSAppProject() { var csproj = new XmlDocument(); csproj.LoadWithoutNetworkAccess(Path.Combine(Harness.WatchOSAppTemplate, "App.csproj")); csproj.FindAndReplace("%WATCHAPP_PATH%", Path.GetFullPath(Harness.WatchOSAppTemplate).Replace('/', '\\') + "\\"); csproj.FindAndReplace("%WATCHEXTENSION_CSPROJ%", Path.GetFileName(WatchOSExtensionProjectPath)); csproj.SetProjectReferenceValue(Path.GetFileName(WatchOSExtensionProjectPath), "Project", WatchOSExtensionGuid); csproj.SetProjectReferenceValue(Path.GetFileName(WatchOSExtensionProjectPath), "Name", Path.GetFileNameWithoutExtension(WatchOSExtensionProjectPath)); WatchOSAppGuid = "{" + Harness.NewStableGuid().ToString().ToUpper() + "}"; csproj.SetProjectGuid(WatchOSAppGuid); Harness.Save(csproj, WatchOSAppProjectPath); XmlDocument info_plist = new XmlDocument(); var target_info_plist = Path.Combine(TargetDirectory, "Info-watchos-app.plist"); info_plist.LoadWithoutNetworkAccess(Path.Combine(Harness.WatchOSAppTemplate, "Info.plist")); info_plist.SetCFBundleIdentifier(BundleIdentifier + ".watchkitapp"); info_plist.SetPListStringValue("WKCompanionAppBundleIdentifier", BundleIdentifier); info_plist.SetPListStringValue("CFBundleName", Name); Harness.Save(info_plist, target_info_plist); }