# File lib/buildr/java/compiler.rb, line 109
    def apt(*sources)
      sources = compile.sources if sources.empty?
      file(path_to(:target, 'generated/apt')=>sources) do |task|
        cmd_args = [ trace?(:apt) ? '-verbose' : '-nowarn' ]
        cmd_args << '-nocompile' << '-s' << task.name
        cmd_args << '-source' << compile.options.source if compile.options.source
        classpath = Buildr.artifacts(compile.dependencies).map(&:to_s).each { |t| task(t).invoke }
        cmd_args << '-classpath' << classpath.join(File::PATH_SEPARATOR) unless classpath.empty?
        cmd_args += (sources.map(&:to_s) - [task.name]).
          map { |file| File.directory?(file) ? FileList["#{file}/**/*.java"] : file }.flatten
        unless Buildr.application.options.dryrun
          info 'Running apt'
          trace (['apt'] + cmd_args).join(' ')
          Java.com.sun.tools.apt.Main.process(cmd_args.to_java(Java.java.lang.String)) == 0 or
            fail 'Failed to process annotations, see errors above'
        end
      end
    end