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: e095283fae17
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 70223257b187
Choose a head ref
  • 4 commits
  • 1 file changed
  • 1 contributor

Commits on Nov 18, 2016

  1. Copy the full SHA
    ce4f425 View commit details
  2. Unverified

    This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
    Copy the full SHA
    7547513 View commit details
  3. Copy the full SHA
    2c4f7dd View commit details
  4. Copy the full SHA
    7022325 View commit details
Showing with 3 additions and 17 deletions.
  1. +3 −17 mx.jruby/mx_jruby.py
20 changes: 3 additions & 17 deletions mx.jruby/mx_jruby.py
Original file line number Diff line number Diff line change
@@ -8,18 +8,12 @@

import sys
import os
import subprocess
import pipes
import shutil
import json
import time
import tarfile
import zipfile
from threading import Thread
from os.path import join, exists, isdir

import mx
import mx_benchmark
import mx_unittest

TimeStampFile = mx.TimeStampFile
@@ -219,28 +213,20 @@ def extractArguments(cli_args):
break
return vmArgs, rubyArgs, classpath, print_command, classic, main_class

def extractTarball(file, target_dir):
if file.endswith('tar'):
with tarfile.open(file, 'r:') as tf:
tf.extractall(target_dir)
elif file.endswith('jar') or file.endswith('zip'):
with zipfile.ZipFile(file, "r") as zf:
zf.extractall(target_dir)
else:
mx.abort('Unsupported compressed file ' + file)

def setup_jruby_home():
rubyZip = mx.distribution('RUBY-ZIP').path
assert exists(rubyZip)
extractPath = join(_suite.dir, 'mxbuild', 'ruby-zip-extracted')
if TimeStampFile(extractPath).isOlderThan(rubyZip):
if exists(extractPath):
shutil.rmtree(extractPath)
extractTarball(rubyZip, extractPath)
with tarfile.open(rubyZip, 'r:') as tf:
tf.extractall(extractPath)
env = os.environ.copy()
env['JRUBY_HOME'] = extractPath
return env

# Print to stderr, mx.log() outputs to stdout
def log(msg):
print >> sys.stderr, msg