public static DubProject ReadPackageInformation(FilePath packageJsonPath, JsonReader r, IProgressMonitor monitor) { var defaultPackage = new DubProject(); defaultPackage.FileName = packageJsonPath; defaultPackage.BaseDirectory = packageJsonPath.ParentDirectory; defaultPackage.BeginLoad(); defaultPackage.AddProjectAndSolutionConfiguration(new DubProjectConfiguration { Name = GettextCatalog.GetString("Default"), Id = DubProjectConfiguration.DefaultConfigId }); while (r.Read()) { if (r.TokenType == JsonToken.PropertyName) { var propName = r.Value as string; defaultPackage.TryPopulateProperty(propName, r, monitor); } else if (r.TokenType == JsonToken.EndObject) { break; } } defaultPackage.Items.Add(new ProjectFile(packageJsonPath, BuildAction.None)); defaultPackage.EndLoad(); return(defaultPackage); }
public static DubProject ReadPackageInformation(FilePath packageJsonPath,JsonReader r, IProgressMonitor monitor) { var defaultPackage = new DubProject(); defaultPackage.FileName = packageJsonPath; defaultPackage.BaseDirectory = packageJsonPath.ParentDirectory; defaultPackage.BeginLoad (); defaultPackage.AddProjectAndSolutionConfiguration(new DubProjectConfiguration { Name = GettextCatalog.GetString("Default"), Id = DubProjectConfiguration.DefaultConfigId }); while (r.Read ()) { if (r.TokenType == JsonToken.PropertyName) { var propName = r.Value as string; defaultPackage.TryPopulateProperty (propName, r, monitor); } else if (r.TokenType == JsonToken.EndObject) break; } defaultPackage.Items.Add(new ProjectFile(packageJsonPath, BuildAction.None)); defaultPackage.EndLoad (); return defaultPackage; }