Skip to content

Commit

Permalink
Set path in testInstallLanguage
Browse files Browse the repository at this point in the history
  • Loading branch information
fniephaus committed Feb 17, 2024
1 parent 7f8345f commit c83543e
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
helpers
installLanguage
| languageId version |
| modulesPath languageId version |
modulesPath := (FSLocator vmDirectory resolve: '../modules').
modulesPath isDirectory ifFalse: [ self error: 'Unable to find modules/ directory.' ].
languageId := UIManager default
chooseFrom: #('JavaScript' 'Ruby' 'Python' 'Java' 'LLVM' 'Wasm')
values: #('js' 'ruby' 'python' 'java' 'llvm' 'wasm')
title: 'Which language would you like to install?'.
version := UIManager default
request: 'Select a version:'
initialAnswer: ((Java type: 'java.lang.System') getProperty: 'org.graalvm.version' and: 'unknown').
self installLanguage: languageId version: version
self installLanguage: languageId version: version path: modulesPath fullName
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
helpers
installLanguage: languageId version: version path: path
| downloader |
[ downloader := Java type: 'org.graalvm.maven.downloader.Main' ]
on: Error
do: [ self error: 'Unable to find Maven Downloader. Additional languages can only be installed in a JVM standalone of TruffleSqueak.'].
'Installing language and its dependencies...' displayProgressFrom: 0 to: 1 during: [ :bar |
bar value: 0.
downloader main: {
'-o'. path.
'-v'. version.
'-a'. languageId
}.
].
self inform: 'Success! Please restart TruffleSqueak for the language to become available. You can also install more languages now.'
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@
"iconWASM" : "fn 6/26/2021 15:10",
"import:" : "fn 11/11/2018 21:34",
"initialize" : "fn 1/24/2020 14:41",
"installLanguage" : "fn 2/17/2024 13:19",
"installLanguage" : "fn 2/17/2024 16:36",
"installLanguage:version:" : "fn 2/17/2024 13:19",
"installLanguage:version:path:" : "fn 2/17/2024 16:35",
"isPermitted:" : "fn 1/26/2021 17:27",
"isPolyglotEvalAllowed" : "fn 5/13/2020 17:37",
"languageIdHost" : "fn 6/25/2021 13:43",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
testing
testInstallLanguage
Java primitiveIsHostLookupAllowed ifFalse: [ ^self ].
Polyglot installLanguage: 'js' version: '23.1.0'
Polyglot installLanguage: 'js' version: '23.1.0' path: Smalltalk imagePath
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"class" : {
},
"instance" : {
"testInstallLanguage" : "fn 2/17/2024 14:50",
"testInstallLanguage" : "fn 2/17/2024 16:36",
"testLanguageInfo" : "fn 2/11/2021 10:54",
"testPolyglotBindings" : "fn 11/28/2019 14:53",
"testPolyglotEval" : "fn 6/27/2021 12:15" } }

0 comments on commit c83543e

Please sign in to comment.