# frozen_string_literal: true

inherit 'jar-dependencies:gemspec_with_system_jar:0' do
  # TODO: should not be needed with ruby-maven
  relative_path '../Mavenfile'
end

packaging 'pom'

gem 'jar-dependencies', '${jar-dependencies.version}'

jruby_plugin :gem, '${jruby.plugins.version}' do
  execute_goal :initialize
end

pom 'org.jruby:jruby', '${jruby.version}'

plugin('org.codehaus.mojo:exec-maven-plugin', '3.5.0',
       executable: :java,
       environmentVariables: { 'GEM_HOME' => '${gem.home}',
                               'GEM_PATH' => '${gem.home}' }) do
  execute_goal(:exec, phase: :test,
                      arguments: ['-classpath',
                                  xml('<classpath/>'),
                                  'org.jruby.Main',
                                  'test.rb'])
end

properties('gem.home' => '${project.basedir}/../../rubygems',
           'gem.path' => '${gem.home}')
