예제 #1
0
        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);
        }
예제 #2
0
        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);
        }
예제 #3
0
        protected override void PostProcessExecutableProject()
        {
            base.PostProcessExecutableProject();

            ProjectGuid = "{" + Harness.NewStableGuid().ToString().ToUpper() + "}";
            inputProject.SetProjectGuid(ProjectGuid);
        }