public static Installer FromExisting(string path) { IvyModule package = IvyParser.ParseFile <IvyModule>(path); if (package == null) { return(null); } string g = Path.GetFileName(path).Substring("task-installer-".Length); return(new Installer(package, new Guid(g))); }
public virtual void LoadFromCache() { try { if (File.Exists(this.IndexCache)) { ModuleRepository repository = IvyParser.Deserialize <ModuleRepository>(File.ReadAllText(this.IndexCache)); this.Packages = repository.Modules; } } catch (Exception exception) { Console.WriteLine("Error loading index cache {0}: {1}\n{2}", this.IndexCache, exception, IvyParser.ErrorException); } }
private static InternalPackageInfo Parse(string moduleFile) { if (moduleFile == null) { return(null); } IvyModule ivyModule = IvyParser.ParseFile <IvyModule>(moduleFile); if (IvyParser.HasErrors) { Console.WriteLine("Error parsing module description from {0}. {1}", moduleFile, IvyParser.ErrorMessage); return(null); } return(new InternalPackageInfo { module = ivyModule, package = ivyModule.ToPackageInfo() }); }
public override bool Verify() { if (this.xml == null) { return(false); } try { base.Result = IvyParser.Parse <object>(this.xml); if (IvyParser.HasErrors) { return(false); } } catch (Exception exception) { Console.WriteLine(exception); return(false); } return(true); }