-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ability to install more languages
using the Maven Downloader.
- Loading branch information
Showing
4 changed files
with
33 additions
and
2 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
src/TruffleSqueak-Core.package/Polyglot.class/class/installLanguage.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters