From e9947ce56700df240d7eb74570fbb8c439ebbf44 Mon Sep 17 00:00:00 2001 From: Meinte Boersma Date: Wed, 4 Sep 2024 12:05:42 +0200 Subject: [PATCH 1/2] upgrade to version 0.2.8 of the LionWeb MPS plugin * update (self-)documentation --- solutions/io.lionweb.mps.cmdline/readme.md | 25 ++++++++++++++++--- test-project/gradle.properties | 2 +- .../test-references/library.lw-lang.json | 4 +++ .../test-references/multiple.lw-lang.json | 4 +++ test-project/test-scripts/export-library.sh | 6 ++--- test-project/test-scripts/export-multiple.sh | 6 ++--- 6 files changed, 36 insertions(+), 11 deletions(-) diff --git a/solutions/io.lionweb.mps.cmdline/readme.md b/solutions/io.lionweb.mps.cmdline/readme.md index 5116816..b6ee03f 100644 --- a/solutions/io.lionweb.mps.cmdline/readme.md +++ b/solutions/io.lionweb.mps.cmdline/readme.md @@ -26,21 +26,23 @@ usage: lionweb-export-language [] * _output-file:_ The file the converted languages should be written to. All languages will be written to the same file. - + * _language:_ Supplies the key of a language to export. Can be used multiple times; we accumulate all keys from _config-file_ and _language_ parameters. **Note:** We're always using the language's [key](../../docs/reference/structure-extensions.adoc#custom-keys). We're _not_ using the language's fully qualified name, module name, uuid, or anything else. - + * _macro:_ Supplies key/value pair to set a path variable for the MPS project. Can be used multiple times. Example: `-mlionweb-mps.home=./../` sets path variable `lionweb-mps.home` to `./../`. * _scope:_ Defines the export [scope as explained for converter languages](../../docs/reference/converter-lang.adoc#language-json-export). + ### Examples Minimal usage example without config file: + ```shell ./gradlew runCommandLineTool -Pargs=". exported.lw-lang.json -lMyHappyLittleMulti-Reference_Language -s=listed" ``` @@ -60,6 +62,7 @@ Example with config file: * `exported.lw-lang.json` sets the output file Contents of `config-file.json`: + ```json { "scope": "listed", @@ -70,8 +73,21 @@ Contents of `config-file.json`: } ``` +#### Test exports + +The directory `test-project/` can be used to test the command-line exporter. +Run + +```shell +source test-scripts/export-library.sh +source test-scripts/export-multiple.sh +``` + +to export two example languages, and compare the exports to the reference exports in `test-references/`. + ## Setup + We assume the MPS project that contains your to-be-exported languages is built with gradle. Create or adjust the following contents of `build.gradle.kts` (Kotlin dialect): @@ -140,14 +156,15 @@ pluginManagement { and some `gradle.properties` (adjust the versions accordingly): ```properties -lionwebVersion=0.2.3-SNAPSHOT +lionwebVersion=0.2.8 lionwebRelease=2023.1 mpsVersionSuffix=2021.1 mpsVersion=2021.1.4 comSpecificlanguagesMpsVersion=1.6.0 ``` -**Note:** The implementation strongly assumes that lionweb will be deployed to directory `./build/dependencies/io.lionweb.mps`. +**Note:** The implementation strongly assumes that LionWeb will be deployed to directory `./build/dependencies/io.lionweb.mps`. + ## Code design diff --git a/test-project/gradle.properties b/test-project/gradle.properties index 170763e..9994740 100644 --- a/test-project/gradle.properties +++ b/test-project/gradle.properties @@ -1,4 +1,4 @@ -lionwebVersion=0.2.3-SNAPSHOT +lionwebVersion=0.2.8 lionwebRelease=2023.1 mpsVersionSuffix=2021.1 mpsVersion=2021.1.4 diff --git a/test-project/test-references/library.lw-lang.json b/test-project/test-references/library.lw-lang.json index e607a65..1d04f75 100644 --- a/test-project/test-references/library.lw-lang.json +++ b/test-project/test-references/library.lw-lang.json @@ -4,6 +4,10 @@ { "key": "LionCore-M3", "version": "2023.1" + }, + { + "key": "LionCore-builtins", + "version": "2023.1" } ], "nodes": [ diff --git a/test-project/test-references/multiple.lw-lang.json b/test-project/test-references/multiple.lw-lang.json index bc2e7da..214f938 100644 --- a/test-project/test-references/multiple.lw-lang.json +++ b/test-project/test-references/multiple.lw-lang.json @@ -4,6 +4,10 @@ { "key": "LionCore-M3", "version": "2023.1" + }, + { + "key": "LionCore-builtins", + "version": "2023.1" } ], "nodes": [ diff --git a/test-project/test-scripts/export-library.sh b/test-project/test-scripts/export-library.sh index bab1e70..5fdfe44 100644 --- a/test-project/test-scripts/export-library.sh +++ b/test-project/test-scripts/export-library.sh @@ -1,7 +1,7 @@ #!/bin/sh -CONFIGFILE=library.lw-lang.json +OUTPUT_FILE=library.lw-lang.json -./gradlew runCommandLineTool -Pargs=". -lNTM3ZjljYjAtMGYyNS0zYzc2LThiODYtMzA4ZjQ1MDEwMTAw $CONFIGFILE -mlionweb-mps.home=./../ -s=listed" +./gradlew runCommandLineTool -Pargs=". -lNTM3ZjljYjAtMGYyNS0zYzc2LThiODYtMzA4ZjQ1MDEwMTAw $OUTPUT_FILE -mlionweb-mps.home=./../ -s=listed" -diff $CONFIGFILE test-references/$CONFIGFILE +diff $OUTPUT_FILE test-references/$OUTPUT_FILE diff --git a/test-project/test-scripts/export-multiple.sh b/test-project/test-scripts/export-multiple.sh index 399c771..9b006c1 100644 --- a/test-project/test-scripts/export-multiple.sh +++ b/test-project/test-scripts/export-multiple.sh @@ -1,7 +1,7 @@ #!/bin/sh -CONFIGFILE=multiple.lw-lang.json +OUTPUT_FILE=multiple.lw-lang.json -./gradlew runCommandLineTool -Pargs=". export-languages.json $CONFIGFILE -mlionweb-mps.home=./../" +./gradlew runCommandLineTool -Pargs=". export-languages.json $OUTPUT_FILE -mlionweb-mps.home=./../" -diff $CONFIGFILE test-references/$CONFIGFILE +diff $OUTPUT_FILE test-references/$OUTPUT_FILE From 1bdd291e8ecd5800e3ce153ab0a7bdf05eb6eb00 Mon Sep 17 00:00:00 2001 From: Meinte Boersma Date: Fri, 27 Sep 2024 13:46:31 +0200 Subject: [PATCH 2/2] point to (local) snapshot version of the LionWeb MPS plugin --- test-project/gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test-project/gradle.properties b/test-project/gradle.properties index 9994740..24549ea 100644 --- a/test-project/gradle.properties +++ b/test-project/gradle.properties @@ -1,4 +1,4 @@ -lionwebVersion=0.2.8 +lionwebVersion=0.2.9-SNAPSHOT lionwebRelease=2023.1 mpsVersionSuffix=2021.1 mpsVersion=2021.1.4