Skip to content

Commit

Permalink
Make it clearer which GraalVM distribution should be used for the ref…
Browse files Browse the repository at this point in the history
…erence example graphs.
  • Loading branch information
nirvdrum committed Mar 18, 2024
1 parent 4ef766b commit ff10661
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions tools/generate-examples.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,16 @@ def tarball
)

GRAAL_VMS = [
GraalVM_21_2_0,
GraalVM_22_3_1,
GraalVM_21_2_0,
]

REFERENCE_GRAALVM = GraalVM_22_3_1

def reference_graalvm?(graalvm)
graalvm == REFERENCE_GRAALVM
end

def run_java(bin, dump_level, *args)
FileUtils.rm_rf("./graal_dumps")

Expand Down Expand Up @@ -107,7 +113,7 @@ def process_examples(graalvm, language, pattern)
system("gzip", "-f", "#{method}.bgv")
FileUtils.cp("#{method}.bgv.gz", "../../examples/#{graalvm.name}/#{language}")

if graalvm == GRAAL_VMS.first
if reference_graalvm?(graalvm)
FileUtils.ln_sf("../../examples/#{graalvm.name}/#{language}/#{method}.bgv.gz", "../../examples/#{language}")
end
end
Expand Down Expand Up @@ -157,7 +163,7 @@ def log(graalvm, message, io = $stdout)
system("gzip", "-f", "fib-java.bgv")
FileUtils.cp("fib-java.bgv.gz", "../../examples/#{graalvm.name}")

if graalvm == GRAAL_VMS.first
if reference_graalvm?(graalvm)
FileUtils.ln_sf("../../examples/#{graalvm.name}/fib-java.bgv.gz", "../../examples")
end

Expand Down Expand Up @@ -204,7 +210,7 @@ def log(graalvm, message, io = $stdout)
FileUtils.cp("fib-js.bgv.gz", "../../examples/#{graalvm.name}")
FileUtils.cp("fib-js-ast.bgv.gz", "../../examples/#{graalvm.name}")

if graalvm == GRAAL_VMS.first
if reference_graalvm?(graalvm)
FileUtils.ln_sf("../../examples/#{graalvm.name}/fib-js.bgv.gz", "../../examples/")
FileUtils.ln_sf("../../examples/#{graalvm.name}/fib-js-ast.bgv.gz", "../../examples/")
end
Expand Down Expand Up @@ -234,7 +240,7 @@ def log(graalvm, message, io = $stdout)
FileUtils.cp("fib-ruby.bgv.gz", "../../examples/#{graalvm.name}")
FileUtils.cp("fib-ruby-ast.bgv.gz", "../../examples/#{graalvm.name}")

if graalvm == GRAAL_VMS.first
if reference_graalvm?(graalvm)
FileUtils.ln_sf("../../examples/#{graalvm.name}/fib-ruby.bgv.gz", "../../examples")
FileUtils.ln_sf("../../examples/#{graalvm.name}/fib-ruby-ast.bgv.gz", "../../examples")
end
Expand Down

0 comments on commit ff10661

Please sign in to comment.