Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 017ba3f535f6
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: d762afa2eb13
Choose a head ref
  • 3 commits
  • 3 files changed
  • 1 contributor

Commits on Mar 8, 2016

  1. Copy the full SHA
    9b9ec30 View commit details
  2. Copy the full SHA
    8d00ca1 View commit details
  3. Copy the full SHA
    d762afa View commit details
6 changes: 2 additions & 4 deletions lib/ruby/truffle/jruby+truffle/gem_ci/default.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
declare_options git: ['--git URL', 'Path to the gem\'s repository', STORE_NEW_VALUE, nil],
version: ['--version VERSION', 'Version of the gem', STORE_NEW_VALUE, nil]

unless File.exists? repository_dir
git_clone option(:git),
tag: get_git_tag(option(:version))
end
git_clone option(:git) unless File.exists? repository_dir
git_checkout git_tag option(:version)

delete_gemfile_lock!
use_only_https_git_paths!
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
:setup:
:file:
bundler.rb: |
module Bundler
BundlerError = Class.new(Exception)
def self.setup(*args)
end
end
31 changes: 24 additions & 7 deletions lib/ruby/truffle/jruby+truffle/lib/runner.rb
Original file line number Diff line number Diff line change
@@ -579,7 +579,12 @@ def do_definition(name, raise: true)
else
puts "Using CI definition: #{ci_file}"
catch :cancel_ci! do
instance_eval File.read(ci_file), ci_file, 1
begin
instance_eval File.read(ci_file), ci_file, 1
rescue => e
puts format('%s: %s\n%s', e.class, e.message, e.backtrace.join("\n"))
result false
end
end

return true
@@ -620,17 +625,29 @@ def option(key)
@options.fetch(key)
end

def git_clone(url, branch: 'master', tag: nil, commit: nil)
execute_cmd "git clone -b #{branch} #{url} #{repository_name}", dir: working_dir, print: true
execute_cmd "git checkout #{tag || commit}", dir: working_dir, print: true if tag || commit
def git_clone(url)
execute_cmd %W[git clone #{url} #{repository_name}], dir: working_dir, print: true
end

def git_checkout(target)
return if target.nil?
execute_cmd %W[git checkout #{target}], dir: repository_dir, print: true
end

def get_git_tag(version)
tag = `git tags -l`.lines.find { |l| l.include? version }
raise "fetching tag for #{version} version failed" unless $?.success?
def git_tag(version)
return nil if version.nil?

tag = git_tags.find { |l| l.include? version }
raise "tag for #{version} was not found" if tag.nil?
tag
end

def git_tags
tags = Dir.chdir(repository_dir) { `git tag -l`.lines }
raise "fetching tags failed" if !$?.success?
tags
end

def setup
Dir.chdir(testing_dir) { JRubyTruffleRunner.new(['setup']).run }
end