Exemplo n.º 1
0
        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)));
        }
Exemplo n.º 2
0
 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);
     }
 }
Exemplo n.º 3
0
        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()
            });
        }
Exemplo n.º 4
0
 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);
 }