Exemple #1
0
        /// <summary>
        /// Registers the solution platforms supported by Paradox.
        /// </summary>
        internal static void RegisterSolutionPlatforms()
        {
            var solutionPlatforms = new List<SolutionPlatform>();

            // Windows
            var windowsPlatform = new SolutionPlatform()
                {
                    Name = PlatformType.Windows.ToString(),
                    IsAvailable = true,
                    Alias = "Any CPU",
                    Type = PlatformType.Windows
                };
            windowsPlatform.PlatformsPart.Add(new SolutionPlatformPart("Any CPU") { InheritConfigurations = true });
            windowsPlatform.PlatformsPart.Add(new SolutionPlatformPart("Mixed Platforms") { Alias = "Any CPU"});
            windowsPlatform.DefineConstants.Add("SILICONSTUDIO_PLATFORM_WINDOWS");
            windowsPlatform.DefineConstants.Add("SILICONSTUDIO_PLATFORM_WINDOWS_DESKTOP");
            windowsPlatform.Configurations.Add(new SolutionConfiguration("Testing"));
            windowsPlatform.Configurations.Add(new SolutionConfiguration("AppStore"));

            foreach (var part in windowsPlatform.PlatformsPart)
            {
                part.Configurations.Clear();
                part.Configurations.AddRange(windowsPlatform.Configurations);
            }
            solutionPlatforms.Add(windowsPlatform);

            // Windows Store
            var windowsStorePlatform = new SolutionPlatform()
            {
                Name = PlatformType.WindowsStore.ToString(),
                DisplayName = "Windows Store",
                Type = PlatformType.WindowsStore,
                IsAvailable = WindowsRuntimeBuild.Any(IsFileInProgramFilesx86Exist),
                UseWithExecutables = false,
                IncludeInSolution = false,
            };

            windowsStorePlatform.DefineConstants.Add("SILICONSTUDIO_PLATFORM_WINDOWS");
            windowsStorePlatform.DefineConstants.Add("SILICONSTUDIO_PLATFORM_WINDOWS_RUNTIME");
            windowsStorePlatform.DefineConstants.Add("SILICONSTUDIO_PLATFORM_WINDOWS_STORE");
            windowsStorePlatform.Configurations.Add(new SolutionConfiguration("Testing"));
            windowsStorePlatform.Configurations.Add(new SolutionConfiguration("AppStore"));
            windowsStorePlatform.Configurations["Release"].Properties.Add("<NoWarn>;2008</NoWarn>");
            windowsStorePlatform.Configurations["Debug"].Properties.Add("<NoWarn>;2008</NoWarn>");
            windowsStorePlatform.Configurations["Testing"].Properties.Add("<NoWarn>;2008</NoWarn>");
            windowsStorePlatform.Configurations["AppStore"].Properties.Add("<NoWarn>;2008</NoWarn>");

            foreach (var cpu in new[] { "x86", "x64", "ARM" })
            {
                var windowsStorePlatformCpu = new SolutionPlatformPart(windowsStorePlatform.Name + "-" + cpu)
                {
                    LibraryProjectName = windowsStorePlatform.Name,
                    ExecutableProjectName = cpu,
                    Cpu = cpu,
                    InheritConfigurations = true,
                    UseWithLibraries = false,
                    UseWithExecutables = true,
                };
                windowsStorePlatformCpu.Configurations.Clear();
                windowsStorePlatformCpu.Configurations.AddRange(windowsStorePlatform.Configurations);

                windowsStorePlatform.PlatformsPart.Add(windowsStorePlatformCpu);
            }

            solutionPlatforms.Add(windowsStorePlatform);

            // Windows 10
            var windows10Platform = new SolutionPlatform()
            {
                Name = PlatformType.Windows10.ToString(),
                DisplayName = "Windows 10",
                Type = PlatformType.Windows10,
                IsAvailable = IsFileInProgramFilesx86Exist(Windows10UniversalRuntimeBuild),
                UseWithExecutables = false,
                IncludeInSolution = false,
            };

            windows10Platform.DefineConstants.Add("SILICONSTUDIO_PLATFORM_WINDOWS");
            windows10Platform.DefineConstants.Add("SILICONSTUDIO_PLATFORM_WINDOWS_RUNTIME");
            windows10Platform.DefineConstants.Add("SILICONSTUDIO_PLATFORM_WINDOWS_10");
            windows10Platform.Configurations.Add(new SolutionConfiguration("Testing"));
            windows10Platform.Configurations.Add(new SolutionConfiguration("AppStore"));
            windows10Platform.Configurations["Release"].Properties.Add("<NoWarn>;2008</NoWarn>");
            windows10Platform.Configurations["Debug"].Properties.Add("<NoWarn>;2008</NoWarn>");
            windows10Platform.Configurations["Testing"].Properties.Add("<NoWarn>;2008</NoWarn>");
            windows10Platform.Configurations["AppStore"].Properties.Add("<NoWarn>;2008</NoWarn>");

            windows10Platform.Configurations["Release"].Properties.Add("<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>");
            windows10Platform.Configurations["Testing"].Properties.Add("<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>");
            windows10Platform.Configurations["AppStore"].Properties.Add("<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>");

            foreach (var cpu in new[] { "x86", "x64", "ARM" })
            {
                var windows10PlatformCpu = new SolutionPlatformPart(windows10Platform.Name + "-" + cpu)
                {
                    LibraryProjectName = windows10Platform.Name,
                    ExecutableProjectName = cpu,
                    Cpu = cpu,
                    InheritConfigurations = true,
                    UseWithLibraries = false,
                    UseWithExecutables = true,
                };
                windows10PlatformCpu.Configurations.Clear();
                windows10PlatformCpu.Configurations.AddRange(windows10Platform.Configurations);

                windows10Platform.PlatformsPart.Add(windows10PlatformCpu);
            }

            solutionPlatforms.Add(windows10Platform);

            // Windows Phone
            var windowsPhonePlatform = new SolutionPlatform()
            {
                Name = PlatformType.WindowsPhone.ToString(),
                DisplayName = "Windows Phone",
                Type = PlatformType.WindowsPhone,
                IsAvailable = WindowsRuntimeBuild.Any(IsFileInProgramFilesx86Exist),
                UseWithExecutables = false,
                IncludeInSolution = false,
            };

            windowsPhonePlatform.DefineConstants.Add("SILICONSTUDIO_PLATFORM_WINDOWS");
            windowsPhonePlatform.DefineConstants.Add("SILICONSTUDIO_PLATFORM_WINDOWS_RUNTIME");
            windowsPhonePlatform.DefineConstants.Add("SILICONSTUDIO_PLATFORM_WINDOWS_PHONE");
            windowsPhonePlatform.Configurations.Add(new SolutionConfiguration("Testing"));
            windowsPhonePlatform.Configurations.Add(new SolutionConfiguration("AppStore"));

            windowsPhonePlatform.Configurations["Release"].Properties.Add("<NoWarn>;2008</NoWarn>");
            windowsPhonePlatform.Configurations["Debug"].Properties.Add("<NoWarn>;2008</NoWarn>");
            windowsPhonePlatform.Configurations["Testing"].Properties.Add("<NoWarn>;2008</NoWarn>");
            windowsPhonePlatform.Configurations["AppStore"].Properties.Add("<NoWarn>;2008</NoWarn>");

            foreach (var cpu in new[] { "x86", "ARM" })
            {
                var windowsPhonePlatformCpu = new SolutionPlatformPart(windowsPhonePlatform.Name + "-" + cpu)
                {
                    LibraryProjectName = windowsPhonePlatform.Name,
                    ExecutableProjectName = cpu,
                    Cpu = cpu,
                    InheritConfigurations = true,
                    UseWithLibraries = false,
                    UseWithExecutables = true
                };
                windowsPhonePlatformCpu.Configurations.Clear();
                windowsPhonePlatformCpu.Configurations.AddRange(windowsPhonePlatform.Configurations);

                windowsPhonePlatform.PlatformsPart.Add(windowsPhonePlatformCpu);
            }

            solutionPlatforms.Add(windowsPhonePlatform);

            // Android
            var androidPlatform = new SolutionPlatform()
            {
                Name = PlatformType.Android.ToString(),
                Type = PlatformType.Android,
                IsAvailable = IsFileInProgramFilesx86Exist(XamarinAndroidBuild)
            };
            androidPlatform.DefineConstants.Add("SILICONSTUDIO_PLATFORM_MONO");
            androidPlatform.DefineConstants.Add("SILICONSTUDIO_PLATFORM_MONO_MOBILE");
            androidPlatform.DefineConstants.Add("SILICONSTUDIO_PLATFORM_ANDROID");
            androidPlatform.Configurations.Add(new SolutionConfiguration("Testing"));
            androidPlatform.Configurations.Add(new SolutionConfiguration("AppStore"));
            androidPlatform.Configurations["Debug"].Properties.AddRange(new[]
                {
                    "<AndroidUseSharedRuntime>True</AndroidUseSharedRuntime>",
                    "<AndroidLinkMode>None</AndroidLinkMode>",
                });
            androidPlatform.Configurations["Release"].Properties.AddRange(new[]
                {
                    "<AndroidUseSharedRuntime>False</AndroidUseSharedRuntime>",
                    "<AndroidLinkMode>SdkOnly</AndroidLinkMode>",
                });
            androidPlatform.Configurations["Testing"].Properties.AddRange(androidPlatform.Configurations["Release"].Properties);
            androidPlatform.Configurations["AppStore"].Properties.AddRange(androidPlatform.Configurations["Release"].Properties);
            solutionPlatforms.Add(androidPlatform);

            // iOS: iPhone
            var iphonePlatform = new SolutionPlatform()
            {
                Name = PlatformType.iOS.ToString(),
                SolutionName = "iPhone", // For iOS, we need to use iPhone as a solution name
                Type = PlatformType.iOS,
                IsAvailable = IsFileInProgramFilesx86Exist(XamariniOSBuild)
            };
            iphonePlatform.PlatformsPart.Add(new SolutionPlatformPart("iPhoneSimulator"));
            iphonePlatform.DefineConstants.Add("SILICONSTUDIO_PLATFORM_MONO");
            iphonePlatform.DefineConstants.Add("SILICONSTUDIO_PLATFORM_MONO_MOBILE");
            iphonePlatform.DefineConstants.Add("SILICONSTUDIO_PLATFORM_IOS");
            iphonePlatform.Configurations.Add(new SolutionConfiguration("Testing"));
            iphonePlatform.Configurations.Add(new SolutionConfiguration("AppStore"));
            var iPhoneCommonProperties = new List<string>
                {
                    "<ConsolePause>false</ConsolePause>",
                    "<MtouchUseSGen>True</MtouchUseSGen>",
                    "<MtouchArch>ARMv7, ARMv7s, ARM64</MtouchArch>"
                };

            iphonePlatform.Configurations["Debug"].Properties.AddRange(iPhoneCommonProperties);
            iphonePlatform.Configurations["Debug"].Properties.AddRange(new []
                {
                    "<MtouchDebug>True</MtouchDebug>",
                    "<CodesignKey>iPhone Developer</CodesignKey>",
                    "<MtouchUseSGen>True</MtouchUseSGen>",
                });
            iphonePlatform.Configurations["Release"].Properties.AddRange(iPhoneCommonProperties);
            iphonePlatform.Configurations["Release"].Properties.AddRange(new[]
                {
                    "<CodesignKey>iPhone Developer</CodesignKey>",
                });
            iphonePlatform.Configurations["Testing"].Properties.AddRange(iPhoneCommonProperties);
            iphonePlatform.Configurations["Testing"].Properties.AddRange(new[]
                {
                    "<MtouchDebug>True</MtouchDebug>",
                    "<CodesignKey>iPhone Distribution</CodesignKey>",
                    "<BuildIpa>True</BuildIpa>",
                });
            iphonePlatform.Configurations["AppStore"].Properties.AddRange(iPhoneCommonProperties);
            iphonePlatform.Configurations["AppStore"].Properties.AddRange(new[]
                {
                    "<CodesignKey>iPhone Distribution</CodesignKey>",
                });
            solutionPlatforms.Add(iphonePlatform);

            // iOS: iPhoneSimulator
            var iPhoneSimulatorPlatform = iphonePlatform.PlatformsPart["iPhoneSimulator"];
            iPhoneSimulatorPlatform.Configurations["Debug"].Properties.AddRange(new[]
                {
                    "<MtouchDebug>True</MtouchDebug>",
                    "<MtouchLink>None</MtouchLink>",
                    "<MtouchArch>i386, x86_64</MtouchArch>"
                });
            iPhoneSimulatorPlatform.Configurations["Release"].Properties.AddRange(new[]
                {
                    "<MtouchLink>None</MtouchLink>",
                    "<MtouchArch>i386, x86_64</MtouchArch>"
                });

            AssetRegistry.RegisterSupportedPlatforms(solutionPlatforms);
        }
Exemple #2
0
        /// <summary>
        /// Registers the solution platforms supported by Xenko.
        /// </summary>
        internal static void RegisterSolutionPlatforms()
        {
            var solutionPlatforms = new List <SolutionPlatform>();

            // Windows
            var windowsPlatform = new SolutionPlatform()
            {
                Name            = PlatformType.Windows.ToString(),
                IsAvailable     = true,
                Alias           = "Any CPU",
                TargetFramework = "net461",
                Type            = PlatformType.Windows
            };

            windowsPlatform.PlatformsPart.Add(new SolutionPlatformPart("Any CPU"));
            windowsPlatform.PlatformsPart.Add(new SolutionPlatformPart("Mixed Platforms")
            {
                Alias = "Any CPU"
            });
            windowsPlatform.DefineConstants.Add("XENKO_PLATFORM_WINDOWS");
            windowsPlatform.DefineConstants.Add("XENKO_PLATFORM_WINDOWS_DESKTOP");
            windowsPlatform.Configurations.Add(new SolutionConfiguration("Testing"));
            windowsPlatform.Configurations.Add(new SolutionConfiguration("AppStore"));

            // Currently disabled
            //windowsPlatform.Configurations.Add(coreClrDebug);
            //windowsPlatform.Configurations.Add(coreClrRelease);
            foreach (var part in windowsPlatform.PlatformsPart)
            {
                part.Configurations.Clear();
                part.Configurations.AddRange(windowsPlatform.Configurations);
            }
            solutionPlatforms.Add(windowsPlatform);

            // Universal Windows Platform (UWP)
            var uwpPlatform = new SolutionPlatform()
            {
                Name            = PlatformType.UWP.ToString(),
                Type            = PlatformType.UWP,
                TargetFramework = "uap10.0.16299",
                Templates       =
                {
                    //new SolutionPlatformTemplate("ProjectExecutable.UWP/CoreWindow/ProjectExecutable.UWP.ttproj", "Core Window"),
                    new SolutionPlatformTemplate("ProjectExecutable.UWP/Xaml/ProjectExecutable.UWP.ttproj", "Xaml")
                },
                IsAvailable        = IsVSComponentAvailableAnyVersion(UniversalWindowsPlatformComponents),
                UseWithExecutables = false,
                IncludeInSolution  = false,
            };

            uwpPlatform.DefineConstants.Add("XENKO_PLATFORM_WINDOWS");
            uwpPlatform.DefineConstants.Add("XENKO_PLATFORM_UWP");
            uwpPlatform.Configurations.Add(new SolutionConfiguration("Testing"));
            uwpPlatform.Configurations.Add(new SolutionConfiguration("AppStore"));
            uwpPlatform.Configurations["Release"].Properties.Add("<NoWarn>;2008</NoWarn>");
            uwpPlatform.Configurations["Debug"].Properties.Add("<NoWarn>;2008</NoWarn>");
            uwpPlatform.Configurations["Testing"].Properties.Add("<NoWarn>;2008</NoWarn>");
            uwpPlatform.Configurations["AppStore"].Properties.Add("<NoWarn>;2008</NoWarn>");

            uwpPlatform.Configurations["Release"].Properties.Add("<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>");
            uwpPlatform.Configurations["Testing"].Properties.Add("<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>");
            uwpPlatform.Configurations["AppStore"].Properties.Add("<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>");

            foreach (var cpu in new[] { "x86", "x64", "ARM" })
            {
                var uwpPlatformCpu = new SolutionPlatformPart(uwpPlatform.Name + "-" + cpu)
                {
                    LibraryProjectName    = uwpPlatform.Name,
                    ExecutableProjectName = cpu,
                    Cpu = cpu,
                    InheritConfigurations = true,
                    UseWithLibraries      = false,
                    UseWithExecutables    = true,
                };
                uwpPlatformCpu.Configurations.Clear();
                uwpPlatformCpu.Configurations.AddRange(uwpPlatform.Configurations);

                uwpPlatform.PlatformsPart.Add(uwpPlatformCpu);
            }

            solutionPlatforms.Add(uwpPlatform);

            // Linux
            // Note: Linux is using a target framework that will be used for other platforms. We will need to use multiple runtime identifiers later
            var linuxPlatform = new SolutionPlatform()
            {
                Name              = PlatformType.Linux.ToString(),
                IsAvailable       = true,
                TargetFramework   = "netcoreapp2.1",
                RuntimeIdentifier = "linux-x64",
                Type              = PlatformType.Linux,
            };

            linuxPlatform.DefineConstants.Add("XENKO_PLATFORM_UNIX");
            linuxPlatform.DefineConstants.Add("XENKO_PLATFORM_LINUX");
            solutionPlatforms.Add(linuxPlatform);

#if FALSE   // Disabling macOS for time being
            // macOS
            var macOSPlatform = new SolutionPlatform()
            {
                Name            = PlatformType.macOS.ToString(),
                IsAvailable     = true,
                TargetFramework = "net461",
                Type            = PlatformType.macOS,
            };
            macOSPlatform.DefineConstants.Add("XENKO_PLATFORM_UNIX");
            macOSPlatform.DefineConstants.Add("XENKO_PLATFORM_MACOS");
            macOSPlatform.Configurations.Add(coreClrRelease);
            macOSPlatform.Configurations.Add(coreClrDebug);
            solutionPlatforms.Add(macOSPlatform);
#endif
            // Android
            var androidPlatform = new SolutionPlatform()
            {
                Name            = PlatformType.Android.ToString(),
                Type            = PlatformType.Android,
                TargetFramework = "monoandroid81",
                IsAvailable     = IsVSComponentAvailableAnyVersion(XamarinAndroidComponents)
            };
            androidPlatform.DefineConstants.Add("XENKO_PLATFORM_MONO_MOBILE");
            androidPlatform.DefineConstants.Add("XENKO_PLATFORM_ANDROID");
            androidPlatform.Configurations.Add(new SolutionConfiguration("Testing"));
            androidPlatform.Configurations.Add(new SolutionConfiguration("AppStore"));
            androidPlatform.Configurations["Debug"].Properties.AddRange(new[]
            {
                "<AndroidUseSharedRuntime>True</AndroidUseSharedRuntime>",
                "<AndroidLinkMode>None</AndroidLinkMode>",
            });
            androidPlatform.Configurations["Release"].Properties.AddRange(new[]
            {
                "<AndroidUseSharedRuntime>False</AndroidUseSharedRuntime>",
                "<AndroidLinkMode>SdkOnly</AndroidLinkMode>",
            });
            androidPlatform.Configurations["Testing"].Properties.AddRange(androidPlatform.Configurations["Release"].Properties);
            androidPlatform.Configurations["AppStore"].Properties.AddRange(androidPlatform.Configurations["Release"].Properties);
            solutionPlatforms.Add(androidPlatform);

            // iOS: iPhone
            var iphonePlatform = new SolutionPlatform()
            {
                Name            = PlatformType.iOS.ToString(),
                SolutionName    = "iPhone", // For iOS, we need to use iPhone as a solution name
                Type            = PlatformType.iOS,
                TargetFramework = "xamarinios10",
                IsAvailable     = IsVSComponentAvailableAnyVersion(XamariniOSComponents)
            };
            iphonePlatform.PlatformsPart.Add(new SolutionPlatformPart("iPhoneSimulator"));
            iphonePlatform.DefineConstants.Add("XENKO_PLATFORM_MONO_MOBILE");
            iphonePlatform.DefineConstants.Add("XENKO_PLATFORM_IOS");
            iphonePlatform.Configurations.Add(new SolutionConfiguration("Testing"));
            iphonePlatform.Configurations.Add(new SolutionConfiguration("AppStore"));
            var iPhoneCommonProperties = new List <string>
            {
                "<ConsolePause>false</ConsolePause>",
                "<MtouchUseSGen>True</MtouchUseSGen>",
                "<MtouchArch>ARMv7, ARMv7s, ARM64</MtouchArch>"
            };

            iphonePlatform.Configurations["Debug"].Properties.AddRange(iPhoneCommonProperties);
            iphonePlatform.Configurations["Debug"].Properties.AddRange(new []
            {
                "<MtouchDebug>True</MtouchDebug>",
                "<CodesignKey>iPhone Developer</CodesignKey>",
                "<MtouchUseSGen>True</MtouchUseSGen>",
            });
            iphonePlatform.Configurations["Release"].Properties.AddRange(iPhoneCommonProperties);
            iphonePlatform.Configurations["Release"].Properties.AddRange(new[]
            {
                "<CodesignKey>iPhone Developer</CodesignKey>",
            });
            iphonePlatform.Configurations["Testing"].Properties.AddRange(iPhoneCommonProperties);
            iphonePlatform.Configurations["Testing"].Properties.AddRange(new[]
            {
                "<MtouchDebug>True</MtouchDebug>",
                "<CodesignKey>iPhone Distribution</CodesignKey>",
                "<BuildIpa>True</BuildIpa>",
            });
            iphonePlatform.Configurations["AppStore"].Properties.AddRange(iPhoneCommonProperties);
            iphonePlatform.Configurations["AppStore"].Properties.AddRange(new[]
            {
                "<CodesignKey>iPhone Distribution</CodesignKey>",
            });
            solutionPlatforms.Add(iphonePlatform);

            // iOS: iPhoneSimulator
            var iPhoneSimulatorPlatform = iphonePlatform.PlatformsPart["iPhoneSimulator"];
            iPhoneSimulatorPlatform.Configurations["Debug"].Properties.AddRange(new[]
            {
                "<MtouchDebug>True</MtouchDebug>",
                "<MtouchLink>None</MtouchLink>",
                "<MtouchArch>i386, x86_64</MtouchArch>"
            });
            iPhoneSimulatorPlatform.Configurations["Release"].Properties.AddRange(new[]
            {
                "<MtouchLink>None</MtouchLink>",
                "<MtouchArch>i386, x86_64</MtouchArch>"
            });

            AssetRegistry.RegisterSupportedPlatforms(solutionPlatforms);
        }
        /// <summary>
        /// Registers the solution platforms supported by Xenko.
        /// </summary>
        internal static void RegisterSolutionPlatforms()
        {
            var solutionPlatforms = new List<SolutionPlatform>();

            // Define CoreCLR configurations
            var coreClrRelease = new SolutionConfiguration("CoreCLR_Release");
            var coreClrDebug = new SolutionConfiguration("CoreCLR_Debug");
            coreClrDebug.IsDebug = true;
            // Add CoreCLR specific properties
            coreClrDebug.Properties.AddRange(new[]
            {
                "<SiliconStudioRuntime Condition=\"'$(SiliconStudioProjectType)' == 'Executable'\">CoreCLR</SiliconStudioRuntime>",
                "<SiliconStudioBuildDirExtension Condition=\"'$(SiliconStudioBuildDirExtension)' == ''\">CoreCLR</SiliconStudioBuildDirExtension>",
                "<DefineConstants>SILICONSTUDIO_RUNTIME_CORECLR;$(DefineConstants)</DefineConstants>"
            });
            coreClrRelease.Properties.AddRange(new[]
            {
                "<SiliconStudioRuntime Condition=\"'$(SiliconStudioProjectType)' == 'Executable'\">CoreCLR</SiliconStudioRuntime>",
                "<SiliconStudioBuildDirExtension Condition=\"'$(SiliconStudioBuildDirExtension)' == ''\">CoreCLR</SiliconStudioBuildDirExtension>",
                "<DefineConstants>SILICONSTUDIO_RUNTIME_CORECLR;$(DefineConstants)</DefineConstants>"
            });

            // Windows
            var windowsPlatform = new SolutionPlatform()
                {
                    Name = PlatformType.Windows.ToString(),
                    IsAvailable = true,
                    Alias = "Any CPU",
                    Type = PlatformType.Windows
                };
            windowsPlatform.PlatformsPart.Add(new SolutionPlatformPart("Any CPU"));
            windowsPlatform.PlatformsPart.Add(new SolutionPlatformPart("Mixed Platforms") { Alias = "Any CPU"});
            windowsPlatform.DefineConstants.Add("SILICONSTUDIO_PLATFORM_WINDOWS");
            windowsPlatform.DefineConstants.Add("SILICONSTUDIO_PLATFORM_WINDOWS_DESKTOP");
            windowsPlatform.Configurations.Add(new SolutionConfiguration("Testing"));
            windowsPlatform.Configurations.Add(new SolutionConfiguration("AppStore"));
            windowsPlatform.Configurations.Add(coreClrDebug);
            windowsPlatform.Configurations.Add(coreClrRelease);
            foreach (var part in windowsPlatform.PlatformsPart)
            {
                part.Configurations.Clear();
                part.Configurations.AddRange(windowsPlatform.Configurations);
            }
            solutionPlatforms.Add(windowsPlatform);

            // Universal Windows Platform (UWP)
            var uwpPlatform = new SolutionPlatform()
            {
                Name = PlatformType.UWP.ToString(),
                Type = PlatformType.UWP,
                IsAvailable = IsFileInProgramFilesx86Exist(UniversalWindowsPlatformRuntimeBuild),
                UseWithExecutables = false,
                IncludeInSolution = false,
            };

            uwpPlatform.DefineConstants.Add("SILICONSTUDIO_PLATFORM_WINDOWS");
            uwpPlatform.DefineConstants.Add("SILICONSTUDIO_PLATFORM_UWP");
            uwpPlatform.Configurations.Add(new SolutionConfiguration("Testing"));
            uwpPlatform.Configurations.Add(new SolutionConfiguration("AppStore"));
            uwpPlatform.Configurations["Release"].Properties.Add("<NoWarn>;2008</NoWarn>");
            uwpPlatform.Configurations["Debug"].Properties.Add("<NoWarn>;2008</NoWarn>");
            uwpPlatform.Configurations["Testing"].Properties.Add("<NoWarn>;2008</NoWarn>");
            uwpPlatform.Configurations["AppStore"].Properties.Add("<NoWarn>;2008</NoWarn>");

            uwpPlatform.Configurations["Release"].Properties.Add("<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>");
            uwpPlatform.Configurations["Testing"].Properties.Add("<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>");
            uwpPlatform.Configurations["AppStore"].Properties.Add("<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>");

            foreach (var cpu in new[] { "x86", "x64", "ARM" })
            {
                var uwpPlatformCpu = new SolutionPlatformPart(uwpPlatform.Name + "-" + cpu)
                {
                    LibraryProjectName = uwpPlatform.Name,
                    ExecutableProjectName = cpu,
                    Cpu = cpu,
                    InheritConfigurations = true,
                    UseWithLibraries = false,
                    UseWithExecutables = true,
                };
                uwpPlatformCpu.Configurations.Clear();
                uwpPlatformCpu.Configurations.AddRange(uwpPlatform.Configurations);

                uwpPlatform.PlatformsPart.Add(uwpPlatformCpu);
            }

            solutionPlatforms.Add(uwpPlatform);

            // Linux
            var linuxPlatform = new SolutionPlatform()
            {
                Name = PlatformType.Linux.ToString(),
                IsAvailable = true,
                Type = PlatformType.Linux,
            };
            linuxPlatform.DefineConstants.Add("SILICONSTUDIO_PLATFORM_UNIX");
            linuxPlatform.DefineConstants.Add("SILICONSTUDIO_PLATFORM_LINUX");
            linuxPlatform.Configurations.Add(coreClrRelease);
            linuxPlatform.Configurations.Add(coreClrDebug);
            solutionPlatforms.Add(linuxPlatform);

            // Disabling macOS for time being
            if (false)
            {
                // macOS
                var macOSPlatform = new SolutionPlatform()
                {
                    Name = PlatformType.macOS.ToString(),
                    IsAvailable = true,
                    Type = PlatformType.macOS,
                };
                macOSPlatform.DefineConstants.Add("SILICONSTUDIO_PLATFORM_UNIX");
                macOSPlatform.DefineConstants.Add("SILICONSTUDIO_PLATFORM_MACOS");
                macOSPlatform.Configurations.Add(coreClrRelease);
                macOSPlatform.Configurations.Add(coreClrDebug);
                solutionPlatforms.Add(macOSPlatform);
            }

            // Android
            var androidPlatform = new SolutionPlatform()
            {
                Name = PlatformType.Android.ToString(),
                Type = PlatformType.Android,
                IsAvailable = IsFileInProgramFilesx86Exist(XamarinAndroidBuild)
            };
            androidPlatform.DefineConstants.Add("SILICONSTUDIO_PLATFORM_MONO_MOBILE");
            androidPlatform.DefineConstants.Add("SILICONSTUDIO_PLATFORM_ANDROID");
            androidPlatform.Configurations.Add(new SolutionConfiguration("Testing"));
            androidPlatform.Configurations.Add(new SolutionConfiguration("AppStore"));
            androidPlatform.Configurations["Debug"].Properties.AddRange(new[]
                {
                    "<AndroidUseSharedRuntime>True</AndroidUseSharedRuntime>",
                    "<AndroidLinkMode>None</AndroidLinkMode>",
                });
            androidPlatform.Configurations["Release"].Properties.AddRange(new[]
                {
                    "<AndroidUseSharedRuntime>False</AndroidUseSharedRuntime>",
                    "<AndroidLinkMode>SdkOnly</AndroidLinkMode>",
                });
            androidPlatform.Configurations["Testing"].Properties.AddRange(androidPlatform.Configurations["Release"].Properties);
            androidPlatform.Configurations["AppStore"].Properties.AddRange(androidPlatform.Configurations["Release"].Properties);
            solutionPlatforms.Add(androidPlatform);

            // iOS: iPhone
            var iphonePlatform = new SolutionPlatform()
            {
                Name = PlatformType.iOS.ToString(),
                SolutionName = "iPhone", // For iOS, we need to use iPhone as a solution name
                Type = PlatformType.iOS,
                IsAvailable = IsFileInProgramFilesx86Exist(XamariniOSBuild)
            };
            iphonePlatform.PlatformsPart.Add(new SolutionPlatformPart("iPhoneSimulator"));
            iphonePlatform.DefineConstants.Add("SILICONSTUDIO_PLATFORM_MONO_MOBILE");
            iphonePlatform.DefineConstants.Add("SILICONSTUDIO_PLATFORM_IOS");
            iphonePlatform.Configurations.Add(new SolutionConfiguration("Testing"));
            iphonePlatform.Configurations.Add(new SolutionConfiguration("AppStore"));
            var iPhoneCommonProperties = new List<string>
                {
                    "<ConsolePause>false</ConsolePause>",
                    "<MtouchUseSGen>True</MtouchUseSGen>",
                    "<MtouchArch>ARMv7, ARMv7s, ARM64</MtouchArch>"
                };

            iphonePlatform.Configurations["Debug"].Properties.AddRange(iPhoneCommonProperties);
            iphonePlatform.Configurations["Debug"].Properties.AddRange(new []
                {
                    "<MtouchDebug>True</MtouchDebug>",
                    "<CodesignKey>iPhone Developer</CodesignKey>",
                    "<MtouchUseSGen>True</MtouchUseSGen>",
                });
            iphonePlatform.Configurations["Release"].Properties.AddRange(iPhoneCommonProperties);
            iphonePlatform.Configurations["Release"].Properties.AddRange(new[]
                {
                    "<CodesignKey>iPhone Developer</CodesignKey>",
                });
            iphonePlatform.Configurations["Testing"].Properties.AddRange(iPhoneCommonProperties);
            iphonePlatform.Configurations["Testing"].Properties.AddRange(new[]
                {
                    "<MtouchDebug>True</MtouchDebug>",
                    "<CodesignKey>iPhone Distribution</CodesignKey>",
                    "<BuildIpa>True</BuildIpa>",
                });
            iphonePlatform.Configurations["AppStore"].Properties.AddRange(iPhoneCommonProperties);
            iphonePlatform.Configurations["AppStore"].Properties.AddRange(new[]
                {
                    "<CodesignKey>iPhone Distribution</CodesignKey>",
                });
            solutionPlatforms.Add(iphonePlatform);

            // iOS: iPhoneSimulator
            var iPhoneSimulatorPlatform = iphonePlatform.PlatformsPart["iPhoneSimulator"];
            iPhoneSimulatorPlatform.Configurations["Debug"].Properties.AddRange(new[]
                {
                    "<MtouchDebug>True</MtouchDebug>",
                    "<MtouchLink>None</MtouchLink>",
                    "<MtouchArch>i386, x86_64</MtouchArch>"
                });
            iPhoneSimulatorPlatform.Configurations["Release"].Properties.AddRange(new[]
                {
                    "<MtouchLink>None</MtouchLink>",
                    "<MtouchArch>i386, x86_64</MtouchArch>"
                });

            AssetRegistry.RegisterSupportedPlatforms(solutionPlatforms);
        }
Exemple #4
0
        /// <summary>
        /// Registers the solution platforms supported by Stride.
        /// </summary>
        internal static void RegisterSolutionPlatforms()
        {
            var solutionPlatforms = new List <SolutionPlatform>();

            // Windows
            var windowsPlatform = new SolutionPlatform()
            {
                Name              = PlatformType.Windows.ToString(),
                IsAvailable       = true,
                TargetFramework   = "net6.0-windows",
                RuntimeIdentifier = "win-x64",
                Type              = PlatformType.Windows
            };

            solutionPlatforms.Add(windowsPlatform);

            // Universal Windows Platform (UWP)
            var uwpPlatform = new SolutionPlatform()
            {
                Name            = PlatformType.UWP.ToString(),
                Type            = PlatformType.UWP,
                TargetFramework = "uap10.0.16299",
                Templates       =
                {
                    //new SolutionPlatformTemplate("ProjectExecutable.UWP/CoreWindow/ProjectExecutable.UWP.ttproj", "Core Window"),
                    new SolutionPlatformTemplate("ProjectExecutable.UWP/Xaml/ProjectExecutable.UWP.ttproj", "Xaml")
                },
                IsAvailable        = IsVSComponentAvailableAnyVersion(UniversalWindowsPlatformComponents),
                UseWithExecutables = false,
                IncludeInSolution  = false,
            };

            uwpPlatform.DefineConstants.Add("STRIDE_PLATFORM_WINDOWS");
            uwpPlatform.DefineConstants.Add("STRIDE_PLATFORM_UWP");
            uwpPlatform.Configurations.Add(new SolutionConfiguration("Testing"));
            uwpPlatform.Configurations.Add(new SolutionConfiguration("AppStore"));
            uwpPlatform.Configurations["Release"].Properties.Add("<NoWarn>;2008</NoWarn>");
            uwpPlatform.Configurations["Debug"].Properties.Add("<NoWarn>;2008</NoWarn>");
            uwpPlatform.Configurations["Testing"].Properties.Add("<NoWarn>;2008</NoWarn>");
            uwpPlatform.Configurations["AppStore"].Properties.Add("<NoWarn>;2008</NoWarn>");

            uwpPlatform.Configurations["Release"].Properties.Add("<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>");
            uwpPlatform.Configurations["Testing"].Properties.Add("<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>");
            uwpPlatform.Configurations["AppStore"].Properties.Add("<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>");

            foreach (var cpu in new[] { "x86", "x64", "ARM" })
            {
                var uwpPlatformCpu = new SolutionPlatformPart(uwpPlatform.Name + "-" + cpu)
                {
                    LibraryProjectName    = uwpPlatform.Name,
                    ExecutableProjectName = cpu,
                    Cpu = cpu,
                    InheritConfigurations = true,
                    UseWithLibraries      = false,
                    UseWithExecutables    = true,
                };
                uwpPlatformCpu.Configurations.Clear();
                uwpPlatformCpu.Configurations.AddRange(uwpPlatform.Configurations);

                uwpPlatform.PlatformsPart.Add(uwpPlatformCpu);
            }

            solutionPlatforms.Add(uwpPlatform);

            // Linux
            var linuxPlatform = new SolutionPlatform()
            {
                Name              = PlatformType.Linux.ToString(),
                IsAvailable       = true,
                TargetFramework   = "net6.0",
                RuntimeIdentifier = "linux-x64",
                Type              = PlatformType.Linux,
            };

            solutionPlatforms.Add(linuxPlatform);

            // macOS
            var macOSPlatform = new SolutionPlatform()
            {
                Name              = PlatformType.macOS.ToString(),
                IsAvailable       = true,
                TargetFramework   = "net6.0",
                RuntimeIdentifier = "osx-x64",
                Type              = PlatformType.macOS,
            };

            solutionPlatforms.Add(macOSPlatform);

            // Android
            var androidPlatform = new SolutionPlatform()
            {
                Name            = PlatformType.Android.ToString(),
                Type            = PlatformType.Android,
                TargetFramework = "net6.0-android",
                IsAvailable     = IsVSComponentAvailableAnyVersion(XamarinAndroidComponents)
            };

            androidPlatform.DefineConstants.Add("STRIDE_PLATFORM_MONO_MOBILE");
            androidPlatform.DefineConstants.Add("STRIDE_PLATFORM_ANDROID");
            androidPlatform.Configurations.Add(new SolutionConfiguration("Testing"));
            androidPlatform.Configurations.Add(new SolutionConfiguration("AppStore"));
            androidPlatform.Configurations["Debug"].Properties.AddRange(new[]
            {
                "<AndroidUseSharedRuntime>True</AndroidUseSharedRuntime>",
                "<AndroidLinkMode>None</AndroidLinkMode>",
            });
            androidPlatform.Configurations["Release"].Properties.AddRange(new[]
            {
                "<AndroidUseSharedRuntime>False</AndroidUseSharedRuntime>",
                "<AndroidLinkMode>SdkOnly</AndroidLinkMode>",
            });
            androidPlatform.Configurations["Testing"].Properties.AddRange(androidPlatform.Configurations["Release"].Properties);
            androidPlatform.Configurations["AppStore"].Properties.AddRange(androidPlatform.Configurations["Release"].Properties);
            solutionPlatforms.Add(androidPlatform);

            // iOS: iPhone
            var iphonePlatform = new SolutionPlatform()
            {
                Name            = PlatformType.iOS.ToString(),
                SolutionName    = "iPhone", // For iOS, we need to use iPhone as a solution name
                Type            = PlatformType.iOS,
                TargetFramework = "net6.0-ios",
                IsAvailable     = IsVSComponentAvailableAnyVersion(XamariniOSComponents)
            };

            iphonePlatform.PlatformsPart.Add(new SolutionPlatformPart("iPhoneSimulator"));
            iphonePlatform.DefineConstants.Add("STRIDE_PLATFORM_MONO_MOBILE");
            iphonePlatform.DefineConstants.Add("STRIDE_PLATFORM_IOS");
            iphonePlatform.Configurations.Add(new SolutionConfiguration("Testing"));
            iphonePlatform.Configurations.Add(new SolutionConfiguration("AppStore"));
            var iPhoneCommonProperties = new List <string>
            {
                "<ConsolePause>false</ConsolePause>",
                "<MtouchUseSGen>True</MtouchUseSGen>",
                "<MtouchArch>ARMv7, ARMv7s, ARM64</MtouchArch>"
            };

            iphonePlatform.Configurations["Debug"].Properties.AddRange(iPhoneCommonProperties);
            iphonePlatform.Configurations["Debug"].Properties.AddRange(new []
            {
                "<MtouchDebug>True</MtouchDebug>",
                "<CodesignKey>iPhone Developer</CodesignKey>",
                "<MtouchUseSGen>True</MtouchUseSGen>",
            });
            iphonePlatform.Configurations["Release"].Properties.AddRange(iPhoneCommonProperties);
            iphonePlatform.Configurations["Release"].Properties.AddRange(new[]
            {
                "<CodesignKey>iPhone Developer</CodesignKey>",
            });
            iphonePlatform.Configurations["Testing"].Properties.AddRange(iPhoneCommonProperties);
            iphonePlatform.Configurations["Testing"].Properties.AddRange(new[]
            {
                "<MtouchDebug>True</MtouchDebug>",
                "<CodesignKey>iPhone Distribution</CodesignKey>",
                "<BuildIpa>True</BuildIpa>",
            });
            iphonePlatform.Configurations["AppStore"].Properties.AddRange(iPhoneCommonProperties);
            iphonePlatform.Configurations["AppStore"].Properties.AddRange(new[]
            {
                "<CodesignKey>iPhone Distribution</CodesignKey>",
            });
            solutionPlatforms.Add(iphonePlatform);

            // iOS: iPhoneSimulator
            var iPhoneSimulatorPlatform = iphonePlatform.PlatformsPart["iPhoneSimulator"];

            iPhoneSimulatorPlatform.Configurations["Debug"].Properties.AddRange(new[]
            {
                "<MtouchDebug>True</MtouchDebug>",
                "<MtouchLink>None</MtouchLink>",
                "<MtouchArch>i386, x86_64</MtouchArch>"
            });
            iPhoneSimulatorPlatform.Configurations["Release"].Properties.AddRange(new[]
            {
                "<MtouchLink>None</MtouchLink>",
                "<MtouchArch>i386, x86_64</MtouchArch>"
            });

            AssetRegistry.RegisterSupportedPlatforms(solutionPlatforms);
        }
Exemple #5
0
        /// <summary>
        /// Registers the solution platforms supported by Paradox.
        /// </summary>
        internal static void RegisterSolutionPlatforms()
        {
            var solutionPlatforms = new List <SolutionPlatform>();

            // Windows
            var windowsPlatform = new SolutionPlatform()
            {
                Name        = PlatformType.Windows.ToString(),
                IsAvailable = true,
                Alias       = "Any CPU",
                Type        = PlatformType.Windows
            };

            windowsPlatform.PlatformsPart.Add(new SolutionPlatformPart("Any CPU")
            {
                InheritConfigurations = true
            });
            windowsPlatform.PlatformsPart.Add(new SolutionPlatformPart("Mixed Platforms")
            {
                Alias = "Any CPU"
            });
            windowsPlatform.DefineConstants.Add("SILICONSTUDIO_PLATFORM_WINDOWS");
            windowsPlatform.DefineConstants.Add("SILICONSTUDIO_PLATFORM_WINDOWS_DESKTOP");
            windowsPlatform.Properties[GraphicsPlatform] = Graphics.GraphicsPlatform.Direct3D11;
            windowsPlatform.Configurations.Add(new SolutionConfiguration("Testing"));
            windowsPlatform.Configurations.Add(new SolutionConfiguration("AppStore"));

            foreach (var part in windowsPlatform.PlatformsPart)
            {
                part.Configurations.Clear();
                part.Configurations.AddRange(windowsPlatform.Configurations);
            }
            solutionPlatforms.Add(windowsPlatform);

            var parts = windowsPlatform.GetParts();

            // Windows Store
            var windowsStorePlatform = new SolutionPlatform()
            {
                Name               = PlatformType.WindowsStore.ToString(),
                DisplayName        = "Windows Store",
                Type               = PlatformType.WindowsStore,
                IsAvailable        = IsFileInProgramFilesx86Exist(WindowsRuntimeBuild),
                UseWithExecutables = false,
                IncludeInSolution  = false,
            };

            windowsStorePlatform.DefineConstants.Add("SILICONSTUDIO_PLATFORM_WINDOWS");
            windowsStorePlatform.DefineConstants.Add("SILICONSTUDIO_PLATFORM_WINDOWS_RUNTIME");
            windowsStorePlatform.DefineConstants.Add("SILICONSTUDIO_PLATFORM_WINDOWS_STORE");
            windowsStorePlatform.Properties[GraphicsPlatform] = Graphics.GraphicsPlatform.Direct3D11;
            windowsStorePlatform.Configurations.Add(new SolutionConfiguration("Testing"));
            windowsStorePlatform.Configurations.Add(new SolutionConfiguration("AppStore"));
            windowsStorePlatform.Configurations["Release"].Properties.Add("<NoWarn>;2008</NoWarn>");
            windowsStorePlatform.Configurations["Debug"].Properties.Add("<NoWarn>;2008</NoWarn>");
            windowsStorePlatform.Configurations["Testing"].Properties.Add("<NoWarn>;2008</NoWarn>");
            windowsStorePlatform.Configurations["AppStore"].Properties.Add("<NoWarn>;2008</NoWarn>");

            var windowsStorePlatformx86 = new SolutionPlatformPart(windowsStorePlatform.Name + "-x86")
            {
                LibraryProjectName    = windowsStorePlatform.Name,
                ExecutableProjectName = "x86",
                Cpu = "x86",
                InheritConfigurations = true,
                UseWithLibraries      = false,
                UseWithExecutables    = true,
            };

            windowsStorePlatformx86.Configurations.Clear();
            windowsStorePlatformx86.Configurations.AddRange(windowsStorePlatform.Configurations);

            var windowsStorePlatformx64 = new SolutionPlatformPart(windowsStorePlatform.Name + "-x64")
            {
                LibraryProjectName    = windowsStorePlatform.Name,
                ExecutableProjectName = "x64",
                Cpu = "x64",
                InheritConfigurations = true,
                UseWithLibraries      = false,
                UseWithExecutables    = true
            };

            windowsStorePlatformx64.Configurations.Clear();
            windowsStorePlatformx64.Configurations.AddRange(windowsStorePlatform.Configurations);

            var windowsStorePlatformARM = new SolutionPlatformPart(windowsStorePlatform.Name + "-ARM")
            {
                LibraryProjectName    = windowsStorePlatform.Name,
                ExecutableProjectName = "ARM",
                Cpu = "ARM",
                InheritConfigurations = true,
                UseWithLibraries      = false,
                UseWithExecutables    = true
            };

            windowsStorePlatformARM.Configurations.Clear();
            windowsStorePlatformARM.Configurations.AddRange(windowsStorePlatform.Configurations);

            windowsStorePlatform.PlatformsPart.Add(windowsStorePlatformx86);
            windowsStorePlatform.PlatformsPart.Add(windowsStorePlatformx64);
            windowsStorePlatform.PlatformsPart.Add(windowsStorePlatformARM);
            solutionPlatforms.Add(windowsStorePlatform);

            // Windows Phone
            var windowsPhonePlatform = new SolutionPlatform()
            {
                Name               = PlatformType.WindowsPhone.ToString(),
                DisplayName        = "Windows Phone",
                Type               = PlatformType.WindowsPhone,
                IsAvailable        = IsFileInProgramFilesx86Exist(WindowsRuntimeBuild),
                UseWithExecutables = false,
                IncludeInSolution  = false,
            };

            windowsPhonePlatform.DefineConstants.Add("SILICONSTUDIO_PLATFORM_WINDOWS");
            windowsPhonePlatform.DefineConstants.Add("SILICONSTUDIO_PLATFORM_WINDOWS_RUNTIME");
            windowsPhonePlatform.DefineConstants.Add("SILICONSTUDIO_PLATFORM_WINDOWS_PHONE");
            windowsPhonePlatform.Properties[GraphicsPlatform] = Graphics.GraphicsPlatform.Direct3D11;
            windowsPhonePlatform.Configurations.Add(new SolutionConfiguration("Testing"));
            windowsPhonePlatform.Configurations.Add(new SolutionConfiguration("AppStore"));

            windowsPhonePlatform.Configurations["Release"].Properties.Add("<NoWarn>;2008</NoWarn>");
            windowsPhonePlatform.Configurations["Debug"].Properties.Add("<NoWarn>;2008</NoWarn>");
            windowsPhonePlatform.Configurations["Testing"].Properties.Add("<NoWarn>;2008</NoWarn>");
            windowsPhonePlatform.Configurations["AppStore"].Properties.Add("<NoWarn>;2008</NoWarn>");

            var windowsPhonePlatformx86 = new SolutionPlatformPart(windowsPhonePlatform.Name + "-x86")
            {
                LibraryProjectName    = windowsPhonePlatform.Name,
                ExecutableProjectName = "x86",
                Cpu = "x86",
                InheritConfigurations = true,
                UseWithLibraries      = false,
                UseWithExecutables    = true
            };

            windowsPhonePlatformx86.Configurations.Clear();
            windowsPhonePlatformx86.Configurations.AddRange(windowsPhonePlatform.Configurations);

            var windowsPhonePlatformARM = new SolutionPlatformPart(windowsPhonePlatform.Name + "-ARM")
            {
                LibraryProjectName    = windowsPhonePlatform.Name,
                ExecutableProjectName = "ARM",
                Cpu = "ARM",
                InheritConfigurations = true,
                UseWithLibraries      = false,
                UseWithExecutables    = true
            };

            windowsPhonePlatformARM.Configurations.Clear();
            windowsPhonePlatformARM.Configurations.AddRange(windowsPhonePlatform.Configurations);

            windowsPhonePlatform.PlatformsPart.Add(windowsPhonePlatformx86);
            windowsPhonePlatform.PlatformsPart.Add(windowsPhonePlatformARM);
            solutionPlatforms.Add(windowsPhonePlatform);

            // Android
            var androidPlatform = new SolutionPlatform()
            {
                Name        = PlatformType.Android.ToString(),
                Type        = PlatformType.Android,
                IsAvailable = IsFileInProgramFilesx86Exist(XamarinAndroidBuild)
            };

            androidPlatform.DefineConstants.Add("SILICONSTUDIO_PLATFORM_MONO");
            androidPlatform.DefineConstants.Add("SILICONSTUDIO_PLATFORM_MONO_MOBILE");
            androidPlatform.DefineConstants.Add("SILICONSTUDIO_PLATFORM_ANDROID");
            androidPlatform.Properties[GraphicsPlatform] = Graphics.GraphicsPlatform.OpenGLES;
            androidPlatform.Configurations.Add(new SolutionConfiguration("Testing"));
            androidPlatform.Configurations.Add(new SolutionConfiguration("AppStore"));
            androidPlatform.Configurations["Debug"].Properties.AddRange(new[]
            {
                "<AndroidUseSharedRuntime>True</AndroidUseSharedRuntime>",
                "<AndroidLinkMode>None</AndroidLinkMode>",
            });
            androidPlatform.Configurations["Release"].Properties.AddRange(new[]
            {
                "<AndroidUseSharedRuntime>False</AndroidUseSharedRuntime>",
                "<AndroidLinkMode>SdkOnly</AndroidLinkMode>",
            });
            androidPlatform.Configurations["Testing"].Properties.AddRange(androidPlatform.Configurations["Release"].Properties);
            androidPlatform.Configurations["AppStore"].Properties.AddRange(androidPlatform.Configurations["Release"].Properties);
            solutionPlatforms.Add(androidPlatform);

            // iOS: iPhone
            var iphonePlatform = new SolutionPlatform()
            {
                Name         = PlatformType.iOS.ToString(),
                SolutionName = "iPhone", // For iOS, we need to use iPhone as a solution name
                Type         = PlatformType.iOS,
                IsAvailable  = IsFileInProgramFilesx86Exist(XamariniOSBuild)
            };

            iphonePlatform.PlatformsPart.Add(new SolutionPlatformPart("iPhoneSimulator"));
            iphonePlatform.DefineConstants.Add("SILICONSTUDIO_PLATFORM_MONO");
            iphonePlatform.DefineConstants.Add("SILICONSTUDIO_PLATFORM_MONO_MOBILE");
            iphonePlatform.DefineConstants.Add("SILICONSTUDIO_PLATFORM_IOS");
            iphonePlatform.Properties[GraphicsPlatform] = Graphics.GraphicsPlatform.OpenGLES;
            iphonePlatform.Configurations.Add(new SolutionConfiguration("Testing"));
            iphonePlatform.Configurations.Add(new SolutionConfiguration("AppStore"));
            var iPhoneCommonProperties = new List <string>()
            {
                "<ConsolePause>false</ConsolePause>",
                "<MtouchUseSGen>True</MtouchUseSGen>",
            };

            iphonePlatform.Configurations["Debug"].Properties.AddRange(iPhoneCommonProperties);
            iphonePlatform.Configurations["Debug"].Properties.AddRange(new []
            {
                "<MtouchDebug>True</MtouchDebug>",
                "<CodesignKey>iPhone Developer</CodesignKey>",
                "<MtouchUseSGen>True</MtouchUseSGen>",
            });
            iphonePlatform.Configurations["Release"].Properties.AddRange(iPhoneCommonProperties);
            iphonePlatform.Configurations["Release"].Properties.AddRange(new[]
            {
                "<CodesignKey>iPhone Developer</CodesignKey>",
            });
            iphonePlatform.Configurations["Testing"].Properties.AddRange(iPhoneCommonProperties);
            iphonePlatform.Configurations["Testing"].Properties.AddRange(new[]
            {
                "<MtouchDebug>True</MtouchDebug>",
                "<CodesignKey>iPhone Distribution</CodesignKey>",
                "<BuildIpa>True</BuildIpa>",
            });
            iphonePlatform.Configurations["AppStore"].Properties.AddRange(iPhoneCommonProperties);
            iphonePlatform.Configurations["AppStore"].Properties.AddRange(new[]
            {
                "<CodesignKey>iPhone Distribution</CodesignKey>",
            });
            solutionPlatforms.Add(iphonePlatform);

            // iOS: iPhoneSimulator
            var iPhoneSimulatorPlatform = iphonePlatform.PlatformsPart["iPhoneSimulator"];

            iPhoneSimulatorPlatform.Configurations["Debug"].Properties.AddRange(new[]
            {
                "<MtouchLink>None</MtouchLink>"
            });
            iPhoneSimulatorPlatform.Configurations["Release"].Properties.AddRange(new[]
            {
                "<MtouchLink>None</MtouchLink>"
            });

            AssetRegistry.RegisterSupportedPlatforms(solutionPlatforms);
        }
Exemple #6
0
        /// <summary>
        /// Registers the solution platforms supported by Xenko.
        /// </summary>
        internal static void RegisterSolutionPlatforms()
        {
            var solutionPlatforms = new List <SolutionPlatform>();

            // Define CoreCLR configurations
            var coreClrRelease = new SolutionConfiguration("CoreCLR_Release");
            var coreClrDebug   = new SolutionConfiguration("CoreCLR_Debug");

            coreClrDebug.IsDebug = true;
            // Add CoreCLR specific properties
            coreClrDebug.Properties.AddRange(new[]
            {
                "<SiliconStudioRuntime Condition=\"'$(SiliconStudioProjectType)' == 'Executable'\">CoreCLR</SiliconStudioRuntime>",
                "<SiliconStudioBuildDirExtension Condition=\"'$(SiliconStudioBuildDirExtension)' == ''\">CoreCLR</SiliconStudioBuildDirExtension>",
                "<DefineConstants>SILICONSTUDIO_RUNTIME_CORECLR;$(DefineConstants)</DefineConstants>"
            });
            coreClrRelease.Properties.AddRange(new[]
            {
                "<SiliconStudioRuntime Condition=\"'$(SiliconStudioProjectType)' == 'Executable'\">CoreCLR</SiliconStudioRuntime>",
                "<SiliconStudioBuildDirExtension Condition=\"'$(SiliconStudioBuildDirExtension)' == ''\">CoreCLR</SiliconStudioBuildDirExtension>",
                "<DefineConstants>SILICONSTUDIO_RUNTIME_CORECLR;$(DefineConstants)</DefineConstants>"
            });

            // Windows
            var windowsPlatform = new SolutionPlatform()
            {
                Name        = PlatformType.Windows.ToString(),
                IsAvailable = true,
                Alias       = "Any CPU",
                Type        = PlatformType.Windows
            };

            windowsPlatform.PlatformsPart.Add(new SolutionPlatformPart("Any CPU"));
            windowsPlatform.PlatformsPart.Add(new SolutionPlatformPart("Mixed Platforms")
            {
                Alias = "Any CPU"
            });
            windowsPlatform.DefineConstants.Add("SILICONSTUDIO_PLATFORM_WINDOWS");
            windowsPlatform.DefineConstants.Add("SILICONSTUDIO_PLATFORM_WINDOWS_DESKTOP");
            windowsPlatform.Configurations.Add(new SolutionConfiguration("Testing"));
            windowsPlatform.Configurations.Add(new SolutionConfiguration("AppStore"));
            windowsPlatform.Configurations.Add(coreClrDebug);
            windowsPlatform.Configurations.Add(coreClrRelease);
            foreach (var part in windowsPlatform.PlatformsPart)
            {
                part.Configurations.Clear();
                part.Configurations.AddRange(windowsPlatform.Configurations);
            }
            solutionPlatforms.Add(windowsPlatform);

            // Universal Windows Platform (UWP)
            var uwpPlatform = new SolutionPlatform()
            {
                Name               = PlatformType.UWP.ToString(),
                Type               = PlatformType.UWP,
                Templates          = { new SolutionPlatformTemplate("ProjectExecutable.UWP/CoreWindow/ProjectExecutable.UWP.ttproj", "Core Window"), new SolutionPlatformTemplate("ProjectExecutable.UWP/Xaml/ProjectExecutable.UWP.ttproj", "Xaml") },
                IsAvailable        = IsFileInProgramFilesx86Exist(UniversalWindowsPlatformRuntimeBuild),
                UseWithExecutables = false,
                IncludeInSolution  = false,
            };

            uwpPlatform.DefineConstants.Add("SILICONSTUDIO_PLATFORM_WINDOWS");
            uwpPlatform.DefineConstants.Add("SILICONSTUDIO_PLATFORM_UWP");
            uwpPlatform.Configurations.Add(new SolutionConfiguration("Testing"));
            uwpPlatform.Configurations.Add(new SolutionConfiguration("AppStore"));
            uwpPlatform.Configurations["Release"].Properties.Add("<NoWarn>;2008</NoWarn>");
            uwpPlatform.Configurations["Debug"].Properties.Add("<NoWarn>;2008</NoWarn>");
            uwpPlatform.Configurations["Testing"].Properties.Add("<NoWarn>;2008</NoWarn>");
            uwpPlatform.Configurations["AppStore"].Properties.Add("<NoWarn>;2008</NoWarn>");

            uwpPlatform.Configurations["Release"].Properties.Add("<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>");
            uwpPlatform.Configurations["Testing"].Properties.Add("<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>");
            uwpPlatform.Configurations["AppStore"].Properties.Add("<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>");

            foreach (var cpu in new[] { "x86", "x64", "ARM" })
            {
                var uwpPlatformCpu = new SolutionPlatformPart(uwpPlatform.Name + "-" + cpu)
                {
                    LibraryProjectName    = uwpPlatform.Name,
                    ExecutableProjectName = cpu,
                    Cpu = cpu,
                    InheritConfigurations = true,
                    UseWithLibraries      = false,
                    UseWithExecutables    = true,
                };
                uwpPlatformCpu.Configurations.Clear();
                uwpPlatformCpu.Configurations.AddRange(uwpPlatform.Configurations);

                uwpPlatform.PlatformsPart.Add(uwpPlatformCpu);
            }

            solutionPlatforms.Add(uwpPlatform);

            // Linux
            var linuxPlatform = new SolutionPlatform()
            {
                Name        = PlatformType.Linux.ToString(),
                IsAvailable = true,
                Type        = PlatformType.Linux,
            };

            linuxPlatform.DefineConstants.Add("SILICONSTUDIO_PLATFORM_UNIX");
            linuxPlatform.DefineConstants.Add("SILICONSTUDIO_PLATFORM_LINUX");
            linuxPlatform.Configurations.Add(coreClrRelease);
            linuxPlatform.Configurations.Add(coreClrDebug);
            solutionPlatforms.Add(linuxPlatform);

            // Disabling macOS for time being
            if (false)
            {
                // macOS
                var macOSPlatform = new SolutionPlatform()
                {
                    Name        = PlatformType.macOS.ToString(),
                    IsAvailable = true,
                    Type        = PlatformType.macOS,
                };
                macOSPlatform.DefineConstants.Add("SILICONSTUDIO_PLATFORM_UNIX");
                macOSPlatform.DefineConstants.Add("SILICONSTUDIO_PLATFORM_MACOS");
                macOSPlatform.Configurations.Add(coreClrRelease);
                macOSPlatform.Configurations.Add(coreClrDebug);
                solutionPlatforms.Add(macOSPlatform);
            }

            // Android
            var androidPlatform = new SolutionPlatform()
            {
                Name        = PlatformType.Android.ToString(),
                Type        = PlatformType.Android,
                IsAvailable = IsFileInProgramFilesx86Exist(XamarinAndroidBuild)
            };

            androidPlatform.DefineConstants.Add("SILICONSTUDIO_PLATFORM_MONO_MOBILE");
            androidPlatform.DefineConstants.Add("SILICONSTUDIO_PLATFORM_ANDROID");
            androidPlatform.Configurations.Add(new SolutionConfiguration("Testing"));
            androidPlatform.Configurations.Add(new SolutionConfiguration("AppStore"));
            androidPlatform.Configurations["Debug"].Properties.AddRange(new[]
            {
                "<AndroidUseSharedRuntime>True</AndroidUseSharedRuntime>",
                "<AndroidLinkMode>None</AndroidLinkMode>",
            });
            androidPlatform.Configurations["Release"].Properties.AddRange(new[]
            {
                "<AndroidUseSharedRuntime>False</AndroidUseSharedRuntime>",
                "<AndroidLinkMode>SdkOnly</AndroidLinkMode>",
            });
            androidPlatform.Configurations["Testing"].Properties.AddRange(androidPlatform.Configurations["Release"].Properties);
            androidPlatform.Configurations["AppStore"].Properties.AddRange(androidPlatform.Configurations["Release"].Properties);
            solutionPlatforms.Add(androidPlatform);

            // iOS: iPhone
            var iphonePlatform = new SolutionPlatform()
            {
                Name         = PlatformType.iOS.ToString(),
                SolutionName = "iPhone", // For iOS, we need to use iPhone as a solution name
                Type         = PlatformType.iOS,
                IsAvailable  = IsFileInProgramFilesx86Exist(XamariniOSBuild)
            };

            iphonePlatform.PlatformsPart.Add(new SolutionPlatformPart("iPhoneSimulator"));
            iphonePlatform.DefineConstants.Add("SILICONSTUDIO_PLATFORM_MONO_MOBILE");
            iphonePlatform.DefineConstants.Add("SILICONSTUDIO_PLATFORM_IOS");
            iphonePlatform.Configurations.Add(new SolutionConfiguration("Testing"));
            iphonePlatform.Configurations.Add(new SolutionConfiguration("AppStore"));
            var iPhoneCommonProperties = new List <string>
            {
                "<ConsolePause>false</ConsolePause>",
                "<MtouchUseSGen>True</MtouchUseSGen>",
                "<MtouchArch>ARMv7, ARMv7s, ARM64</MtouchArch>"
            };

            iphonePlatform.Configurations["Debug"].Properties.AddRange(iPhoneCommonProperties);
            iphonePlatform.Configurations["Debug"].Properties.AddRange(new []
            {
                "<MtouchDebug>True</MtouchDebug>",
                "<CodesignKey>iPhone Developer</CodesignKey>",
                "<MtouchUseSGen>True</MtouchUseSGen>",
            });
            iphonePlatform.Configurations["Release"].Properties.AddRange(iPhoneCommonProperties);
            iphonePlatform.Configurations["Release"].Properties.AddRange(new[]
            {
                "<CodesignKey>iPhone Developer</CodesignKey>",
            });
            iphonePlatform.Configurations["Testing"].Properties.AddRange(iPhoneCommonProperties);
            iphonePlatform.Configurations["Testing"].Properties.AddRange(new[]
            {
                "<MtouchDebug>True</MtouchDebug>",
                "<CodesignKey>iPhone Distribution</CodesignKey>",
                "<BuildIpa>True</BuildIpa>",
            });
            iphonePlatform.Configurations["AppStore"].Properties.AddRange(iPhoneCommonProperties);
            iphonePlatform.Configurations["AppStore"].Properties.AddRange(new[]
            {
                "<CodesignKey>iPhone Distribution</CodesignKey>",
            });
            solutionPlatforms.Add(iphonePlatform);

            // iOS: iPhoneSimulator
            var iPhoneSimulatorPlatform = iphonePlatform.PlatformsPart["iPhoneSimulator"];

            iPhoneSimulatorPlatform.Configurations["Debug"].Properties.AddRange(new[]
            {
                "<MtouchDebug>True</MtouchDebug>",
                "<MtouchLink>None</MtouchLink>",
                "<MtouchArch>i386, x86_64</MtouchArch>"
            });
            iPhoneSimulatorPlatform.Configurations["Release"].Properties.AddRange(new[]
            {
                "<MtouchLink>None</MtouchLink>",
                "<MtouchArch>i386, x86_64</MtouchArch>"
            });

            AssetRegistry.RegisterSupportedPlatforms(solutionPlatforms);
        }
Exemple #7
0
        /// <summary>
        /// Registers the solution platforms supported by Xenko.
        /// </summary>
        internal static void RegisterSolutionPlatforms()
        {
            var solutionPlatforms = new List <SolutionPlatform>();

            // Windows
            var windowsPlatform = new SolutionPlatform()
            {
                Name        = PlatformType.Windows.ToString(),
                IsAvailable = true,
                Alias       = "Any CPU",
                Type        = PlatformType.Windows
            };

            windowsPlatform.PlatformsPart.Add(new SolutionPlatformPart("Any CPU")
            {
                InheritConfigurations = true
            });
            windowsPlatform.PlatformsPart.Add(new SolutionPlatformPart("Mixed Platforms")
            {
                Alias = "Any CPU"
            });
            windowsPlatform.DefineConstants.Add("SILICONSTUDIO_PLATFORM_WINDOWS");
            windowsPlatform.DefineConstants.Add("SILICONSTUDIO_PLATFORM_WINDOWS_DESKTOP");
            windowsPlatform.Configurations.Add(new SolutionConfiguration("Testing"));
            windowsPlatform.Configurations.Add(new SolutionConfiguration("AppStore"));

            foreach (var part in windowsPlatform.PlatformsPart)
            {
                part.Configurations.Clear();
                part.Configurations.AddRange(windowsPlatform.Configurations);
            }
            solutionPlatforms.Add(windowsPlatform);

            // Windows Store
            var windowsStorePlatform = new SolutionPlatform()
            {
                Name               = PlatformType.WindowsStore.ToString(),
                DisplayName        = "Windows Store",
                Type               = PlatformType.WindowsStore,
                IsAvailable        = WindowsRuntimeBuild.Any(IsFileInProgramFilesx86Exist),
                UseWithExecutables = false,
                IncludeInSolution  = false,
            };

            windowsStorePlatform.DefineConstants.Add("SILICONSTUDIO_PLATFORM_WINDOWS");
            windowsStorePlatform.DefineConstants.Add("SILICONSTUDIO_PLATFORM_WINDOWS_RUNTIME");
            windowsStorePlatform.DefineConstants.Add("SILICONSTUDIO_PLATFORM_WINDOWS_STORE");
            windowsStorePlatform.Configurations.Add(new SolutionConfiguration("Testing"));
            windowsStorePlatform.Configurations.Add(new SolutionConfiguration("AppStore"));
            windowsStorePlatform.Configurations["Release"].Properties.Add("<NoWarn>;2008</NoWarn>");
            windowsStorePlatform.Configurations["Debug"].Properties.Add("<NoWarn>;2008</NoWarn>");
            windowsStorePlatform.Configurations["Testing"].Properties.Add("<NoWarn>;2008</NoWarn>");
            windowsStorePlatform.Configurations["AppStore"].Properties.Add("<NoWarn>;2008</NoWarn>");

            foreach (var cpu in new[] { "x86", "x64", "ARM" })
            {
                var windowsStorePlatformCpu = new SolutionPlatformPart(windowsStorePlatform.Name + "-" + cpu)
                {
                    LibraryProjectName    = windowsStorePlatform.Name,
                    ExecutableProjectName = cpu,
                    Cpu = cpu,
                    InheritConfigurations = true,
                    UseWithLibraries      = false,
                    UseWithExecutables    = true,
                };
                windowsStorePlatformCpu.Configurations.Clear();
                windowsStorePlatformCpu.Configurations.AddRange(windowsStorePlatform.Configurations);

                windowsStorePlatform.PlatformsPart.Add(windowsStorePlatformCpu);
            }

            solutionPlatforms.Add(windowsStorePlatform);

            // Windows 10
            var windows10Platform = new SolutionPlatform()
            {
                Name               = PlatformType.Windows10.ToString(),
                DisplayName        = "Windows 10",
                Type               = PlatformType.Windows10,
                IsAvailable        = IsFileInProgramFilesx86Exist(Windows10UniversalRuntimeBuild),
                UseWithExecutables = false,
                IncludeInSolution  = false,
            };

            windows10Platform.DefineConstants.Add("SILICONSTUDIO_PLATFORM_WINDOWS");
            windows10Platform.DefineConstants.Add("SILICONSTUDIO_PLATFORM_WINDOWS_RUNTIME");
            windows10Platform.DefineConstants.Add("SILICONSTUDIO_PLATFORM_WINDOWS_10");
            windows10Platform.Configurations.Add(new SolutionConfiguration("Testing"));
            windows10Platform.Configurations.Add(new SolutionConfiguration("AppStore"));
            windows10Platform.Configurations["Release"].Properties.Add("<NoWarn>;2008</NoWarn>");
            windows10Platform.Configurations["Debug"].Properties.Add("<NoWarn>;2008</NoWarn>");
            windows10Platform.Configurations["Testing"].Properties.Add("<NoWarn>;2008</NoWarn>");
            windows10Platform.Configurations["AppStore"].Properties.Add("<NoWarn>;2008</NoWarn>");

            windows10Platform.Configurations["Release"].Properties.Add("<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>");
            windows10Platform.Configurations["Testing"].Properties.Add("<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>");
            windows10Platform.Configurations["AppStore"].Properties.Add("<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>");

            foreach (var cpu in new[] { "x86", "x64", "ARM" })
            {
                var windows10PlatformCpu = new SolutionPlatformPart(windows10Platform.Name + "-" + cpu)
                {
                    LibraryProjectName    = windows10Platform.Name,
                    ExecutableProjectName = cpu,
                    Cpu = cpu,
                    InheritConfigurations = true,
                    UseWithLibraries      = false,
                    UseWithExecutables    = true,
                };
                windows10PlatformCpu.Configurations.Clear();
                windows10PlatformCpu.Configurations.AddRange(windows10Platform.Configurations);

                windows10Platform.PlatformsPart.Add(windows10PlatformCpu);
            }

            solutionPlatforms.Add(windows10Platform);

            // Windows Phone
            var windowsPhonePlatform = new SolutionPlatform()
            {
                Name               = PlatformType.WindowsPhone.ToString(),
                DisplayName        = "Windows Phone",
                Type               = PlatformType.WindowsPhone,
                IsAvailable        = WindowsRuntimeBuild.Any(IsFileInProgramFilesx86Exist),
                UseWithExecutables = false,
                IncludeInSolution  = false,
            };

            windowsPhonePlatform.DefineConstants.Add("SILICONSTUDIO_PLATFORM_WINDOWS");
            windowsPhonePlatform.DefineConstants.Add("SILICONSTUDIO_PLATFORM_WINDOWS_RUNTIME");
            windowsPhonePlatform.DefineConstants.Add("SILICONSTUDIO_PLATFORM_WINDOWS_PHONE");
            windowsPhonePlatform.Configurations.Add(new SolutionConfiguration("Testing"));
            windowsPhonePlatform.Configurations.Add(new SolutionConfiguration("AppStore"));

            windowsPhonePlatform.Configurations["Release"].Properties.Add("<NoWarn>;2008</NoWarn>");
            windowsPhonePlatform.Configurations["Debug"].Properties.Add("<NoWarn>;2008</NoWarn>");
            windowsPhonePlatform.Configurations["Testing"].Properties.Add("<NoWarn>;2008</NoWarn>");
            windowsPhonePlatform.Configurations["AppStore"].Properties.Add("<NoWarn>;2008</NoWarn>");

            foreach (var cpu in new[] { "x86", "ARM" })
            {
                var windowsPhonePlatformCpu = new SolutionPlatformPart(windowsPhonePlatform.Name + "-" + cpu)
                {
                    LibraryProjectName    = windowsPhonePlatform.Name,
                    ExecutableProjectName = cpu,
                    Cpu = cpu,
                    InheritConfigurations = true,
                    UseWithLibraries      = false,
                    UseWithExecutables    = true
                };
                windowsPhonePlatformCpu.Configurations.Clear();
                windowsPhonePlatformCpu.Configurations.AddRange(windowsPhonePlatform.Configurations);

                windowsPhonePlatform.PlatformsPart.Add(windowsPhonePlatformCpu);
            }

            solutionPlatforms.Add(windowsPhonePlatform);

            // Linux
            var linuxPlatform = new SolutionPlatform()
            {
                Name        = PlatformType.Linux.ToString(),
                IsAvailable = true,
                Type        = PlatformType.Linux,
            };

            linuxPlatform.DefineConstants.Add("SILICONSTUDIO_PLATFORM_LINUX");
// Following is commented until we have full fledge support (templates and other needed stuff)
//            solutionPlatforms.Add(linuxPlatform);

            // Android
            var androidPlatform = new SolutionPlatform()
            {
                Name        = PlatformType.Android.ToString(),
                Type        = PlatformType.Android,
                IsAvailable = IsFileInProgramFilesx86Exist(XamarinAndroidBuild)
            };

            androidPlatform.DefineConstants.Add("SILICONSTUDIO_PLATFORM_MONO_MOBILE");
            androidPlatform.DefineConstants.Add("SILICONSTUDIO_PLATFORM_ANDROID");
            androidPlatform.Configurations.Add(new SolutionConfiguration("Testing"));
            androidPlatform.Configurations.Add(new SolutionConfiguration("AppStore"));
            androidPlatform.Configurations["Debug"].Properties.AddRange(new[]
            {
                "<AndroidUseSharedRuntime>True</AndroidUseSharedRuntime>",
                "<AndroidLinkMode>None</AndroidLinkMode>",
            });
            androidPlatform.Configurations["Release"].Properties.AddRange(new[]
            {
                "<AndroidUseSharedRuntime>False</AndroidUseSharedRuntime>",
                "<AndroidLinkMode>SdkOnly</AndroidLinkMode>",
            });
            androidPlatform.Configurations["Testing"].Properties.AddRange(androidPlatform.Configurations["Release"].Properties);
            androidPlatform.Configurations["AppStore"].Properties.AddRange(androidPlatform.Configurations["Release"].Properties);
            solutionPlatforms.Add(androidPlatform);

            // iOS: iPhone
            var iphonePlatform = new SolutionPlatform()
            {
                Name         = PlatformType.iOS.ToString(),
                SolutionName = "iPhone", // For iOS, we need to use iPhone as a solution name
                Type         = PlatformType.iOS,
                IsAvailable  = IsFileInProgramFilesx86Exist(XamariniOSBuild)
            };

            iphonePlatform.PlatformsPart.Add(new SolutionPlatformPart("iPhoneSimulator"));
            iphonePlatform.DefineConstants.Add("SILICONSTUDIO_PLATFORM_MONO_MOBILE");
            iphonePlatform.DefineConstants.Add("SILICONSTUDIO_PLATFORM_IOS");
            iphonePlatform.Configurations.Add(new SolutionConfiguration("Testing"));
            iphonePlatform.Configurations.Add(new SolutionConfiguration("AppStore"));
            var iPhoneCommonProperties = new List <string>
            {
                "<ConsolePause>false</ConsolePause>",
                "<MtouchUseSGen>True</MtouchUseSGen>",
                "<MtouchArch>ARMv7, ARMv7s, ARM64</MtouchArch>"
            };

            iphonePlatform.Configurations["Debug"].Properties.AddRange(iPhoneCommonProperties);
            iphonePlatform.Configurations["Debug"].Properties.AddRange(new []
            {
                "<MtouchDebug>True</MtouchDebug>",
                "<CodesignKey>iPhone Developer</CodesignKey>",
                "<MtouchUseSGen>True</MtouchUseSGen>",
            });
            iphonePlatform.Configurations["Release"].Properties.AddRange(iPhoneCommonProperties);
            iphonePlatform.Configurations["Release"].Properties.AddRange(new[]
            {
                "<CodesignKey>iPhone Developer</CodesignKey>",
            });
            iphonePlatform.Configurations["Testing"].Properties.AddRange(iPhoneCommonProperties);
            iphonePlatform.Configurations["Testing"].Properties.AddRange(new[]
            {
                "<MtouchDebug>True</MtouchDebug>",
                "<CodesignKey>iPhone Distribution</CodesignKey>",
                "<BuildIpa>True</BuildIpa>",
            });
            iphonePlatform.Configurations["AppStore"].Properties.AddRange(iPhoneCommonProperties);
            iphonePlatform.Configurations["AppStore"].Properties.AddRange(new[]
            {
                "<CodesignKey>iPhone Distribution</CodesignKey>",
            });
            solutionPlatforms.Add(iphonePlatform);

            // iOS: iPhoneSimulator
            var iPhoneSimulatorPlatform = iphonePlatform.PlatformsPart["iPhoneSimulator"];

            iPhoneSimulatorPlatform.Configurations["Debug"].Properties.AddRange(new[]
            {
                "<MtouchDebug>True</MtouchDebug>",
                "<MtouchLink>None</MtouchLink>",
                "<MtouchArch>i386, x86_64</MtouchArch>"
            });
            iPhoneSimulatorPlatform.Configurations["Release"].Properties.AddRange(new[]
            {
                "<MtouchLink>None</MtouchLink>",
                "<MtouchArch>i386, x86_64</MtouchArch>"
            });

            AssetRegistry.RegisterSupportedPlatforms(solutionPlatforms);
        }