public static ProjectJsonFile Read(DnxProject project) { var jsonFile = new ProjectJsonFile(project.BaseDirectory.Combine("project.json")); jsonFile.Read(); return(jsonFile); }
public void RemoveNuGetPackage(string frameworkShortName, string packageId) { var jsonFile = ProjectJsonFile.Read(this); if (jsonFile.Exists) { jsonFile.RemoveNuGetPackage(frameworkShortName, packageId); jsonFile.Save(); FileService.NotifyFileChanged(jsonFile.Path); } else { LoggingService.LogDebug("Unable to find project.json '{0}'", jsonFile.Path); } }
public void AddNuGetPackages(IEnumerable <NuGetPackageToAdd> packagesToAdd) { var jsonFile = ProjectJsonFile.Read(this); if (jsonFile.Exists) { jsonFile.AddNuGetPackages(packagesToAdd); jsonFile.Save(); FileService.NotifyFileChanged(jsonFile.Path); } else { LoggingService.LogDebug("Unable to find project.json '{0}'", jsonFile.Path); } }
public bool HasTestRunner() { if (hasTestRunner.HasValue) { return(hasTestRunner.Value); } try { var jsonFile = ProjectJsonFile.Read(this); if (jsonFile.Exists) { hasTestRunner = jsonFile.HasTestRunner(); return(hasTestRunner.Value); } } catch (Exception ex) { LoggingService.LogError("Unable to read project.json file", ex); } return(false); }
protected override void OnReferenceRemovedFromProject(ProjectReferenceEventArgs e) { base.OnReferenceRemovedFromProject(e); if (addingReferences) { return; } if (e.ProjectReference.ReferenceType == ReferenceType.Project) { var jsonFile = ProjectJsonFile.Read(this); if (jsonFile.Exists) { jsonFile.RemoveProjectReference(e.ProjectReference); jsonFile.Save(); FileService.NotifyFileChanged(jsonFile.Path); } else { LoggingService.LogDebug("Unable to find project.json '{0}'", jsonFile.Path); } } }
public static ProjectJsonFile Read(DnxProject project) { var jsonFile = new ProjectJsonFile (project.BaseDirectory.Combine ("project.json")); jsonFile.Read (); return jsonFile; }