Beispiel #1
0
        public static bool UseDotNetCore(ScriptAssembly scriptAssembly)
        {
            PlayerSettings.WSACompilationOverrides compilationOverrides = PlayerSettings.WSA.compilationOverrides;
            bool flag = scriptAssembly.BuildTarget == BuildTarget.WSAPlayer && compilationOverrides != PlayerSettings.WSACompilationOverrides.None;

            return(flag && (WSAHelpers.IsCSharpAssembly(scriptAssembly) || (compilationOverrides != PlayerSettings.WSACompilationOverrides.UseNetCorePartially && WSAHelpers.IsCSharpFirstPassAssembly(scriptAssembly))));
        }
Beispiel #2
0
        public static bool UseDotNetCore(string path, BuildTarget buildTarget, EditorBuildRules.TargetAssembly[] customTargetAssemblies)
        {
            PlayerSettings.WSACompilationOverrides compilationOverrides = PlayerSettings.WSA.compilationOverrides;
            bool   flag     = buildTarget == BuildTarget.WSAPlayer && compilationOverrides != PlayerSettings.WSACompilationOverrides.None;
            string fileName = Path.GetFileName(path);

            return(flag && (WSAHelpers.IsCSharpAssembly(path, customTargetAssemblies) || (compilationOverrides != PlayerSettings.WSACompilationOverrides.UseNetCorePartially && WSAHelpers.IsCSharpFirstPassAssembly(fileName, customTargetAssemblies))));
        }
Beispiel #3
0
        static bool IsPrecompiledAssemblyCompatibleWithScriptAssembly(PrecompiledAssembly compiledAssembly, ScriptAssembly scriptAssembly)
        {
            bool useDotNet = WSAHelpers.UseDotNetCore(scriptAssembly);

            if (useDotNet)
            {
                bool compiledAssemblyCompatibleWithDotNet = (compiledAssembly.Flags & AssemblyFlags.UseForDotNet) == AssemblyFlags.UseForDotNet;
                return(compiledAssemblyCompatibleWithDotNet);
            }

            bool compiledAssemblyCompatibleWithMono = (compiledAssembly.Flags & AssemblyFlags.UseForMono) == AssemblyFlags.UseForMono;

            return(compiledAssemblyCompatibleWithMono);
        }
        public static string[] GetSystemLibraryReferences(ApiCompatibilityLevel apiCompatibilityLevel, BuildTarget buildTarget, SupportedLanguage supportedLanguage,
                                                          bool buildingForEditor, string assemblyName)
        {
            if (WSAHelpers.BuildingForDotNet(buildTarget, buildingForEditor, assemblyName))
            {
                return(new string[0]);
            }

            // The language may not be compatible with these additional references
            if (supportedLanguage != null && !supportedLanguage.CompilerRequiresAdditionalReferences())
            {
                return(new string[0]);
            }

            return(GetCachedSystemLibraryReferences(apiCompatibilityLevel));
        }
Beispiel #5
0
        private static bool IsCompiledAssemblyCompatibleWithTargetAssembly(PrecompiledAssembly compiledAssembly, EditorBuildRules.TargetAssembly targetAssembly, BuildTarget buildTarget, EditorBuildRules.TargetAssembly[] customTargetAssemblies)
        {
            bool flag = WSAHelpers.UseDotNetCore(targetAssembly.Filename, buildTarget, customTargetAssemblies);
            bool result;

            if (flag)
            {
                bool flag2 = (compiledAssembly.Flags & AssemblyFlags.UseForDotNet) == AssemblyFlags.UseForDotNet;
                result = flag2;
            }
            else
            {
                bool flag3 = (compiledAssembly.Flags & AssemblyFlags.UseForMono) == AssemblyFlags.UseForMono;
                result = flag3;
            }
            return(result);
        }