From 24da2526dda852fc29c984948f7c1104437d2f5d Mon Sep 17 00:00:00 2001
From: Danilo Ansaloni <danilo.ansaloni@oracle.com>
Date: Sat, 7 Apr 2018 01:10:33 +0200
Subject: [PATCH] Add a FastR module.

---
 mx.fastr/mx_fastr_dists.py |  2 ++
 mx.fastr/suite.py          | 40 +++++++++++++++++++++++++++++++++++---
 2 files changed, 39 insertions(+), 3 deletions(-)

diff --git a/mx.fastr/mx_fastr_dists.py b/mx.fastr/mx_fastr_dists.py
index 2c9edafed0..835c2cc9de 100644
--- a/mx.fastr/mx_fastr_dists.py
+++ b/mx.fastr/mx_fastr_dists.py
@@ -201,6 +201,8 @@ def mx_post_parse_cmd_line(opts):
     else:
         val = ""
     mx.instantiateDistribution('FASTR_RELEASE<rffi>', dict(rffi=val))
+    if os.environ.has_key('FASTR_RELEASE') and val == '':
+        mx.instantiateDistribution('FASTR_GRAALVM_SUPPORT<rffi>', dict(rffi=val))
 
     for dist in mx_fastr._fastr_suite.dists:
         if isinstance(dist, mx.JARDistribution):
diff --git a/mx.fastr/suite.py b/mx.fastr/suite.py
index d3d1571cab..65b520b2da 100644
--- a/mx.fastr/suite.py
+++ b/mx.fastr/suite.py
@@ -309,7 +309,7 @@ suite = {
       "sourceDirs" : ["src"],
       "buildDependencies" : ["com.oracle.truffle.r.native.recommended"],
       "class" : "FastRReleaseProject",
-      "output" : "com.oracle.truffle.r.release"
+      "output" : "com.oracle.truffle.r.release",
     },
 
     "com.oracle.truffle.r.native.recommended" : {
@@ -417,8 +417,8 @@ suite = {
     "FASTR_RELEASE<rffi>": {
       "description" : "a binary release of FastR",
       "dependencies" : ["com.oracle.truffle.r.release"],
-       "os_arch" : {
-         "linux" : {
+      "os_arch" : {
+        "linux" : {
           "amd64" : {
             "path" : "mxbuild/dists/linux/amd64/<rffi>/fastr-release.jar",
           },
@@ -441,5 +441,39 @@ suite = {
         },
       },
     },
+
+    "FASTR_GRAALVM_SUPPORT<rffi>" : {
+      "native" : True,
+      "platformDependent" : True,
+      "description" : "FastR support distribution for the GraalVM",
+      "layout" : {
+        "./" : [
+          {
+            "source_type": "extracted-dependency",
+            "dependency": "FASTR_RELEASE<rffi>",
+            "path": "*",
+            "exclude": [
+              "COPYRIGHT",
+              "LICENSE",
+              "README.md",
+              "bin/fastr_jars",
+            ],
+          },
+          {
+            "source_type": "extracted-dependency",
+            "dependency": "FASTR_RELEASE<rffi>",
+            "path": "bin/fastr_jars/*",
+            "exclude" : [
+              "bin/fastr_jars/truffle*",
+              "bin/fastr_jars/graal-sdk*",
+            ],
+          },
+          "dependency:fastr:GNUR",
+        ],
+        "COPYRIGHT_FASTR" : "extracted-dependency:fastr:FASTR_RELEASE<rffi>/COPYRIGHT",
+        "LICENSE_FASTR" : "extracted-dependency:fastr:FASTR_RELEASE<rffi>/LICENSE",
+        "README_FASTR" : "extracted-dependency:fastr:FASTR_RELEASE<rffi>/README.md",
+      },
+    }
   },
 }
-- 
GitLab