コード例 #1
0
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

        protected override void AddTaskSpecificOutputFiles(ref TrackedFileManager trackedFileManager, ITaskItem [] sources)
        {
            if (OutputFile != null)
            {
                trackedFileManager.AddDependencyForSources(new ITaskItem [] { OutputFile }, sources);
            }
        }
コード例 #2
0
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

        protected override void AddTaskSpecificDependencies(ref TrackedFileManager trackedFileManager, ITaskItem [] sources)
        {
            //
            // Mark additional dependencies for .class files contained within specified class paths.
            //

            foreach (ITaskItem source in sources)
            {
                string sourceFullPath = source.GetMetadata("FullPath");

                if (Directory.Exists(sourceFullPath))
                {
                    string [] classPathFiles = Directory.GetFiles(sourceFullPath, "*.class", SearchOption.AllDirectories);

                    List <ITaskItem> classPathFileItems = new List <ITaskItem> (classPathFiles.Length);

                    foreach (string classpath in classPathFiles)
                    {
                        classPathFileItems.Add(new TaskItem(classpath));
                    }

                    trackedFileManager.AddDependencyForSources(classPathFileItems.ToArray(), new ITaskItem [] { source });
                }
            }
        }
コード例 #3
0
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

        protected override void AddTaskSpecificOutputFiles(ref TrackedFileManager trackedFileManager, ITaskItem [] sources)
        {
            trackedFileManager.AddDependencyForSources(m_outputClassSourceFiles.ToArray(), sources);

            if (OutputJar != null)
            {
                trackedFileManager.AddDependencyForSources(new ITaskItem [] { OutputJar }, sources);
            }
        }
コード例 #4
0
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

        protected override void AddTaskSpecificOutputFiles(ref TrackedFileManager trackedFileManager, ITaskItem [] sources)
        {
            if (m_qualifiedOutputJars.Count > 0)
            {
                ITaskItem [] outputFiles = new ITaskItem [m_qualifiedOutputJars.Count];

                m_qualifiedOutputJars.Values.CopyTo(outputFiles, 0);

                trackedFileManager.AddDependencyForSources(outputFiles, sources);
            }
        }
コード例 #5
0
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

        protected override void AddTaskSpecificDependencies(ref TrackedFileManager trackedFileManager, ITaskItem [] sources)
        {
            //
            // Register additional 'forced include' usage for each of the sources.
            //

            foreach (ITaskItem source in sources)
            {
                try
                {
                    if (!string.IsNullOrWhiteSpace(source.GetMetadata("ForcedIncludeFiles")))
                    {
                        string [] forcedIncludeFiles = source.GetMetadata("ForcedIncludeFiles").Split(new char [] { ';' }, StringSplitOptions.RemoveEmptyEntries);

                        List <ITaskItem> forcedIncludeItems = new List <ITaskItem> ();

                        foreach (string file in forcedIncludeFiles)
                        {
                            //
                            // Supports including pre-compiled headers via '-include' when they need to be referenced without '.pch'/'.gch'. Fix this.
                            //

                            string fileFullPath = Path.GetFullPath(file);

                            if ((ToolExe.StartsWith("clang")) && (File.Exists(fileFullPath + ".pch")))
                            {
                                fileFullPath = fileFullPath + ".pch";
                            }
                            else if (File.Exists(fileFullPath + ".gch"))
                            {
                                fileFullPath = fileFullPath + ".gch";
                            }

                            //
                            // Also validate that we don't try adding dependencies to missing files, as this breaks tracking.
                            //

                            if (!File.Exists(fileFullPath))
                            {
                                throw new FileNotFoundException("Could not find 'forced include' dependency: " + fileFullPath);
                            }

                            forcedIncludeItems.Add(new TaskItem(fileFullPath));
                        }

                        trackedFileManager.AddDependencyForSources(forcedIncludeItems.ToArray(), new ITaskItem [] { source });
                    }
                }
                catch (Exception e)
                {
                    Log.LogWarningFromException(e, false);
                }
            }
        }
コード例 #6
0
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

        protected override void AddTaskSpecificOutputFiles(ref TrackedFileManager trackedFileManager, ITaskItem [] sources)
        {
            //
            // Collate the output files using 'GetOutputFilesFromPath' helper. This handles singular and directory output(s).
            //

            string fullOutputPath = OutputPath.GetMetadata("FullPath");

            ITaskItem [] outputFiles = GetOutputFilesFromPath(fullOutputPath);

            if (outputFiles != null)
            {
                trackedFileManager.AddDependencyForSources(outputFiles, sources);
            }
        }
コード例 #7
0
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

        protected override void AddTaskSpecificDependencies(ref TrackedFileManager trackedFileManager, ITaskItem [] sources)
        {
            foreach (ITaskItem source in sources)
            {
                string fullPath = source.GetMetadata("FullPath");

                //
                // Mark additional dependencies for .class files contained within specified folder class paths.
                //

                if (Directory.Exists(fullPath))
                {
                    string [] classPathFiles = Directory.GetFiles(fullPath, "*.class", SearchOption.AllDirectories);

                    List <ITaskItem> classPathFileItems = new List <ITaskItem> (classPathFiles.Length);

                    foreach (string classpath in classPathFiles)
                    {
                        classPathFileItems.Add(new TaskItem(classpath));
                    }

                    trackedFileManager.AddDependencyForSources(classPathFileItems.ToArray(), new ITaskItem [] { source });
                }

                //
                // Ensure configuration file(s) for MultiDex output are flagged as dependencies.
                //

                bool multiDex = (source.GetMetadata("MultiDex") == "true");

                string multiDexMainList = source.GetMetadata("MultiDexMainList");

                if (multiDex && !string.IsNullOrWhiteSpace(multiDexMainList) && File.Exists(multiDexMainList))
                {
                    ITaskItem multiDexMainListItem = new TaskItem(multiDexMainList);

                    trackedFileManager.AddDependencyForSources(new ITaskItem [] { multiDexMainListItem }, new ITaskItem [] { source });
                }
            }
        }