Пример #1
0
        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);
        }
Пример #2
0
        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);
        }
Пример #3
0
        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);
        }
Пример #4
0
        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);
        }