File: Rakefile

package info (click to toggle)
ruby-psych 5.0.2-3.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 920 kB
  • sloc: ruby: 8,450; ansic: 894; java: 764; makefile: 14; sh: 4
file content (48 lines) | stat: -rw-r--r-- 1,907 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# require "bundler"
# Bundler::GemHelper.install_tasks

require "rake/testtask"
Rake::TestTask.new(:test) do |t|
  t.libs << "test/lib" << "test"
  t.ruby_opts << "-rhelper"
  t.test_files = FileList['test/**/test_*.rb']
  t.verbose = true
  t.warning = true
end

if RUBY_PLATFORM =~ /java/
  require 'rake/javaextensiontask'
  Rake::JavaExtensionTask.new("psych") do |ext|
    require 'fileutils'
    #require 'maven/ruby/maven'
    # force load of versions to overwrite constants with values from repo.
    #load './lib/psych/versions.rb'
    # uses Mavenfile to write classpath into pkg/classpath
    # and tell maven via system properties the snakeyaml version
    # this is basically the same as running from the commandline:
    # rmvn dependency:build-classpath -Dsnakeyaml.version='use version from Psych::DEFAULT_SNAKEYAML_VERSION here'
    #Maven::Ruby::Maven.new.exec('dependency:build-classpath', "-Dsnakeyaml.version=#{Psych::DEFAULT_SNAKEYAML_VERSION}", '-Dverbose=true')
    # ruby-maven is currently disabled since is not working as expected with the Debian maven repo and current
    # versions of maven itself and polyglot-maven.
    # ruby-maven is packaged but not uploaded to the archive yet for this reason, for more information:
    # https://bugs.debian.org/789877
    FileUtils.mkdir_p 'pkg'
    IO.write('pkg/classpath', '/usr/share/maven-repo/org/yaml/snakeyaml/1.x/snakeyaml-1.x.jar')
    ext.source_version = '1.8'
    ext.target_version = '1.8'
    ext.classpath = File.read('pkg/classpath')
    ext.ext_dir = 'ext/java'
  end
else
  require 'rake/extensiontask'
  Rake::ExtensionTask.new("psych")
end

task :sync_tool do
  require 'fileutils'
  FileUtils.cp "../ruby/tool/lib/core_assertions.rb", "./test/lib"
  FileUtils.cp "../ruby/tool/lib/envutil.rb", "./test/lib"
  FileUtils.cp "../ruby/tool/lib/find_executable.rb", "./test/lib"
end

task :default => [:compile, :test]