4 using System.Collections.Generic;
7 using SiliconStudio.Assets;
8 using SiliconStudio.Core;
9 using SiliconStudio.Core.VisualStudio;
10 using SiliconStudio.Paradox.Graphics;
12 namespace SiliconStudio.
Paradox.Assets
14 [DataContract(
"Paradox")]
17 private const string XamariniOSBuild =
@"MSBuild\Xamarin\iOS\Xamarin.MonoTouch.CSharp.targets";
18 private const string XamarinAndroidBuild =
@"MSBuild\Xamarin\Android\Xamarin.Android.CSharp.targets";
19 private const string WindowsRuntimeBuild =
@"MSBuild\Microsoft\WindowsXaml\v12.0\8.1\Microsoft.Windows.UI.Xaml.Common.Targets";
20 private static readonly
string ProgramFilesX86 = Environment.GetEnvironmentVariable(Environment.Is64BitOperatingSystem ?
"ProgramFiles(x86)" :
"ProgramFiles");
36 MinVersion = LatestPackageVersion,
44 internal static void RegisterSolutionPlatforms()
46 var solutionPlatforms =
new List<SolutionPlatform>();
51 Name = PlatformType.Windows.ToString(),
56 windowsPlatform.PlatformsPart.Add(
new SolutionPlatformPart(
"Any CPU") { InheritConfigurations =
true });
57 windowsPlatform.PlatformsPart.Add(
new SolutionPlatformPart(
"Mixed Platforms") { Alias =
"Any CPU"});
58 windowsPlatform.DefineConstants.Add(
"SILICONSTUDIO_PLATFORM_WINDOWS");
59 windowsPlatform.DefineConstants.Add(
"SILICONSTUDIO_PLATFORM_WINDOWS_DESKTOP");
60 windowsPlatform.Properties[
GraphicsPlatform] = Graphics.GraphicsPlatform.Direct3D11;
61 windowsPlatform.Properties[
GraphicsProfile] = Graphics.GraphicsProfile.Level_9_1;
65 foreach (var part
in windowsPlatform.PlatformsPart)
67 part.Configurations.Clear();
68 part.Configurations.AddRange(windowsPlatform.Configurations);
70 solutionPlatforms.Add(windowsPlatform);
72 var parts = windowsPlatform.GetParts();
77 Name = PlatformType.WindowsStore.ToString(),
78 DisplayName =
"Windows Store",
80 IsAvailable = IsFileInProgramFilesx86Exist(WindowsRuntimeBuild),
81 UseWithExecutables =
false,
82 IncludeInSolution =
false,
85 windowsStorePlatform.DefineConstants.Add(
"SILICONSTUDIO_PLATFORM_WINDOWS");
86 windowsStorePlatform.DefineConstants.Add(
"SILICONSTUDIO_PLATFORM_WINDOWS_RUNTIME");
87 windowsStorePlatform.DefineConstants.Add(
"SILICONSTUDIO_PLATFORM_WINDOWS_STORE");
88 windowsStorePlatform.Properties[
GraphicsPlatform] = Graphics.GraphicsPlatform.Direct3D11;
89 windowsStorePlatform.Properties[
GraphicsProfile] = Graphics.GraphicsProfile.Level_9_1;
92 windowsStorePlatform.Configurations[
"Release"].Properties.Add(
"<NoWarn>;2008</NoWarn>");
93 windowsStorePlatform.Configurations[
"Debug"].Properties.Add(
"<NoWarn>;2008</NoWarn>");
94 windowsStorePlatform.Configurations[
"Testing"].Properties.Add(
"<NoWarn>;2008</NoWarn>");
95 windowsStorePlatform.Configurations[
"AppStore"].Properties.Add(
"<NoWarn>;2008</NoWarn>");
99 LibraryProjectName = windowsStorePlatform.Name,
100 ExecutableProjectName =
"x86",
102 InheritConfigurations =
true,
103 UseWithLibraries =
false,
104 UseWithExecutables =
true,
106 windowsStorePlatformx86.Configurations.Clear();
107 windowsStorePlatformx86.Configurations.AddRange(windowsStorePlatform.Configurations);
111 LibraryProjectName = windowsStorePlatform.Name,
112 ExecutableProjectName =
"x64",
114 InheritConfigurations =
true,
115 UseWithLibraries =
false,
116 UseWithExecutables =
true
118 windowsStorePlatformx64.Configurations.Clear();
119 windowsStorePlatformx64.Configurations.AddRange(windowsStorePlatform.Configurations);
123 LibraryProjectName = windowsStorePlatform.Name,
124 ExecutableProjectName =
"ARM",
126 InheritConfigurations =
true,
127 UseWithLibraries =
false,
128 UseWithExecutables =
true
130 windowsStorePlatformARM.Configurations.Clear();
131 windowsStorePlatformARM.Configurations.AddRange(windowsStorePlatform.Configurations);
133 windowsStorePlatform.PlatformsPart.Add(windowsStorePlatformx86);
134 windowsStorePlatform.PlatformsPart.Add(windowsStorePlatformx64);
135 windowsStorePlatform.PlatformsPart.Add(windowsStorePlatformARM);
136 solutionPlatforms.Add(windowsStorePlatform);
141 Name = PlatformType.WindowsPhone.ToString(),
142 DisplayName =
"Windows Phone",
144 IsAvailable = IsFileInProgramFilesx86Exist(WindowsRuntimeBuild),
145 UseWithExecutables =
false,
146 IncludeInSolution =
false,
149 windowsPhonePlatform.DefineConstants.Add(
"SILICONSTUDIO_PLATFORM_WINDOWS");
150 windowsPhonePlatform.DefineConstants.Add(
"SILICONSTUDIO_PLATFORM_WINDOWS_RUNTIME");
151 windowsPhonePlatform.DefineConstants.Add(
"SILICONSTUDIO_PLATFORM_WINDOWS_PHONE");
152 windowsPhonePlatform.Properties[
GraphicsPlatform] = Graphics.GraphicsPlatform.Direct3D11;
153 windowsPhonePlatform.Properties[
GraphicsProfile] = Graphics.GraphicsProfile.Level_9_1;
157 windowsPhonePlatform.Configurations[
"Release"].Properties.Add(
"<NoWarn>;2008</NoWarn>");
158 windowsPhonePlatform.Configurations[
"Debug"].Properties.Add(
"<NoWarn>;2008</NoWarn>");
159 windowsPhonePlatform.Configurations[
"Testing"].Properties.Add(
"<NoWarn>;2008</NoWarn>");
160 windowsPhonePlatform.Configurations[
"AppStore"].Properties.Add(
"<NoWarn>;2008</NoWarn>");
164 LibraryProjectName = windowsPhonePlatform.Name,
165 ExecutableProjectName =
"x86",
167 InheritConfigurations =
true,
168 UseWithLibraries =
false,
169 UseWithExecutables =
true
171 windowsPhonePlatformx86.Configurations.Clear();
172 windowsPhonePlatformx86.Configurations.AddRange(windowsPhonePlatform.Configurations);
176 LibraryProjectName = windowsPhonePlatform.Name,
177 ExecutableProjectName =
"ARM",
179 InheritConfigurations =
true,
180 UseWithLibraries =
false,
181 UseWithExecutables =
true
183 windowsPhonePlatformARM.Configurations.Clear();
184 windowsPhonePlatformARM.Configurations.AddRange(windowsPhonePlatform.Configurations);
186 windowsPhonePlatform.PlatformsPart.Add(windowsPhonePlatformx86);
187 windowsPhonePlatform.PlatformsPart.Add(windowsPhonePlatformARM);
188 solutionPlatforms.Add(windowsPhonePlatform);
193 Name = PlatformType.Android.ToString(),
195 IsAvailable = IsFileInProgramFilesx86Exist(XamarinAndroidBuild)
197 androidPlatform.DefineConstants.Add(
"SILICONSTUDIO_PLATFORM_MONO");
198 androidPlatform.DefineConstants.Add(
"SILICONSTUDIO_PLATFORM_MONO_MOBILE");
199 androidPlatform.DefineConstants.Add(
"SILICONSTUDIO_PLATFORM_ANDROID");
200 androidPlatform.Properties[
GraphicsPlatform] = Graphics.GraphicsPlatform.OpenGLES;
201 androidPlatform.Properties[
GraphicsProfile] = Graphics.GraphicsProfile.Level_9_1;
204 androidPlatform.Configurations[
"Debug"].Properties.AddRange(
new[]
206 "<AndroidUseSharedRuntime>True</AndroidUseSharedRuntime>",
207 "<AndroidLinkMode>None</AndroidLinkMode>",
209 androidPlatform.Configurations[
"Release"].Properties.AddRange(
new[]
211 "<AndroidUseSharedRuntime>False</AndroidUseSharedRuntime>",
212 "<AndroidLinkMode>SdkOnly</AndroidLinkMode>",
214 androidPlatform.Configurations[
"Testing"].Properties.AddRange(androidPlatform.Configurations[
"Release"].Properties);
215 androidPlatform.Configurations[
"AppStore"].Properties.AddRange(androidPlatform.Configurations[
"Release"].Properties);
216 solutionPlatforms.Add(androidPlatform);
221 Name = PlatformType.iOS.ToString(),
222 SolutionName =
"iPhone",
224 IsAvailable = IsFileInProgramFilesx86Exist(XamariniOSBuild)
227 iphonePlatform.DefineConstants.Add(
"SILICONSTUDIO_PLATFORM_MONO");
228 iphonePlatform.DefineConstants.Add(
"SILICONSTUDIO_PLATFORM_MONO_MOBILE");
229 iphonePlatform.DefineConstants.Add(
"SILICONSTUDIO_PLATFORM_IOS");
230 iphonePlatform.Properties[
GraphicsPlatform] = Graphics.GraphicsPlatform.OpenGLES;
231 iphonePlatform.Properties[
GraphicsProfile] = Graphics.GraphicsProfile.Level_9_1;
234 var iPhoneCommonProperties =
new List<string>()
236 "<ConsolePause>false</ConsolePause>",
237 "<MtouchUseSGen>True</MtouchUseSGen>",
240 iphonePlatform.Configurations[
"Debug"].Properties.AddRange(iPhoneCommonProperties);
241 iphonePlatform.Configurations[
"Debug"].Properties.AddRange(
new []
243 "<MtouchDebug>True</MtouchDebug>",
244 "<CodesignKey>iPhone Developer</CodesignKey>",
245 "<MtouchUseSGen>True</MtouchUseSGen>",
247 iphonePlatform.Configurations[
"Release"].Properties.AddRange(iPhoneCommonProperties);
248 iphonePlatform.Configurations[
"Release"].Properties.AddRange(
new[]
250 "<CodesignKey>iPhone Developer</CodesignKey>",
252 iphonePlatform.Configurations[
"Testing"].Properties.AddRange(iPhoneCommonProperties);
253 iphonePlatform.Configurations[
"Testing"].Properties.AddRange(
new[]
255 "<MtouchDebug>True</MtouchDebug>",
256 "<CodesignKey>iPhone Distribution</CodesignKey>",
257 "<BuildIpa>True</BuildIpa>",
259 iphonePlatform.Configurations[
"AppStore"].Properties.AddRange(iPhoneCommonProperties);
260 iphonePlatform.Configurations[
"AppStore"].Properties.AddRange(
new[]
262 "<CodesignKey>iPhone Distribution</CodesignKey>",
264 solutionPlatforms.Add(iphonePlatform);
267 var iPhoneSimulatorPlatform = iphonePlatform.PlatformsPart[
"iPhoneSimulator"];
268 iPhoneSimulatorPlatform.Configurations[
"Debug"].Properties.AddRange(
new[]
270 "<MtouchLink>None</MtouchLink>"
272 iPhoneSimulatorPlatform.Configurations[
"Release"].Properties.AddRange(
new[]
274 "<MtouchLink>None</MtouchLink>"
277 AssetRegistry.RegisterSupportedPlatforms(solutionPlatforms);
280 internal static bool IsFileInProgramFilesx86Exist(
string path)
282 return (ProgramFilesX86 != null &&
File.Exists(Path.Combine(ProgramFilesX86, path)));
PlatformType
Describes the platform operating system.
GraphicsPlatform
The graphics platform.
DisplayOrientation
Describes the orientation of the display.
TextureQuality
The desired texture quality.
A solution configuration used by SolutionPlatform
A reference to a package either internal (directly to a Package inside the same solution) or external...
static PackageDependency GetLatestPackageDependency()
A class that represents a tag propety.
A hybrid implementation of SemVer that supports semantic versioning as described at http://semver...
GraphicsProfile
Identifies the set of supported devices for the demo based on device capabilities.
A dependency to a range of version.