public <T extends BinaryToolSpec> Compiler<T> createCCompiler() {
   CommandLineTool<CCompileSpec> commandLineTool =
       commandLineTool("C compiler", install.getCompiler(targetPlatform));
   Transformer<CCompileSpec, CCompileSpec> specTransformer = addIncludePath();
   commandLineTool.withSpecTransformer(specTransformer);
   CCompiler cCompiler = new CCompiler(commandLineTool);
   return (Compiler<T>) new OutputCleaningCompiler<CCompileSpec>(cCompiler, ".obj");
 }
 public <T extends BinaryToolSpec> Compiler<T> createWindowsResourceCompiler() {
   CommandLineTool<WindowsResourceCompileSpec> commandLineTool =
       commandLineTool("Windows resource compiler", sdk.getResourceCompiler(targetPlatform));
   Transformer<WindowsResourceCompileSpec, WindowsResourceCompileSpec> specTransformer =
       addIncludePath();
   commandLineTool.withSpecTransformer(specTransformer);
   WindowsResourceCompiler windowsResourceCompiler =
       new WindowsResourceCompiler(commandLineTool);
   return (Compiler<T>)
       new OutputCleaningCompiler<WindowsResourceCompileSpec>(windowsResourceCompiler, ".res");
 }
    private <T extends BinaryToolSpec> CommandLineTool<T> commandLineTool(
        String toolName, File exe) {
      CommandLineTool<T> tool = new CommandLineTool<T>(toolName, exe, execActionFactory);

      // The visual C++ tools use the path to find other executables
      tool.withPath(
          install.getVisualCppBin(targetPlatform),
          sdk.getBinDir(targetPlatform),
          install.getCommonIdeBin());

      return tool;
    }
Example #4
0
  public WorkResult execute(StaticLibraryArchiverSpec spec) {
    deletePreviousOutput(spec);

    MutableCommandLineToolInvocation invocation = baseInvocation.copy();
    invocation.setArgs(arguments.transform(spec));
    return commandLineTool.execute(invocation);
  }
Example #5
0
 public WorkResult execute(WindowsResourceCompileSpec spec) {
   boolean didWork = false;
   boolean windowsPathLimitation = OperatingSystem.current().isWindows();
   MutableCommandLineToolInvocation invocation = baseInvocation.copy();
   spec = specTransformer.transform(spec);
   for (File sourceFile : spec.getSourceFiles()) {
     RcCompilerArgsTransformer argsTransformer =
         new RcCompilerArgsTransformer(sourceFile, windowsPathLimitation);
     invocation.setArgs(argsTransformer.transform(spec));
     invocation.setWorkDirectory(spec.getObjectFileDir());
     WorkResult result = commandLineTool.execute(invocation);
     didWork |= result.getDidWork();
   }
   return new SimpleWorkResult(didWork);
 }
 public <T extends LinkerSpec> Compiler<T> createLinker() {
   CommandLineTool<LinkerSpec> commandLineTool =
       commandLineTool("Linker", install.getLinker(targetPlatform));
   commandLineTool.withSpecTransformer(addLibraryPath());
   return (Compiler<T>) new LinkExeLinker(commandLineTool);
 }