<commit_before>#
require File.join(File.dirname(__FILE__),'..','jake.rb')

namespace "config" do
  task :android => :common do

    if RUBY_PLATFORM =~ /(win|w)32$/
      $all_files_mask = "*.*"
      $exe_ext = ".exe"
      $bat_ext = ".bat"
    else
      $all_files_mask = "*"
      $exe_ext = ""
      $bat_ext = ""
    end

    $deploydir = File.join($basedir,'deploy','android')
    $excludelib = ['**/singleton.rb','**/rational.rb','**/TestServe.rb','**/rhoframework.rb','**/date.rb']

    $java = $config["env"]["paths"]["java"]
    $keytool = File.join( $java, "keytool" + $exe_ext )
    $jarsigner = File.join( $java, "jarsigner" + $exe_ext )

    $androidsdk = $config["env"]["paths"]["android"]
    $androidplatform = "android-1.1"

    $dx = File.join( $androidsdk, "platforms", $androidplatform, "tools", "dx" + $bat_ext )
    $aapt = File.join( $androidsdk, "platforms", $androidplatform, "tools", "aapt" + $exe_ext )
    $apkbuilder = File.join( $androidsdk, "tools", "apkbuilder" + $bat_ext )
    $adb = File.join( $androidsdk, "tools", "adb" + $exe_ext )
    $emulator = File.join( $androidsdk, "tools", "emulator" + $exe_ext )

    $keystoredir = ENV['HOME'] + "/.rhomobile"
    $keystore = $keystoredir + "/keystore"
    $storepass = "81719ef3a881469d96debda3112854eb"
    $keypass = $storepass

  end
end

task :loadframework do
  require 'rhodes-framework'
  puts $rhodeslib
end

namespace "bundle" do
  task :android =>  ["config:android", "loadframework", "makedirs"] do
    android = $config["env"]["paths"]["android"]

    rm_rf $srcdir
    mkdir_p $srcdir
    mkdir_p File.join($srcdir,'apps')

    compileERB = File.join($compileERBbase,'bb.rb')
    xruby =  File.join($res,'xruby-0.3.3.jar')

    dest = $srcdir 
    chdir $rhodeslib
    Dir.glob("*").each { |f| 
      src = f
      cp_r src,dest
    }
    chdir dest
    Dir.glob("**/rhodes-framework.rb").each {|f| rm f}
    Dir.glob("**/erb.rb").each {|f| rm f}
    Dir.glob("**/find.rb").each {|f| rm f}
    $excludelib.each {|e| Dir.glob(e).each {|f| rm f}}

    chdir $basedir
#throw "ME"
    cp_r 'app',File.join($srcdir,'apps')
    cp_r 'public', File.join($srcdir,'apps')
    cp   'rhoconfig.txt', File.join($srcdir,'apps')
    #cp   'index.erb', File.join($srcdir,'apps')
    #cp   'layout.erb', File.join($srcdir,'apps')
    #cp   'loading.html', File.join($srcdir,'apps')
    cp   $appmanifest, $srcdir
    puts `ruby #{$srcdir}/createAppManifest.rb`
    rm   File.join($srcdir,'createAppManifest.rb')
    cp   compileERB, $srcdir
    puts `ruby #{$srcdir}/bb.rb`
    
    chdir $bindir
    puts `java -jar #{xruby} -c RhoBundle`
    chdir $srcdir
    Dir.glob("**/*.rb") { |f| rm f }
    Dir.glob("**/*.erb") { |f| rm f }
    puts `jar uf ../RhoBundle.jar apps/#{$all_files_mask}`
    mkdir_p "../assets"
    cp_r "apps","../assets"
    cp File.join($prebuilt,"android","loading.html"), "../assets/apps"
    
    chdir $basedir
    
    rm_rf $targetdir
    mkdir_p $targetdir

    chdir $bindir
  
    classes = File.join($prebuilt,"android","classes")
    rhobundle = File.join($bindir,"RhoBundle.jar")
    dexfile = File.join($bindir,"classes.dex")

    puts "Running dx utility"
    puts `#{$dx} --dex "--output=#{dexfile}" #{classes} #{rhobundle}`

    manifest = File.join($prebuilt,"android","AndroidManifest.xml")
    resource = File.join($prebuilt,"android","res")
    assets = File.join($bindir,"assets")
    androidjar = File.join(android,"platforms","android-1.1","android.jar")
    resourcepkg = File.join($bindir,"rhodes.ap_")

    puts "Packaging Assets and Jars"
    puts `#{$aapt} package -f -M "#{manifest}" -S "#{resource}" -A "#{assets}" -I "#{androidjar}" -F "#{resourcepkg}"`


    chdir $basedir
  end
end
<commit_msg>Fix problem with spaces in path for android gem build<commit_after>#
require File.join(File.dirname(__FILE__),'..','jake.rb')

namespace "config" do
  task :android => :common do

    if RUBY_PLATFORM =~ /(win|w)32$/
      $all_files_mask = "*.*"
      $exe_ext = ".exe"
      $bat_ext = ".bat"
    else
      $all_files_mask = "*"
      $exe_ext = ""
      $bat_ext = ""
    end

    $deploydir = File.join($basedir,'deploy','android')
    $excludelib = ['**/singleton.rb','**/rational.rb','**/TestServe.rb','**/rhoframework.rb','**/date.rb']

    $java = $config["env"]["paths"]["java"]
    $keytool = File.join( $java, "keytool" + $exe_ext )
    $jarsigner = File.join( $java, "jarsigner" + $exe_ext )

    $androidsdk = $config["env"]["paths"]["android"]
    $androidplatform = "android-1.1"

    $dx = File.join( $androidsdk, "platforms", $androidplatform, "tools", "dx" + $bat_ext )
    $aapt = File.join( $androidsdk, "platforms", $androidplatform, "tools", "aapt" + $exe_ext )
    $apkbuilder = File.join( $androidsdk, "tools", "apkbuilder" + $bat_ext )
    $adb = File.join( $androidsdk, "tools", "adb" + $exe_ext )
    $emulator = File.join( $androidsdk, "tools", "emulator" + $exe_ext )

    $keystoredir = ENV['HOME'] + "/.rhomobile"
    $keystore = $keystoredir + "/keystore"
    $storepass = "<PASSWORD>"
    $keypass = $storepass

  end
end

task :loadframework do
  require 'rhodes-framework'
  puts $rhodeslib
end

namespace "bundle" do
  task :android =>  ["config:android", "loadframework", "makedirs"] do
    android = $config["env"]["paths"]["android"]

    rm_rf $srcdir
    mkdir_p $srcdir
    mkdir_p File.join($srcdir,'apps')

    compileERB = File.join($compileERBbase,'bb.rb')
    xruby =  File.join($res,'xruby-0.3.3.jar')

    dest = $srcdir 
    chdir $rhodeslib
    Dir.glob("*").each { |f| 
      src = f
      cp_r src,dest
    }
    chdir dest
    Dir.glob("**/rhodes-framework.rb").each {|f| rm f}
    Dir.glob("**/erb.rb").each {|f| rm f}
    Dir.glob("**/find.rb").each {|f| rm f}
    $excludelib.each {|e| Dir.glob(e).each {|f| rm f}}

    chdir $basedir
#throw "ME"
    cp_r 'app',File.join($srcdir,'apps')
    cp_r 'public', File.join($srcdir,'apps')
    cp   'rhoconfig.txt', File.join($srcdir,'apps')
    #cp   'index.erb', File.join($srcdir,'apps')
    #cp   'layout.erb', File.join($srcdir,'apps')
    #cp   'loading.html', File.join($srcdir,'apps')
    cp   $appmanifest, $srcdir
    puts `ruby "#{$srcdir}/createAppManifest.rb"`
    rm   File.join($srcdir,'createAppManifest.rb')
    cp   compileERB, $srcdir
    puts `ruby "#{$srcdir}/bb.rb"`
    
    chdir $bindir
    puts `java -jar #{xruby} -c RhoBundle`
    chdir $srcdir
    Dir.glob("**/*.rb") { |f| rm f }
    Dir.glob("**/*.erb") { |f| rm f }
    puts `jar uf ../RhoBundle.jar apps/#{$all_files_mask}`
    mkdir_p "../assets"
    cp_r "apps","../assets"
    cp File.join($prebuilt,"android","loading.html"), "../assets/apps"
    
    chdir $basedir
    
    rm_rf $targetdir
    mkdir_p $targetdir

    chdir $bindir
  
    classes = File.join($prebuilt,"android","classes")
    rhobundle = File.join($bindir,"RhoBundle.jar")
    dexfile = File.join($bindir,"classes.dex")

    puts "Running dx utility"
    puts `#{$dx} --dex "--output=#{dexfile}" "#{classes}" "#{rhobundle}"`

    manifest = File.join($prebuilt,"android","AndroidManifest.xml")
    resource = File.join($prebuilt,"android","res")
    assets = File.join($bindir,"assets")
    androidjar = File.join(android,"platforms","android-1.1","android.jar")
    resourcepkg = File.join($bindir,"rhodes.ap_")

    puts "Packaging Assets and Jars"
    puts `#{$aapt} package -f -M "#{manifest}" -S "#{resource}" -A "#{assets}" -I "#{androidjar}" -F "#{resourcepkg}"`


    chdir $basedir
  end
end

{'fraction_non_alphanumeric': 0.2004270082732853, 'fraction_numerical': 0.005204163330664532, 'mean_word_length': 3.3124280782508633, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '7238043', 'n_tokens_mistral': 2889, 'n_tokens_neox': 2859, 'n_words': 549}