Пример #1
0
        public override void Convert()
        {
            var inputProject = new XmlDocument();

            var xml = File.ReadAllText(TemplatePath);

            xml = xml.Replace("#FILES#", GetFileList());
            inputProject.LoadXmlWithoutNetworkAccess(xml);

            switch (Flavor)
            {
            case MacFlavors.Modern:
                inputProject.SetTargetFrameworkIdentifier("Xamarin.Mac");
                inputProject.SetTargetFrameworkVersion("v2.0");
                inputProject.RemoveNode("UseXamMacFullFramework");
                inputProject.AddAdditionalDefines("MOBILE;XAMMAC");
                inputProject.AddReference("Mono.Security");
                break;

            case MacFlavors.Full:
                inputProject.AddAdditionalDefines("XAMMAC_4_5");
                break;

            default:
                throw new NotImplementedException(Flavor.ToString());
            }
            inputProject.SetOutputPath("bin\\$(Platform)\\$(Configuration)" + FlavorSuffix);
            inputProject.SetIntermediateOutputPath("obj\\$(Platform)\\$(Configuration)" + FlavorSuffix);
            inputProject.SetAssemblyName(inputProject.GetAssemblyName() + FlavorSuffix);

            Harness.Save(inputProject, ProjectPath);
        }
        public override void Convert()
        {
            var inputProject = new XmlDocument();

            var xml = File.ReadAllText(TemplatePath);

            xml = xml.Replace("#FILES#", GetFileList());
            inputProject.LoadXmlWithoutNetworkAccess(xml);

            // The csproj template is Xamarin.Mac/Full, so make it Modern instead
            inputProject.SetTargetFrameworkIdentifier("Xamarin.Mac");
            inputProject.SetTargetFrameworkVersion("v2.0");
            inputProject.RemoveNode("UseXamMacFullFramework");
            inputProject.AddAdditionalDefines("MOBILE;XAMMAC");
            inputProject.AddReference("Mono.Security");

            Harness.Save(inputProject, ProjectPath);
        }
Пример #3
0
        protected override void Convert(XmlDocument inputProject)
        {
            switch (MacFlavor)
            {
            case MacFlavors.Modern:
                inputProject.SetTargetFrameworkIdentifier("Xamarin.Mac");
                inputProject.SetTargetFrameworkVersion("v2.0");
                inputProject.RemoveNode("UseXamMacFullFramework");
                inputProject.AddAdditionalDefines("MOBILE;XAMMAC");
                inputProject.AddReference("Mono.Security");
                break;

            case MacFlavors.Full:
                inputProject.AddAdditionalDefines("XAMMAC_4_5");
                break;
            }

            base.Convert(inputProject);
        }