コード例 #1
0
        private void _parse()
        {
            _dependencies.Add(_solutionFile);

            using (StreamReader stream = new StreamReader(_solutionFile.getFilesystemPath())) {
                Regex  regex = new Regex(@"Project\([\S]+\)[\s]+=[\s]+([^$]*)", RegexOptions.IgnoreCase);
                string line;

                while ((line = stream.ReadLine()) != null)
                {
                    MatchCollection matches = regex.Matches(line);

                    if (matches.Count > 0)
                    {
                        SourcePath projFile = _solutionFile.getNewSourcePath(matches[0].Groups[1].Value.Split("\", ".ToCharArray())[5]);
//-                        Console.WriteLine(String.Format("Found project file {0}", projFile.getFilesystemPath()));
                        VSProjectParser proj = new VSProjectParser(projFile);
                        _dependencies.AddRange(proj.getDependencies());
                        _outputs.AddRange(proj.getOutputs());
                    }
                }

                stream.Close();
            }
        }
コード例 #2
0
        private void parseCustomManifest(SourcePath basePath)
        {
            SourcePath manifest = basePath.getNewSourcePath("nubuild-manifest.txt");

            this.dependencies.Add(manifest);

            using (StreamReader stream = new StreamReader(IronRootDirectory.PathTo(manifest)))
            {
                string origline;

                while ((origline = stream.ReadLine()) != null)
                {
                    string line = origline.Trim();

                    if (line.Length == 0)
                    {
                        continue;
                    }

                    if (line.Substring(0, 1) == "#")
                    {
                        continue;
                    }

                    string[] parts = line.Split();

                    if (parts.Length != 2)
                    {
                        throw new UserError(string.Format("{0}: badly formed manifest line {1}", IronRootDirectory.PathTo(manifest), origline));
                    }

                    if ("output".Equals(parts[0]))
                    {
                        this.outputs.Add(new BuildObject(Path.Combine(basePath.getDirPath(), parts[1])));
                    }
                    else if ("dependency".Equals(parts[0]))
                    {
                        this.dependencies.Add(basePath.getNewSourcePath(parts[1]));
                    }
                }
            }
        }
コード例 #3
0
        private void parseCustomManifest(SourcePath basePath)
        {
            SourcePath manifest = basePath.getNewSourcePath("nubuild-manifest.txt");
            this.dependencies.Add(manifest);

            using (StreamReader stream = new StreamReader(IronRootDirectory.PathTo(manifest)))
            {
                string origline;

                while ((origline = stream.ReadLine()) != null)
                {
                    string line = origline.Trim();

                    if (line.Length == 0)
                    {
                        continue;
                    }

                    if (line.Substring(0, 1) == "#")
                    {
                        continue;
                    }

                    string[] parts = line.Split();

                    if (parts.Length != 2)
                    {
                        throw new UserError(string.Format("{0}: badly formed manifest line {1}", IronRootDirectory.PathTo(manifest), origline));
                    }

                    if ("output".Equals(parts[0]))
                    {
                        this.outputs.Add(new BuildObject(Path.Combine(basePath.getDirPath(), parts[1])));
                    }
                    else if ("dependency".Equals(parts[0]))
                    {
                        this.dependencies.Add(basePath.getNewSourcePath(parts[1]));
                    }
                }
            }
        }
コード例 #4
0
        private void _parse()
        {
            _dependencies.Add(_projectFile);

            using (XmlTextReader reader = new XmlTextReader(_projectFile.getFilesystemPath()))
            {
                while (reader.Read())
                {
                    if (reader.NodeType == XmlNodeType.Element)
                    {
                        if (String.Compare(reader.Name, "Compile") == 0)
                        {
                            _dependencies.Add(_projectFile.getNewSourcePath(reader.GetAttribute("Include")));
                        }
                        else if (String.Compare(reader.Name, "PropertyGroup") == 0)
                        {
                            _parseOutput(reader);
                        }
                    }

                }

                reader.Close();
            }

            if (_outputType != null && _assemblyName != null) //- && _outputPath != null)
            {
                string path = Path.Combine(_projectFile.getDirPath(), String.Format("{0}.{1}", _assemblyName, outputTypeToExtension(_outputType)));
                //-Console.WriteLine("{0}: generating {1}", _projectFile.getRelativePath(), path);
                _outputs.Add(new BuildObject(path));
            }
            else
            {
                throw new UserError(String.Format("Project {0} doesn't seem to have output specification in the expected format", _projectFile.getRelativePath()));
            }
        }