-
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.
- Loading branch information
Showing
5 changed files
with
23 additions
and
5 deletions.
There are no files selected for viewing
6 changes: 4 additions & 2 deletions
6
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 |
---|---|---|
@@ -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 |
15 changes: 15 additions & 0 deletions
15
src/TruffleSqueak-Core.package/Polyglot.class/class/installLanguage.version.path..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,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.' |
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
2 changes: 1 addition & 1 deletion
2
src/TruffleSqueak-Tests.package/PolyglotTest.class/instance/testInstallLanguage.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 |
---|---|---|
@@ -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 |
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