示例#1
0
文件: Project.cs 项目: elanwu123/dnx
        public Project(PackageSpec packageSpec)
        {
            BaseDirectory = Path.GetDirectoryName(packageSpec.FilePath);
            Metadata = packageSpec;
            Files = new ProjectFilesCollection(packageSpec.Properties, packageSpec.BaseDirectory, packageSpec.FilePath);

            // Load additional metadata from the project json
            EntryPoint = Metadata.Properties.GetValue<string>("entryPoint");

            var commands = Metadata.Properties["commands"] as JObject;
            if (commands != null)
            {
                foreach (var command in commands)
                {
                    Commands[command.Key] = command.Value.Value<string>();
                }
            }
        }
示例#2
0
        public Project(PackageSpec packageSpec)
        {
            BaseDirectory = Path.GetDirectoryName(packageSpec.FilePath);
            Metadata      = packageSpec;
            Files         = new ProjectFilesCollection(packageSpec.Properties, packageSpec.BaseDirectory, packageSpec.FilePath);

            // Load additional metadata from the project json
            EntryPoint = Metadata.Properties.GetValue <string>("entryPoint");

            var commands = Metadata.Properties["commands"] as JObject;

            if (commands != null)
            {
                foreach (var command in commands)
                {
                    Commands[command.Key] = command.Value.Value <string>();
                }
            }
        }
 internal static CompilationFiles GetCompilationFiles(this ProjectFilesCollection collection)
 {
     return(new CompilationFiles(
                collection.PreprocessSourceFiles,
                collection.SourceFiles));
 }