<commit_before>class Doubleshot::CLI::Commands::Jar < Doubleshot::CLI

  def self.summary
    <<-EOS.margin
      Package your project as a JAR.
    EOS
  end

  def self.options
    Options.new do |options|
      options.banner = "Usage: doubleshot jar"
      options.separator ""
      options.separator "Options"

      options.test = true
      options.on "--no-test", "Disable testing as a build prerequisite." do
        options.test = false
      end

      options.separator ""
      options.separator "Summary: #{summary}"
    end
  end

  def self.start(args)
    options = self.options.parse!(args)
    doubleshot = Doubleshot::current

    Doubleshot::CLI::Commands::Build.start([])

    unless Pathname::glob(doubleshot.config.source.java + "**/*.java").empty?
      target = doubleshot.config.target

      jarfile = (target + "#{doubleshot.config.project}.jar")
      jarfile.delete if jarfile.exist?

      ant.jar jarfile: jarfile, basedir: target do
        manifest{
          attribute(:name => "Main-Class", :value => doubleshot.config.java_main)
        }
        doubleshot.lockfile.jars.each do |jar|
          zipfileset src: jar.path.expand_path, excludes: "META-INF/*.SF"
        end
      end
    end

    return 0
  end
end
<commit_msg>Add --sparse option to jar command.<commit_after>class Doubleshot::CLI::Commands::Jar < Doubleshot::CLI

  def self.summary
    <<-EOS.margin
      Package your project as a JAR.
    EOS
  end

  def self.options
    Options.new do |options|
      options.banner = "Usage: doubleshot jar"
      options.separator ""
      options.separator "Options"

      options.test = true
      options.on "--no-test", "Disable testing as a build prerequisite." do
        options.test = false
      end

      options.sparse = false
      options.on "--sparse", "Don't include JAR dependencies in your JAR. (For example, if you want to use Maven.)" do
        options.sparse = true
      end

      options.separator ""
      options.separator "Summary: #{summary}"
    end
  end

  def self.start(args)
    options = self.options.parse!(args)
    doubleshot = Doubleshot::current

    Doubleshot::CLI::Commands::Build.start([])

    unless Pathname::glob(doubleshot.config.source.java + "**/*.java").empty?
      target = doubleshot.config.target

      jarfile = (target + "#{doubleshot.config.project}.jar")
      jarfile.delete if jarfile.exist?

      ant.jar jarfile: jarfile, basedir: target do
        manifest{
          attribute(:name => "Main-Class", :value => doubleshot.config.java_main)
        }
        unless options.sparse
          doubleshot.lockfile.jars.each do |jar|
            zipfileset src: jar.path.expand_path, excludes: "META-INF/*.SF"
          end
        end
      end
    end

    return 0
  end
end

{'fraction_non_alphanumeric': 0.11617067049121549, 'fraction_numerical': 0.0007171029042667623, 'mean_word_length': 2.4444444444444446, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2988900', 'n_tokens_mistral': 892, 'n_tokens_neox': 845, 'n_words': 211}