IObjCopyToolPolicy.ObjCopy( ObjCopyModule sender, Bam.Core.ExecutionContext context, Bam.Core.TokenizedString originalPath, Bam.Core.TokenizedString copiedPath) { var mode = (sender.Settings as IObjCopyToolSettings).Mode; // if linking debug data, add to the strip var meta = (EObjCopyToolMode.AddGNUDebugLink == mode) ? sender.SourceModule.MetaData as MakeFileBuilder.MakeFileMeta : new MakeFileBuilder.MakeFileMeta(sender); var rule = (EObjCopyToolMode.AddGNUDebugLink == mode) ? meta.Rules[0] :meta.AddRule(); if (EObjCopyToolMode.AddGNUDebugLink == mode) { rule.AddOrderOnlyDependency(copiedPath.Parse()); } else { meta.CommonMetaData.AddDirectory(sender.CreateTokenizedString("@dir($(0))", copiedPath).Parse()); var sourceFilename = System.IO.Path.GetFileName(originalPath.Parse()); rule.AddTarget(copiedPath, variableName: "objcopy_" + sourceFilename); rule.AddPrerequisite(originalPath); } var commandLine = new Bam.Core.StringArray(); (sender.Settings as CommandLineProcessor.IConvertToCommandLine).Convert(commandLine); rule.AddShellCommand(System.String.Format("{0} {1} {2}", CommandLineProcessor.Processor.StringifyTool(sender.Tool as Bam.Core.ICommandLineTool), commandLine.ToString(' '), CommandLineProcessor.Processor.TerminatingArgs(sender.Tool as Bam.Core.ICommandLineTool))); }
IObjCopyToolPolicy.ObjCopy( ObjCopyModule sender, Bam.Core.ExecutionContext context, Bam.Core.TokenizedString originalPath, Bam.Core.TokenizedString copiedPath) { var mode = (sender.Settings as IObjCopyToolSettings).Mode; // if linking debug data, add to the strip var meta = (EObjCopyToolMode.AddGNUDebugLink == mode) ? sender.SourceModule.MetaData as MakeFileBuilder.MakeFileMeta : new MakeFileBuilder.MakeFileMeta(sender); var rule = (EObjCopyToolMode.AddGNUDebugLink == mode) ? meta.Rules[0] :meta.AddRule(); if (EObjCopyToolMode.AddGNUDebugLink == mode) { rule.AddOrderOnlyDependency(copiedPath.Parse()); } else { meta.CommonMetaData.Directories.AddUnique(sender.CreateTokenizedString("@dir($(0))", copiedPath).Parse()); var sourceFilename = System.IO.Path.GetFileName(originalPath.Parse()); rule.AddTarget(copiedPath, variableName: "objcopy_" + sourceFilename); rule.AddPrerequisite(originalPath); } var commandLine = new Bam.Core.StringArray(); (sender.Settings as CommandLineProcessor.IConvertToCommandLine).Convert(commandLine); rule.AddShellCommand(System.String.Format("{0} {1} {2}", CommandLineProcessor.Processor.StringifyTool(sender.Tool as Bam.Core.ICommandLineTool), commandLine.ToString(' '), CommandLineProcessor.Processor.TerminatingArgs(sender.Tool as Bam.Core.ICommandLineTool))); }
IObjCopyToolPolicy.ObjCopy( ObjCopyModule sender, Bam.Core.ExecutionContext context, Bam.Core.TokenizedString originalPath, Bam.Core.TokenizedString copiedPath) { var copiedDir = System.IO.Path.GetDirectoryName(copiedPath.ToString()); Bam.Core.IOWrapper.CreateDirectoryIfNotExists(copiedDir); var commandLine = new Bam.Core.StringArray(); (sender.Settings as CommandLineProcessor.IConvertToCommandLine).Convert(commandLine); CommandLineProcessor.Processor.Execute(context, sender.Tool as Bam.Core.ICommandLineTool, commandLine); }
IObjCopyToolPolicy.ObjCopy( ObjCopyModule sender, Bam.Core.ExecutionContext context, Bam.Core.TokenizedString originalPath, Bam.Core.TokenizedString copiedPath) { var copiedDir = System.IO.Path.GetDirectoryName(copiedPath.Parse()); if (!System.IO.Directory.Exists(copiedDir)) { System.IO.Directory.CreateDirectory(copiedDir); } var commandLine = new Bam.Core.StringArray(); (sender.Settings as CommandLineProcessor.IConvertToCommandLine).Convert(commandLine); CommandLineProcessor.Processor.Execute(context, sender.Tool as Bam.Core.ICommandLineTool, commandLine); }