Пример #1
0
 internal static string GetExtensionVersion(string target)
 {
     if (!string.IsNullOrEmpty(target))
     {
         IEnumerator <IPlatformSupportModule> enumerator = platformSupportModules.GetEnumerator();
         try
         {
             while (enumerator.MoveNext())
             {
                 IPlatformSupportModule current = enumerator.Current;
                 if (current.TargetName == target)
                 {
                     return(current.ExtensionVersion);
                 }
             }
         }
         finally
         {
             if (enumerator == null)
             {
             }
             enumerator.Dispose();
         }
     }
     return(null);
 }
Пример #2
0
 private static IScriptingImplementations GetScriptingImplementations(string target)
 {
     if (!string.IsNullOrEmpty(target))
     {
         IEnumerator <IPlatformSupportModule> enumerator = platformSupportModules.GetEnumerator();
         try
         {
             while (enumerator.MoveNext())
             {
                 IPlatformSupportModule current = enumerator.Current;
                 if (current.TargetName == target)
                 {
                     return(current.CreateScriptingImplementations());
                 }
             }
         }
         finally
         {
             if (enumerator == null)
             {
             }
             enumerator.Dispose();
         }
     }
     return(null);
 }
Пример #3
0
 internal static IBuildPostprocessor GetBuildPostProcessor(string target)
 {
     if (target != null)
     {
         IEnumerator <IPlatformSupportModule> enumerator = platformSupportModules.GetEnumerator();
         try
         {
             while (enumerator.MoveNext())
             {
                 IPlatformSupportModule current = enumerator.Current;
                 if (current.TargetName == target)
                 {
                     return(current.CreateBuildPostprocessor());
                 }
             }
         }
         finally
         {
             if (enumerator == null)
             {
             }
             enumerator.Dispose();
         }
     }
     return(null);
 }
Пример #4
0
        private static void ChangeActivePlatformModuleTo(string target)
        {
            DeactivateActivePlatformModule();
            IEnumerator <IPlatformSupportModule> enumerator = platformSupportModules.GetEnumerator();

            try
            {
                while (enumerator.MoveNext())
                {
                    IPlatformSupportModule current = enumerator.Current;
                    if (current.TargetName == target)
                    {
                        s_ActivePlatformModule = current;
                        current.OnActivate();
                        return;
                    }
                }
            }
            finally
            {
                if (enumerator == null)
                {
                }
                enumerator.Dispose();
            }
        }
Пример #5
0
 internal static IUserAssembliesValidator GetUserAssembliesValidator(string target)
 {
     if (target != null)
     {
         IEnumerator <IPlatformSupportModule> enumerator = platformSupportModules.GetEnumerator();
         try
         {
             while (enumerator.MoveNext())
             {
                 IPlatformSupportModule current = enumerator.Current;
                 if (current.TargetName == target)
                 {
                     return(current.CreateUserAssembliesValidatorExtension());
                 }
             }
         }
         finally
         {
             if (enumerator == null)
             {
             }
             enumerator.Dispose();
         }
     }
     return(null);
 }
Пример #6
0
 private static void DeactivateActivePlatformModule()
 {
     if (ModuleManager.s_ActivePlatformModule != null)
     {
         ModuleManager.s_ActivePlatformModule.OnDeactivate();
         ModuleManager.s_ActivePlatformModule = null;
     }
 }
Пример #7
0
 static void DeactivateActivePlatformModule()
 {
     if (s_ActivePlatformModule != null)
     {
         s_ActivePlatformModule.OnDeactivate();
         s_ActivePlatformModule = null;
     }
 }
Пример #8
0
 private static void DeactivateActivePlatformModule()
 {
     if (ModuleManager.s_ActivePlatformModule == null)
     {
         return;
     }
     ModuleManager.s_ActivePlatformModule.OnDeactivate();
     ModuleManager.s_ActivePlatformModule = (IPlatformSupportModule)null;
 }
Пример #9
0
        static void ChangeActivePlatformModuleTo(string target)
        {
            DeactivateActivePlatformModule();

            IPlatformSupportModule selected;

            if (platformSupportModules.TryGetValue(target, out selected))
            {
                s_ActivePlatformModule = selected;
                s_ActivePlatformModule.OnActivate();
            }
        }
Пример #10
0
 private static void ChangeActivePlatformModuleTo(string target)
 {
     ModuleManager.DeactivateActivePlatformModule();
     foreach (IPlatformSupportModule current in ModuleManager.platformSupportModules)
     {
         if (current.TargetName == target)
         {
             ModuleManager.s_ActivePlatformModule = current;
             current.OnActivate();
             break;
         }
     }
 }
Пример #11
0
        internal static IDevice GetDevice(string deviceId)
        {
            DevDevice devDevice;

            if (!DevDeviceList.FindDevice(deviceId, out devDevice))
            {
                throw new ApplicationException("Couldn't create device API for device: " + deviceId);
            }
            IPlatformSupportModule platformSupportModule = ModuleManager.FindPlatformSupportModule(devDevice.module);

            if (platformSupportModule != null)
            {
                return(platformSupportModule.CreateDevice(deviceId));
            }
            throw new ApplicationException("Couldn't find module for target: " + devDevice.module);
        }
Пример #12
0
        static void ChangeActivePlatformModuleTo(string target)
        {
            DeactivateActivePlatformModule();

            foreach (var module in platformSupportModules)
            {
                if (module.TargetName == target)
                {
                    s_ActivePlatformModule = module;
                    module.OnActivate();
                    return;
                }
            }

            // There are still some unmodularized platforms, so we can't throw yet
            //throw new ApplicationException("Couldn't find platform module for target: " + target);
        }
        private void FillCompilerOptions(List <string> arguments, out string argsPrefix)
        {
            argsPrefix = "/noconfig ";
            arguments.Add("/nostdlib+");
            arguments.Add("/preferreduilang:en-US");
            IPlatformSupportModule platformSupportModule = ModuleManager.FindPlatformSupportModule(ModuleManager.GetTargetStringFromBuildTarget(this.BuildTarget));
            ICompilationExtension  compilationExtension  = platformSupportModule.CreateCompilationExtension();

            arguments.AddRange(from r in this.GetClassLibraries()
                               select "/reference:\"" + r + "\"");
            arguments.AddRange(from r in compilationExtension.GetAdditionalAssemblyReferences()
                               select "/reference:\"" + r + "\"");
            arguments.AddRange(from r in compilationExtension.GetWindowsMetadataReferences()
                               select "/reference:\"" + r + "\"");
            arguments.AddRange(from d in compilationExtension.GetAdditionalDefines()
                               select "/define:" + d);
            arguments.AddRange(compilationExtension.GetAdditionalSourceFiles());
        }
Пример #14
0
        internal static List <string> GetJamTargets()
        {
            List <string> list = new List <string>();
            IEnumerator <IPlatformSupportModule> enumerator = platformSupportModules.GetEnumerator();

            try
            {
                while (enumerator.MoveNext())
                {
                    IPlatformSupportModule current = enumerator.Current;
                    list.Add(current.JamTarget);
                }
            }
            finally
            {
                if (enumerator == null)
                {
                }
                enumerator.Dispose();
            }
            return(list);
        }
Пример #15
0
        internal static string[] GetAdditionalReferencesForUserScripts()
        {
            List <string> list = new List <string>();
            IEnumerator <IPlatformSupportModule> enumerator = ModuleManager.platformSupportModules.GetEnumerator();

            try
            {
                while (enumerator.MoveNext())
                {
                    IPlatformSupportModule current = enumerator.Current;
                    list.AddRange(current.AssemblyReferencesForUserScripts);
                }
            }
            finally
            {
                if (enumerator == null)
                {
                }
                enumerator.Dispose();
            }
            return(list.ToArray());
        }
Пример #16
0
        internal static ICompilationExtension GetCompilationExtension(string target)
        {
            IEnumerator <IPlatformSupportModule> enumerator = platformSupportModules.GetEnumerator();

            try
            {
                while (enumerator.MoveNext())
                {
                    IPlatformSupportModule current = enumerator.Current;
                    if (current.TargetName == target)
                    {
                        return(current.CreateCompilationExtension());
                    }
                }
            }
            finally
            {
                if (enumerator == null)
                {
                }
                enumerator.Dispose();
            }
            return(new DefaultCompilationExtension());
        }
Пример #17
0
        private static IPlatformSupportModule FindPlatformSupportModule(string moduleName)
        {
            IEnumerator <IPlatformSupportModule> enumerator = platformSupportModules.GetEnumerator();

            try
            {
                while (enumerator.MoveNext())
                {
                    IPlatformSupportModule current = enumerator.Current;
                    if (current.TargetName == moduleName)
                    {
                        return(current);
                    }
                }
            }
            finally
            {
                if (enumerator == null)
                {
                }
                enumerator.Dispose();
            }
            return(null);
        }