<commit_before>def java_classpath_arg # myriad of ways to discover JRuby classpath
  begin
    cpath  = Java::java.lang.System.getProperty('java.class.path').split(File::PATH_SEPARATOR)
    cpath += Java::java.lang.System.getProperty('sun.boot.class.path').split(File::PATH_SEPARATOR)
    cpath << '../activerecord-jdbc-adapter/target/activerecord-jdbc-1.0.0.jar'
    jruby_cpath = cpath.compact.join(File::PATH_SEPARATOR)
  rescue => e
  end
  unless jruby_cpath
    jruby_cpath = ENV['JRUBY_PARENT_CLASSPATH'] || ENV['JRUBY_HOME'] &&
      FileList["#{ENV['JRUBY_HOME']}/lib/*.jar"].join(File::PATH_SEPARATOR)
  end
  jruby_cpath ? "-cp \"#{jruby_cpath}\"" : ""
end

jar_name = File.join(*%w(lib arjdbc sybase sybase_adapter_java.jar))

desc "Compile the native Java code."
task :java_compile do

  p java_classpath_arg

  debug = ENV['DEBUG'] ? '-g' : ''
  pkg_classes = File.join(*%w(pkg classes))
  mkdir_p pkg_classes
  sh "javac -target 1.5 -source 1.5 #{debug} -d pkg/classes #{java_classpath_arg} #{FileList['src/java/**/*.java'].join(' ')}"
  sh "jar cf #{jar_name} -C #{pkg_classes} ."
end
file jar_name => :java_compile
<commit_msg>better classpath to compile java<commit_after>def java_classpath_arg # myriad of ways to discover JRuby classpath
  begin
    cpath  = Java::java.lang.System.getProperty('java.class.path').split(File::PATH_SEPARATOR)
    cpath += Java::java.lang.System.getProperty('sun.boot.class.path').split(File::PATH_SEPARATOR)
    cpath << "#{ENV['JRUBY_HOME']}/lib/ruby/gems/1.8/gems/activerecord-jdbc-adapter-1.1.1/lib/arjdbc/jdbc/adapter_java.jar"
    jruby_cpath = cpath.compact.join(File::PATH_SEPARATOR)
  rescue => e
  end
  unless jruby_cpath
    jruby_cpath = ENV['JRUBY_PARENT_CLASSPATH'] || ENV['JRUBY_HOME'] &&
      FileList["#{ENV['JRUBY_HOME']}/lib/*.jar"].join(File::PATH_SEPARATOR)
  end
  jruby_cpath ? "-cp \"#{jruby_cpath}\"" : ""
end

jar_name = File.join(*%w(lib arjdbc sybase sybase_adapter_java.jar))

desc "Compile the native Java code."
task :java_compile do

  p java_classpath_arg

  debug = ENV['DEBUG'] ? '-g' : ''
  pkg_classes = File.join(*%w(pkg classes))
  mkdir_p pkg_classes
  sh "javac -target 1.5 -source 1.5 #{debug} -d pkg/classes #{java_classpath_arg} #{FileList['src/java/**/*.java'].join(' ')}"
  sh "jar cf #{jar_name} -C #{pkg_classes} ."
end
file jar_name => :java_compile

{'fraction_non_alphanumeric': 0.16751700680272108, 'fraction_numerical': 0.006802721088435374, 'mean_word_length': 4.602380952380952, 'pattern_counts': {'":': 0, '<': 7, '<?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': '1960758', 'n_tokens_mistral': 938, 'n_tokens_neox': 887, 'n_words': 158}