Ejemplo n.º 1
0
        public MonoIsland ToMonoIsland(EditorScriptCompilationOptions options, string buildOutputDirectory, string projectPath = null)
        {
            bool buildingForEditor = (options & EditorScriptCompilationOptions.BuildingForEditor) == EditorScriptCompilationOptions.BuildingForEditor;
            bool developmentBuild  = (options & EditorScriptCompilationOptions.BuildingDevelopmentBuild) == EditorScriptCompilationOptions.BuildingDevelopmentBuild;

            var references = ScriptAssemblyReferences.Select(a => AssetPath.Combine(a.OutputDirectory, a.Filename));

            var referencesArray = references.Concat(References).ToArray();

            var responseFileProvider = Language?.CreateResponseFileProvider();

            if (!string.IsNullOrEmpty(projectPath) && responseFileProvider != null)
            {
                responseFileProvider.ProjectPath = projectPath;
            }

            List <string> reposeFiles = responseFileProvider?.Get(OriginPath) ?? new List <string>();

            var outputPath = AssetPath.Combine(buildOutputDirectory, Filename);

            return(new MonoIsland(BuildTarget,
                                  buildingForEditor,
                                  developmentBuild,
                                  CompilerOptions.AllowUnsafeCode,
                                  CompilerOptions.ApiCompatibilityLevel,
                                  Files,
                                  referencesArray,
                                  Defines,
                                  outputPath,
                                  reposeFiles.ToArray()));
        }
Ejemplo n.º 2
0
        public MonoIsland ToMonoIsland(EditorScriptCompilationOptions options, string buildOutputDirectory)
        {
            bool buildingForEditor = (options & EditorScriptCompilationOptions.BuildingForEditor) == EditorScriptCompilationOptions.BuildingForEditor;
            bool developmentBuild  = (options & EditorScriptCompilationOptions.BuildingDevelopmentBuild) == EditorScriptCompilationOptions.BuildingDevelopmentBuild;

            var references = ScriptAssemblyReferences.Select(a => AssetPath.Combine(a.OutputDirectory, a.Filename));

            var referencesArray = references.Concat(References).ToArray();

            var outputPath = AssetPath.Combine(buildOutputDirectory, Filename);

            return(new MonoIsland(BuildTarget,
                                  buildingForEditor,
                                  developmentBuild,
                                  CompilerOptions.AllowUnsafeCode,
                                  ApiCompatibilityLevel,
                                  Files,
                                  referencesArray,
                                  Defines,
                                  outputPath));
        }
Ejemplo n.º 3
0
 public string[] GetAllReferences()
 {
     return(References.Concat(ScriptAssemblyReferences.Select(a => a.FullPath)).ToArray());
 }
Ejemplo n.º 4
0
 public IEnumerable <ScriptAssembly> AllRecursiveScripAssemblyReferencesIncludingSelf() =>
 ScriptAssemblyReferences
 .SelectMany(a => a.AllRecursiveScripAssemblyReferencesIncludingSelf())
 .Concat(new[] { this });