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: b28a115f0569^
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 929664461bec
Choose a head ref

Commits on Apr 20, 2016

  1. mx clean and mx build work for JRuby

    Jaroslav Tulach committed Apr 20, 2016
    Copy the full SHA
    b28a115 View commit details
  2. Ignore pyc files

    Jaroslav Tulach committed Apr 20, 2016
    Copy the full SHA
    69fe9b1 View commit details
  3. Using vc abstraction to find the current commit

    Jaroslav Tulach committed Apr 20, 2016
    Copy the full SHA
    368be7e View commit details
  4. Keeping just one jruby-truffle project

    Jaroslav Tulach committed Apr 20, 2016
    Copy the full SHA
    77ce5bf View commit details
  5. Copy the full SHA
    43e4f15 View commit details

Commits on Apr 21, 2016

  1. Copy the full SHA
    20b2112 View commit details
  2. Defining RUBY distribution

    Jaroslav Tulach committed Apr 21, 2016
    Copy the full SHA
    3ca3942 View commit details
  3. Binary distribution of Ruby and its libraries

    Jaroslav Tulach committed Apr 21, 2016
    Copy the full SHA
    0737ebe View commit details
  4. Don't forget to include shutil library

    Jaroslav Tulach committed Apr 21, 2016
    Copy the full SHA
    9a27726 View commit details

Commits on Apr 22, 2016

  1. Use the JAR file from the lib directory

    Jaroslav Tulach committed Apr 22, 2016
    Copy the full SHA
    160ec4a View commit details

Commits on Apr 25, 2016

  1. Using Ruby Core name for the core library

    Jaroslav Tulach committed Apr 25, 2016
    Copy the full SHA
    106ba9f View commit details
  2. Move jni one directory deeper. Specify version by overriding VERSION …

    …file
    Jaroslav Tulach committed Apr 25, 2016
    Copy the full SHA
    5b894c5 View commit details
  3. Ignore errors on removal of directories

    Jaroslav Tulach committed Apr 25, 2016
    Copy the full SHA
    b04ad05 View commit details
  4. Attributing Ruby as licensed under EPL

    Jaroslav Tulach committed Apr 25, 2016
    Copy the full SHA
    7390807 View commit details

Commits on Apr 29, 2016

  1. Copy the full SHA
    2f77dec View commit details
  2. Use archivePrefix functionality of mx

    Jaroslav Tulach committed Apr 29, 2016
    Copy the full SHA
    021b278 View commit details

Commits on May 3, 2016

  1. Run maven with debug output

    Jaroslav Tulach committed May 3, 2016
    Copy the full SHA
    7571d42 View commit details
  2. Perform the mvn execution only for one of the build tasks

    Jaroslav Tulach committed May 3, 2016
    Copy the full SHA
    12a5461 View commit details

Commits on May 4, 2016

  1. Force the rebuild

    Jaroslav Tulach committed May 4, 2016
    Copy the full SHA
    4e7648d View commit details
  2. No sources and use the prefix for the output_dir

    Jaroslav Tulach committed May 4, 2016
    Copy the full SHA
    5cadf03 View commit details
  3. output_dir cannot end with /

    Jaroslav Tulach committed May 4, 2016
    Copy the full SHA
    3cffd8d View commit details
  4. Copy the full SHA
    9296644 View commit details
Showing with 218 additions and 0 deletions.
  1. +3 −0 .gitignore
  2. +113 −0 mx.jruby/mx_jruby.py
  3. +102 −0 mx.jruby/suite.py
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -24,6 +24,9 @@
build
build.properties
build_graph.png
mx*/*pyc
mx*/env
mxbuild
core/src/main/java/org/jruby/runtime/Constants.java
dependency-reduced-pom.xml
dev_null
113 changes: 113 additions & 0 deletions mx.jruby/mx_jruby.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
import mx
import os
from os.path import join, exists
import subprocess
import shutil

_suite = mx.suite('jruby')

class MavenProject(mx.Project):
def __init__(self, suite, name, deps, workingSets, theLicense, **args):
mx.Project.__init__(self, suite, name, "", [], deps, workingSets, _suite.dir, theLicense)
self.javaCompliance = "1.7"
self.build = hasattr(args, 'build')
self.prefix = args['prefix']

def source_dirs(self):
return []

def output_dir(self):
dir = os.path.join(_suite.dir, self.prefix)
return dir[0:len(dir) - 1]

def source_gen_dir(self):
return None

def getOutput(self, replaceVar=False):
return os.path.join(_suite.dir, "target")

def getResults(self, replaceVar=False):
return mx.Project.getResults(self, replaceVar=replaceVar)

def getBuildTask(self, args):
return MavenBuildTask(self, args, None, None)

def isJavaProject(self):
return True

def archive_prefix(self):
return self.prefix


class MavenBuildTask(mx.BuildTask):
def __init__(self, project, args, vmbuild, vm):
mx.BuildTask.__init__(self, project, args, 1)
self.vm = vm
self.vmbuild = vmbuild

def __str__(self):
return 'Building Maven for {}'.format(self.subject)

def needsBuild(self, newestInput):
return (True, 'Let us re-build everytime')

def newestOutput(self):
return None

def build(self):
if not self.subject.build:
mx.log("...skip build of {}".format(self.subject))
return
mx.log('...perform build of {}'.format(self.subject))

rubyDir = _suite.dir

# HACK: since the maven executable plugin does not configure the
# java executable that is used we unfortunately need to append it to the PATH
javaHome = os.getenv('JAVA_HOME')
if javaHome:
os.environ["PATH"] = os.environ["JAVA_HOME"] + '/bin' + os.pathsep + os.environ["PATH"]

mx.logv('Setting PATH to {}'.format(os.environ["PATH"]))
mx.logv('Calling java -version')
mx.run(['java', '-version'])

# Truffle version

truffle = mx.suite('truffle')
truffle_commit = truffle.vc.parent(truffle.dir)

mx.run_mx(['maven-install'], suite=truffle)

# Ruby version
def apply_to_file(filename, function):
contents = open(filename).read()
contents = function(contents)
open(filename, 'w').write(contents)
apply_to_file(join(rubyDir, 'VERSION'), lambda version: 'graal-vm\n')

# Build jruby-truffle and

mx.run(['find', '.'], nonZeroIsFatal=False, cwd=rubyDir)
mx.run_maven(['--version'], nonZeroIsFatal=False, cwd=rubyDir)

mx.log('Building without tests')

mx.run_maven(['-DskipTests', '-X', '-Dtruffle.version=' + truffle_commit], cwd=rubyDir)

mx.log('Building complete version')

mx.run_maven(['-Pcomplete', '-X', '-DskipTests', '-Dtruffle.version=' + truffle_commit], cwd=rubyDir)
mx.run(['zip', '-d', 'maven/jruby-complete/target/jruby-complete-graal-vm.jar', 'META-INF/jruby.home/lib/*'], cwd=rubyDir)
mx.run(['bin/jruby', 'bin/gem', 'install', 'bundler', '-v', '1.10.6'], cwd=rubyDir)
# shutil.rmtree(os.path.join(_suite.dir, "lib", "target"), True)
# shutil.rmtree(os.path.join(_suite.dir, 'lib', 'lib', 'jni'), True)
# shutil.copytree(os.path.join(_suite.dir, 'lib', 'jni'), os.path.join(_suite.dir, 'lib', 'lib', 'jni'))
# shutil.rmtree(os.path.join(_suite.dir, 'lib', 'jni'), True)

def clean(self, forBuild=False):
if forBuild:
return
rubyDir = _suite.dir
mx.run_maven(['clean'], nonZeroIsFatal=False, cwd=rubyDir)

102 changes: 102 additions & 0 deletions mx.jruby/suite.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
suite = {
"mxversion" : "5.6.6",
"name" : "jrubytruffle",
"defaultLicense" : "EPL",

"imports" : {
"suites": [
{
"name": "truffle",
"version": "551e8475af2fc8769bc3ead07c9156fe0ccbe338",
"urls": [
{"url": "https://github.com/graalvm/truffle.git",
"kind": "git"},
{ "url" : "https://curio.ssw.jku.at/nexus/content/repositories/snapshots", "kind" : "binary" },
]
},
],
},
"libraries": {
"RUBY_COMPLETE": {
"path": "maven/jruby-complete/target/jruby-complete-graal-vm.jar",
"sha1": "NOCHECK",
"optional" :"true",
"license" : "EPL"
},
"RUBY_TRUFFLE": {
"path": "lib/jruby-truffle.jar",
"sha1": "NOCHECK",
"optional" :"true",
"license" : "EPL"
},
},
"projects" : {

# ------------- Projects -------------

"jruby-ruby" : {
"subDir" : "lib/ruby",
"class" : "MavenProject",
"build" : "true",
"prefix" : "lib/ruby/",
"dependencies": [
"truffle:TRUFFLE_API",
"truffle:TRUFFLE_DEBUG",
],
},
"jruby-lib-jni" : {
"subDir" : "lib/jni",
"class" : "MavenProject",
"prefix" : "lib/jni/",
"dependencies": [
"truffle:TRUFFLE_API",
"truffle:TRUFFLE_DEBUG",
],
},

},
"licenses" : {
"EPL" : {
"name" : "EPL",
"url" : "https://opensource.org/licenses/EPL-1.0",
},
},
"distributions" : {

# ------------- Distributions -------------

"RUBY": {
"mainClass": "org.jruby.Main",
"dependencies": [
"RUBY_COMPLETE",
"RUBY_TRUFFLE"
],
"exclude" : [
"truffle:JLINE",
],
"distDependencies" : [
"RUBY-ZIP",
"truffle:TRUFFLE_API",
"truffle:TRUFFLE_DEBUG",
],
"description" : "JRuby+Truffle",
"license": "EPL"
},
"RUBY-ZIP": {
"dependencies": [
"jruby-ruby",
"jruby-lib-jni",
],
"exclude" : [
"truffle:JLINE",
],
"distDependencies": [
"truffle:TRUFFLE_API",
"truffle:TRUFFLE_DEBUG",
],
"description" : "JRuby+Truffle Native Libs",
"license": "EPL"
},

},
}