Beispiel #1
0
        IZipToolPolicy.Zip(
            ZipModule sender,
            Bam.Core.ExecutionContext context,
            Bam.Core.TokenizedString zipOutputPath,
            Bam.Core.TokenizedString zipInputPath)
        {
            var encapsulating = sender.GetEncapsulatingReferencedModule();

            var workspace = Bam.Core.Graph.Instance.MetaData as XcodeBuilder.WorkspaceMeta;
            var target    = workspace.EnsureTargetExists(encapsulating);

            target.EnsureOutputFileReferenceExists(
                zipOutputPath,
                XcodeBuilder.FileReference.EFileType.ZipArchive,
                XcodeBuilder.Target.EProductType.Utility);
            var configuration = target.GetConfiguration(encapsulating);

            configuration.SetProductName(Bam.Core.TokenizedString.CreateVerbatim("PythonZip"));

            var commands = new Bam.Core.StringArray();
            var args     = new Bam.Core.StringArray();

            args.Add(System.String.Format("cd {0} &&", Bam.Core.IOWrapper.EscapeSpacesInPath(zipInputPath.ToString())));
            args.Add(CommandLineProcessor.Processor.StringifyTool(sender.Tool as Bam.Core.ICommandLineTool));
            (sender.Settings as CommandLineProcessor.IConvertToCommandLine).Convert(args);
            args.Add(System.String.Format("{0}", Bam.Core.IOWrapper.EscapeSpacesInPath(zipOutputPath.ToString())));
            args.Add("*");
            args.Add("|| true"); // because zip returns 12 (nothing to do) upon success
            args.Add(CommandLineProcessor.Processor.TerminatingArgs(sender.Tool as Bam.Core.ICommandLineTool));
            commands.Add(args.ToString(' '));

            target.AddPreBuildCommands(commands, configuration);
        }
Beispiel #2
0
        public void It_Should_Execute()
        {
            ReportsEngModule.New();
            ReportsNorModule.New();
            ReportsEngUtvModule.New();
            ReportsNorUtvModule.New();
            DataSetModule.New();
            DataSourceModule.New();
            IntegrationPacksModule.New();
            BatchModule.New();
            DeploymentModule.New();
            SqlModule.New();
            InformationModule.New();
            ZipModule.New();
            ReportingModule.New();
            SsisModule.New();
            AllModule.New();
            EnglishExtendedModule.New();
            EnglishStandardModule.New();
            NorwegianExtendedModule.New();
            NorwegianStandardModule.New();
            var startpoint = CommandHandlerContainer.New().Resolve <StartpointAll>();

            startpoint.Start();
        }
        IZipToolPolicy.Zip(
            ZipModule sender,
            Bam.Core.ExecutionContext context,
            Bam.Core.TokenizedString zipOutputPath,
            Bam.Core.TokenizedString zipInputPath)
        {
            var zipDir = System.IO.Path.GetDirectoryName(zipOutputPath.ToString());

            Bam.Core.IOWrapper.CreateDirectoryIfNotExists(zipDir);

            var commandLine = new Bam.Core.StringArray();

            (sender.Settings as CommandLineProcessor.IConvertToCommandLine).Convert(commandLine);
            if (sender.Tool is ZipPosix)
            {
                commandLine.Add("-o");
                commandLine.Add(Bam.Core.IOWrapper.EscapeSpacesInPath(zipOutputPath.ToString()));
            }
            else
            {
                commandLine.Add(zipOutputPath.ToStringQuoteIfNecessary());
            }
            commandLine.Add("*");
            CommandLineProcessor.Processor.Execute(
                context,
                sender.Tool as Bam.Core.ICommandLineTool,
                commandLine,
                zipInputPath.ToString()
                );
        }
        IZipToolPolicy.Zip(
            ZipModule sender,
            Bam.Core.ExecutionContext context,
            Bam.Core.TokenizedString zipOutputPath,
            Bam.Core.TokenizedString zipInputPath)
        {
            var meta = new MakeFileBuilder.MakeFileMeta(sender);
            var rule = meta.AddRule();

            var dir = sender.CreateTokenizedString("@dir($(0))", zipOutputPath);

            dir.Parse();
            meta.CommonMetaData.AddDirectory(dir.ToString());
            rule.AddTarget(zipOutputPath);

            var commandLine = new Bam.Core.StringArray();

            (sender.Settings as CommandLineProcessor.IConvertToCommandLine).Convert(commandLine);

            var args = new Bam.Core.StringArray();

            args.Add(System.String.Format("cd {0};", zipInputPath.ToString()));
            args.Add(
                System.String.Format("{0} {1} -o {2} {3} {4}",
                                     CommandLineProcessor.Processor.StringifyTool(sender.Tool as Bam.Core.ICommandLineTool),
                                     commandLine.ToString(' '),
                                     zipOutputPath.ToString(),
                                     "*",
                                     CommandLineProcessor.Processor.TerminatingArgs(sender.Tool as Bam.Core.ICommandLineTool)
                                     )
                );
            rule.AddShellCommand(args.ToString(' '));
        }
Beispiel #5
0
        IZipToolPolicy.Zip(
            ZipModule sender,
            Bam.Core.ExecutionContext context,
            Bam.Core.TokenizedString zipOutputPath,
            Bam.Core.TokenizedString zipInputPath)
        {
            var encapsulating = sender.GetEncapsulatingReferencedModule();

            var solution = Bam.Core.Graph.Instance.MetaData as VSSolutionBuilder.VSSolution;
            var project  = solution.EnsureProjectExists(encapsulating);
            var config   = project.GetConfiguration(encapsulating);

            var args = new Bam.Core.StringArray();

            args.Add(System.String.Format("cd {0} &&", zipInputPath.ToStringQuoteIfNecessary()));
            args.Add(CommandLineProcessor.Processor.StringifyTool(sender.Tool as Bam.Core.ICommandLineTool));
            (sender.Settings as CommandLineProcessor.IConvertToCommandLine).Convert(args);
            args.Add(System.String.Format("{0}", zipOutputPath.ToStringQuoteIfNecessary()));
            args.Add("*");

            config.AddPreBuildCommand(args.ToString(' '));
        }