Skip to content

Commit

Permalink
Add ability to install more languages
Browse files Browse the repository at this point in the history
using the Maven Downloader.
  • Loading branch information
fniephaus committed Feb 17, 2024
1 parent e9ba6b7 commit c636e07
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
helpers
installLanguage
| downloader modulesPath selectedLanguage version |
[ 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.'].
modulesPath := (FSLocator vmDirectory resolve: '../modules').
modulesPath isDirectory ifFalse: [ self error: 'Unable to find modules/ directory.' ].
selectedLanguage := 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').
'Installing language and its dependencies...' displayProgressFrom: 0 to: 1 during: [ :bar |
bar value: 0.
downloader main: {
'-o'. modulesPath fullName.
'-v'. version.
'-a'. selectedLanguage
}.
].
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,6 +33,7 @@
"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:10",
"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
Expand Up @@ -8,10 +8,16 @@ addModelItemsToWindowMenu: aMenu
selector: #languageInfo:
argument: ea ].
aMenu addLine.

aMenu
add: 'install another language...'
target: Polyglot
selector: #installLanguage.
aMenu addLine.

Smalltalk at: #PolyglotEditor ifPresent: [ :unused |
aMenu
add: 'open in Polyglot Editor'
add: 'open in Polyglot Editor...'
target: self
selector: #openInPolyglotEditor.
aMenu addLine ].
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"shouldStyle" : "fn 6/25/2021 22:28" },
"instance" : {
"addCustomCodePaneMenuItems:shifted:" : "fn 6/25/2021 22:29",
"addModelItemsToWindowMenu:" : "fn 6/25/2021 21:49",
"addModelItemsToWindowMenu:" : "fn 2/17/2024 13:12",
"buildCodePaneWith:" : "fn 6/10/2021 09:52",
"evaluateExpression:" : "fn 6/27/2021 12:38",
"helpText" : "fn 6/25/2021 17:55",
Expand Down

0 comments on commit c636e07

Please sign in to comment.