public void Process(AntidotePackagePipelineArgs args)
        {
            string packagePath = Path.Combine(Settings.PackagePath, String.Format("{0}.antidote{1}", Path.GetFileNameWithoutExtension(args.AntidotePackageProject.Name), Path.GetExtension(args.AntidotePackageProject.Name)));
            ISink<PackageEntry> writer = new PackageWriter(packagePath);
            ITaskOutput output = new DefaultOutput();
            writer.Initialize(new SimpleProcessingContext(output));
            PackageGenerator.GeneratePackage(args.AntidotePackageProject, writer);

            Context.ClientPage.ClientResponse.Alert("Antidote package generated");
        }
 public void Process(AntidotePackagePipelineArgs args)
 {
     string filename = Installer.GetFilename(args.SourcePackagePath);
     if (FileUtil.IsFile(filename))
     {
         string path = PathUtils.MapPath(filename);
         AntidotePackageReader antidotePackageReader = new AntidotePackageReader(path);
         args.AntidotePackageDefinition = antidotePackageReader.GetSources();
     }
 }
Ejemplo n.º 3
0
        public void Process(AntidotePackagePipelineArgs args)
        {
            foreach (var item in args.AntidotePackageDefinition.ItemsId)
            {
                item.SourceStatus = item.GetItem() == null ? SourceStatus.New : SourceStatus.Existing;
            }

            foreach (var fileInfo in args.AntidotePackageDefinition.FilesInfo)
            {
                fileInfo.SourceStatus = File.Exists(fileInfo.FileInfo.FullName) ? SourceStatus.Existing : SourceStatus.New;
            }
        }
        public void Process(AntidotePackagePipelineArgs args)
        {
            AntidotePackageDefinition packageDefinition = new AntidotePackageDefinition
                {
                    FilesInfo = args.AntidotePackageDefinition.GetFileSources(SourceStatus.New),
                    ItemsId = args.AntidotePackageDefinition.GetItemSources(SourceStatus.New)
                };
            string serializedSources = JsonConvert.SerializeObject(packageDefinition);

            AttributesContainer attributeses = new AttributesContainer();
            attributeses.AddAttribute("nonexistingsources", serializedSources);
            args.AntidotePackageProject.Metadata.Attributes = attributeses.ConvertoToPackageAttributes();
        }
        public void Process(AntidotePackagePipelineArgs args)
        {
            BehaviourOptions options = new BehaviourOptions(InstallMode.Undefined, MergeMode.Undefined);
            IProcessor<PackageEntry> transform = new InstallerConfigurationTransform(options);
            IConverter<Item, PackageEntry> converter = new ItemToEntryConverter();
            converter.Transforms.Add(transform);

            foreach (AntidoteFileSourceDefinition fileSourceDefinition in args.AntidotePackageDefinition.GetFileSources(SourceStatus.Existing))
            {
                ISource<PackageEntry> fileSource = fileSourceDefinition.FileInfo.ToFileSource();
                args.AntidotePackageProject.Sources.Add(fileSource);
            }

            foreach (AntidoteItemSourceDefinition itemSourceDefinition in args.AntidotePackageDefinition.GetItemSources(SourceStatus.Existing))
            {
                Item item = itemSourceDefinition.GetItem();
                ItemSource fileSource = item.GenerateItemSource(converter);
                args.AntidotePackageProject.Sources.Add(fileSource);
            }
        }
        protected void StartInstallation(Message message)
        {
            Assert.ArgumentNotNull(message, "message");
            string filename = Installer.GetFilename(PackageFile.Value);

            if (FileUtil.IsFile(filename))
            {
                var args = new AntidotePackagePipelineArgs
                {
                    SourcePackagePath      = filename,
                    AntidotePackageProject = new PackageProject {
                        Name = PackageFile.Value
                    }
                };
                CorePipeline.Run("GenerateAntidotePackage", args);
                Windows.Close();
            }
            else
            {
                Context.ClientPage.ClientResponse.Alert("Package not found");
                Active = "LoadPackage";
            }
        }
Ejemplo n.º 7
0
 public void Process(AntidotePackagePipelineArgs args)
 {
     args.AntidotePackageProject.Metadata.PackageName = "Antidote package";
     args.AntidotePackageProject.Metadata.Author = "Cognifide.AntidotePackage";
     args.AntidotePackageProject.Metadata.PostStep = "Cognifide.AntidotePackage.Utils.AntidotePackageInstallationPostStep, Cognifide.AntidotePackage";
 }
 public void Process(AntidotePackagePipelineArgs args)
 {
     string p = AssemblyDirectory() + "\\Cognifide.AntidotePackage.dll";
     ISource<PackageEntry> fileSource = new FileInfo(p).ToFileSource();
     args.AntidotePackageProject.Sources.Add(fileSource);
 }