diff --git a/build.gradle.kts b/build.gradle.kts index be5bb49b..39081ea7 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -44,19 +44,31 @@ task("javadocJar") { archiveClassifier.set("javadoc") } -task("testCmdlineExport-library") { +task("testCmdLineExport-library") { workingDir("./test-project") - commandLine("./test-scripts/export-library.sh") + commandLine("./scripts/export-library.sh") } -task("testCmdlineExport-multiple") { +task("testCmdLineExport-multiple") { workingDir("./test-project") - commandLine("./test-scripts/export-multiple.sh") + commandLine("./scripts/export-multiple.sh") +} + +task("testCmdLineExport-foo") { + workingDir("./test-project") + commandLine("./scripts/export-foo.sh") +} + +task("testCmdLineExport-DependsOnMpsExtension") { + workingDir("./test-project-externalLib") + commandLine("./scripts/export-DependsOnMpsExtensions.sh") } task("testCmdLineExport") { - dependsOn("testCmdlineExport-library") - dependsOn("testCmdlineExport-multiple") + dependsOn("testCmdLineExport-library") + dependsOn("testCmdLineExport-multiple") + dependsOn("testCmdLineExport-foo") + dependsOn("testCmdLineExport-DependsOnMpsExtension") } diff --git a/build.xml b/build.xml index 2111d977..ec365661 100644 --- a/build.xml +++ b/build.xml @@ -2867,6 +2867,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/solutions/io.lionweb.mps.build/models/io.lionweb.mps.build.mps b/solutions/io.lionweb.mps.build/models/io.lionweb.mps.build.mps index 3a2ce622..ab6c8dfc 100644 --- a/solutions/io.lionweb.mps.build/models/io.lionweb.mps.build.mps +++ b/solutions/io.lionweb.mps.build/models/io.lionweb.mps.build.mps @@ -360,6 +360,9 @@ + + + diff --git a/solutions/io.lionweb.mps.cmdline/readme.md b/solutions/io.lionweb.mps.cmdline/readme.md index b6ee03f3..e69a3ce1 100644 --- a/solutions/io.lionweb.mps.cmdline/readme.md +++ b/solutions/io.lionweb.mps.cmdline/readme.md @@ -1,4 +1,4 @@ -# LionWeb MPS Command-Line Language Exporter +# LionWeb MPS Command Line Exporter ## Usage Gradle requires some workarounds to pass arguments, so we have to wrap our command-line arguments in `-Pargs`: @@ -38,6 +38,13 @@ usage: lionweb-export-language [] * _scope:_ Defines the export [scope as explained for converter languages](../../docs/reference/converter-lang.adoc#language-json-export). +**Note** that we assume that your to-be-exported languages are built within MPS, i.e. have resulted in files in `classes_gen/` directories, and MPS doesn't show “(generation required)” next to the language module(s). +This also requires that the required external dependencies are downloaded first. +This is typically done by running the Gradle `resolveGenerationDependencies` task, as follows: + +```shell +./gradlew resolveGenerationDependencies +``` ### Examples @@ -75,20 +82,35 @@ Contents of `config-file.json`: #### Test exports -The directory `test-project/` can be used to test the command-line exporter. -Run +The directories `test-project/` and `test-project-externalLib` contain MPS projects that can be used to test the command-line exporter. + +Within `test-project/`, run + +```shell +source scripts/export-library.sh +source scripts/export-multiple.sh +source scripts/export-foo.sh +``` + +(or a similar incantation suitable for your OS and shell) to export three example languages, and compare the exports to the reference exports in `expected/`. +The languages' exports end up in the `actual/` directory. +The `FooLanguage` language resides within the project, but the `library` and `multi` language are bundled. +The `export-multiple.sh` script also demonstrates the use of a JSON configuration file — in this case [`export-multiple.config.json`](../../test-project/export-multiple.config.json). + +Within `test-project-externalLib`, run ```shell -source test-scripts/export-library.sh -source test-scripts/export-multiple.sh +source scripts/export-DependsOnMpsExtensions.sh +source scripts/export-foo.sh ``` -to export two example languages, and compare the exports to the reference exports in `test-references/`. +(or a similar incantation suitable for your OS and shell) to export two example languages in the same way as in the `test-project`. +The `FooLanguage` language resides within the `test-project/` MPS project, and the `DependsOnMpsExtensions` depends on the `de.slisson.mps.richtext` language from the MPS extensions. ## Setup -We assume the MPS project that contains your to-be-exported languages is built with gradle. +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): @@ -172,4 +194,4 @@ All contents of package `io.lionweb.mps.cmdline` run _outside MPS classloaders_. Once we pass _into MPS_, we're using contents of package `io.lionweb.mps.cmdline.cmd`. Outside and while crossing the boundary, we can only use classes that originate from _common_ classloaders. -This includes Java standard library and core MPS, and excludes all LionWeb classes. \ No newline at end of file +This includes Java standard library and core MPS, and excludes all LionWeb classes. diff --git a/test-project-externalLib/.gitignore b/test-project-externalLib/.gitignore new file mode 100644 index 00000000..ca9e3081 --- /dev/null +++ b/test-project-externalLib/.gitignore @@ -0,0 +1,9 @@ +# Ignore Gradle project-specific cache directory +/.gradle/ + +# Ignore Gradle build output directory +/build/ + +# Ignore downloaded dependencies +/dependencies/ + diff --git a/test-project-externalLib/.mps/.gitignore b/test-project-externalLib/.mps/.gitignore new file mode 100644 index 00000000..26d33521 --- /dev/null +++ b/test-project-externalLib/.mps/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/test-project-externalLib/.mps/libraries.xml b/test-project-externalLib/.mps/libraries.xml new file mode 100644 index 00000000..8e36ae34 --- /dev/null +++ b/test-project-externalLib/.mps/libraries.xml @@ -0,0 +1,25 @@ + + + + + + \ No newline at end of file diff --git a/test-project-externalLib/.mps/modules.xml b/test-project-externalLib/.mps/modules.xml new file mode 100644 index 00000000..8afcfa1f --- /dev/null +++ b/test-project-externalLib/.mps/modules.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/test-project-externalLib/.mps/vcs.xml b/test-project-externalLib/.mps/vcs.xml new file mode 100644 index 00000000..6c0b8635 --- /dev/null +++ b/test-project-externalLib/.mps/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/test-project-externalLib/actual/.gitignore b/test-project-externalLib/actual/.gitignore new file mode 100644 index 00000000..9c08a126 --- /dev/null +++ b/test-project-externalLib/actual/.gitignore @@ -0,0 +1,3 @@ +# Test files +/*.lw-lang.json + diff --git a/test-project-externalLib/build.gradle.kts b/test-project-externalLib/build.gradle.kts new file mode 100644 index 00000000..1fe7e4fa --- /dev/null +++ b/test-project-externalLib/build.gradle.kts @@ -0,0 +1,56 @@ +// based on /~https://github.com/specificlanguages/mps-gradle-plugin-sample + +plugins { + id("com.specificlanguages.mps") + `maven-publish` +} + +val mpsVersionSuffix: String by project +val lionwebRelease: String by project +val mpsVersion: String by project +val lionwebVersion: String by project +val mpsExtensionsVersion: String by project + +repositories { + mavenLocal() + maven(url = "https://artifacts.itemis.cloud/repository/maven-mps") + mavenCentral() +} + +dependencies { + "mps"("com.jetbrains:mps:$mpsVersion") + "generation"("io.lionweb.lionweb-mps:lionweb-mps-$mpsVersionSuffix-lw$lionwebRelease:$lionwebVersion") + "generation"("de.itemis.mps:extensions:$mpsExtensionsVersion") +} + +tasks.assembleMps { + antProperties.putAll(antProperties.get()) + antProperties.put("mps-extensions.home", "${projectDir.resolve("build/dependencies/de.itemis.mps.extensions")}") +} + +task("runCommandLineTool") { + dependsOn("resolveGenerationDependencies") + + val mpsHome = configurations + .getByName("mps") + .incoming + .artifactView { attributes.attribute(Attribute.of("artifactType", String::class.java), "unzipped-mps-distribution") } + .files + .elements + .map { it.single().asFile } + .get() + project.logger.info("mpsHome: $mpsHome") + val cmdLinePath = "build/dependencies/io.lionweb.mps/io.lionweb.mps.cmdline/languages/lionweb-mps.cmdline/io.lionweb.mps.cmdline.jar" + project.logger.info("cmdLinePath: $cmdLinePath") + classpath( + file(cmdLinePath), // Location of CommandLineTool.class + fileTree("$mpsHome/lib") // $mps_home points to the MPS installation + ) + mainClass.set("io.lionweb.mps.cmdline.CommandLineTool") + + val propArgs: String? = project.findProperty("args") as String? + project.logger.info("propArgs: $propArgs") + if (propArgs != null) { + setArgsString(propArgs) + } +} \ No newline at end of file diff --git a/test-project-externalLib/build.xml b/test-project-externalLib/build.xml new file mode 100644 index 00000000..eb73489a --- /dev/null +++ b/test-project-externalLib/build.xml @@ -0,0 +1,322 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + testProjectExternalLib + test-project-ExternalLib + 1.0 + jetbrains.mps.core + de.slisson.mps.richtext + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + mps.build.number=${mps.build.number}${line.separator}mps.date=${mps.date}${line.separator}mps.build.vcs.number=${mps.build.vcs.number}${line.separator}mps.teamcity.buildConfName=${mps.teamcity.buildConfName}${line.separator}mps.idea.platform.build.number=${mps.idea.platform.build.number}${line.separator}mps.mps.build.counter=${mps.mps.build.counter}${line.separator}mpsBootstrapCore.version.major=${mpsBootstrapCore.version.major}${line.separator}mpsBootstrapCore.version.minor=${mpsBootstrapCore.version.minor}${line.separator}mpsBootstrapCore.version.bugfixNr=${mpsBootstrapCore.version.bugfixNr}${line.separator}mpsBootstrapCore.version.eap=${mpsBootstrapCore.version.eap}${line.separator}mpsBootstrapCore.version=${mpsBootstrapCore.version}${line.separator}io.lionweb.mps.version=${io.lionweb.mps.version}${line.separator}de.itemis.mps.extensions.versionNumber=${de.itemis.mps.extensions.versionNumber} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/test-project-externalLib/expected/DependsOnMpsExtensions.lw-lang.json b/test-project-externalLib/expected/DependsOnMpsExtensions.lw-lang.json new file mode 100644 index 00000000..7d82bbce --- /dev/null +++ b/test-project-externalLib/expected/DependsOnMpsExtensions.lw-lang.json @@ -0,0 +1,266 @@ +{ + "serializationFormatVersion": "2023.1", + "languages": [ + { + "key": "LionCore-M3", + "version": "2023.1" + }, + { + "key": "LionCore-builtins", + "version": "2023.1" + } + ], + "nodes": [ + { + "id": "DependsOnMpsExtensions-lang", + "classifier": { + "language": "LionCore-M3", + "version": "2023.1", + "key": "Language" + }, + "properties": [ + { + "property": { + "language": "LionCore-M3", + "version": "2023.1", + "key": "Language-version" + }, + "value": "0" + }, + { + "property": { + "language": "LionCore-M3", + "version": "2023.1", + "key": "IKeyed-key" + }, + "value": "DependsOnMpsExtensions-lang" + }, + { + "property": { + "language": "LionCore-builtins", + "version": "2023.1", + "key": "LionCore-builtins-INamed-name" + }, + "value": "DependsOnMpsExtensions" + } + ], + "containments": [ + { + "containment": { + "language": "LionCore-M3", + "version": "2023.1", + "key": "Language-entities" + }, + "children": [ + "MjA1YTQxNWItMzMxYi00MDY2LWFiMjItY2Y3ZjNmOTA4ZjM2LzE4NzQ4NTU2NTY4MzM1MTc5NjU" + ] + } + ], + "references": [ + { + "reference": { + "language": "LionCore-M3", + "version": "2023.1", + "key": "Language-dependsOn" + }, + "targets": [ + { + "resolveInfo": "de.slisson.mps.richtext", + "reference": "OTJkMmVhMTYtNWE0Mi00ZmRmLWE2NzYtYzc2MDRlZmUzNTA0" + } + ] + } + ], + "annotations": [], + "parent": null + }, + { + "id": "MjA1YTQxNWItMzMxYi00MDY2LWFiMjItY2Y3ZjNmOTA4ZjM2LzE4NzQ4NTU2NTY4MzM1MTc5NjU", + "classifier": { + "language": "LionCore-M3", + "version": "2023.1", + "key": "Concept" + }, + "properties": [ + { + "property": { + "language": "LionCore-M3", + "version": "2023.1", + "key": "Concept-abstract" + }, + "value": "false" + }, + { + "property": { + "language": "LionCore-M3", + "version": "2023.1", + "key": "Concept-partition" + }, + "value": "false" + }, + { + "property": { + "language": "LionCore-M3", + "version": "2023.1", + "key": "IKeyed-key" + }, + "value": "MjA1YTQxNWItMzMxYi00MDY2LWFiMjItY2Y3ZjNmOTA4ZjM2LzE4NzQ4NTU2NTY4MzM1MTc5NjU" + }, + { + "property": { + "language": "LionCore-builtins", + "version": "2023.1", + "key": "LionCore-builtins-INamed-name" + }, + "value": "SomethingDifferent" + } + ], + "containments": [ + { + "containment": { + "language": "LionCore-M3", + "version": "2023.1", + "key": "Classifier-features" + }, + "children": [] + } + ], + "references": [ + { + "reference": { + "language": "LionCore-M3", + "version": "2023.1", + "key": "Concept-extends" + }, + "targets": [ + { + "resolveInfo": "Node", + "reference": "LionCore-builtins-Node" + } + ] + }, + { + "reference": { + "language": "LionCore-M3", + "version": "2023.1", + "key": "Concept-implements" + }, + "targets": [ + { + "resolveInfo": "IWord", + "reference": "OTJkMmVhMTYtNWE0Mi00ZmRmLWE2NzYtYzc2MDRlZmUzNTA0LzI1NTcwNzQ0NDI5MjIzOTIzMDA" + } + ] + } + ], + "annotations": [], + "parent": "DependsOnMpsExtensions-lang" + }, + { + "id": "OTJkMmVhMTYtNWE0Mi00ZmRmLWE2NzYtYzc2MDRlZmUzNTA0", + "classifier": { + "language": "LionCore-M3", + "version": "2023.1", + "key": "Language" + }, + "properties": [ + { + "property": { + "language": "LionCore-M3", + "version": "2023.1", + "key": "Language-version" + }, + "value": "0" + }, + { + "property": { + "language": "LionCore-M3", + "version": "2023.1", + "key": "IKeyed-key" + }, + "value": "OTJkMmVhMTYtNWE0Mi00ZmRmLWE2NzYtYzc2MDRlZmUzNTA0" + }, + { + "property": { + "language": "LionCore-builtins", + "version": "2023.1", + "key": "LionCore-builtins-INamed-name" + }, + "value": "de.slisson.mps.richtext" + } + ], + "containments": [ + { + "containment": { + "language": "LionCore-M3", + "version": "2023.1", + "key": "Language-entities" + }, + "children": [ + "OTJkMmVhMTYtNWE0Mi00ZmRmLWE2NzYtYzc2MDRlZmUzNTA0LzI1NTcwNzQ0NDI5MjIzOTIzMDA" + ] + } + ], + "references": [ + { + "reference": { + "language": "LionCore-M3", + "version": "2023.1", + "key": "Language-dependsOn" + }, + "targets": [] + } + ], + "annotations": [], + "parent": null + }, + { + "id": "OTJkMmVhMTYtNWE0Mi00ZmRmLWE2NzYtYzc2MDRlZmUzNTA0LzI1NTcwNzQ0NDI5MjIzOTIzMDA", + "classifier": { + "language": "LionCore-M3", + "version": "2023.1", + "key": "Interface" + }, + "properties": [ + { + "property": { + "language": "LionCore-M3", + "version": "2023.1", + "key": "IKeyed-key" + }, + "value": "OTJkMmVhMTYtNWE0Mi00ZmRmLWE2NzYtYzc2MDRlZmUzNTA0LzI1NTcwNzQ0NDI5MjIzOTIzMDA" + }, + { + "property": { + "language": "LionCore-builtins", + "version": "2023.1", + "key": "LionCore-builtins-INamed-name" + }, + "value": "IWord" + } + ], + "containments": [ + { + "containment": { + "language": "LionCore-M3", + "version": "2023.1", + "key": "Classifier-features" + }, + "children": [] + } + ], + "references": [ + { + "reference": { + "language": "LionCore-M3", + "version": "2023.1", + "key": "Interface-extends" + }, + "targets": [] + } + ], + "annotations": [], + "parent": "OTJkMmVhMTYtNWE0Mi00ZmRmLWE2NzYtYzc2MDRlZmUzNTA0" + } + ] +} \ No newline at end of file diff --git a/test-project-externalLib/expected/foo.lw-lang.json b/test-project-externalLib/expected/foo.lw-lang.json new file mode 100644 index 00000000..002dde8f --- /dev/null +++ b/test-project-externalLib/expected/foo.lw-lang.json @@ -0,0 +1,150 @@ +{ + "serializationFormatVersion": "2023.1", + "languages": [ + { + "key": "LionCore-M3", + "version": "2023.1" + }, + { + "key": "LionCore-builtins", + "version": "2023.1" + } + ], + "nodes": [ + { + "id": "foo-language", + "classifier": { + "language": "LionCore-M3", + "version": "2023.1", + "key": "Language" + }, + "properties": [ + { + "property": { + "language": "LionCore-M3", + "version": "2023.1", + "key": "Language-version" + }, + "value": "0" + }, + { + "property": { + "language": "LionCore-M3", + "version": "2023.1", + "key": "IKeyed-key" + }, + "value": "foo-language" + }, + { + "property": { + "language": "LionCore-builtins", + "version": "2023.1", + "key": "LionCore-builtins-INamed-name" + }, + "value": "FooLanguage" + } + ], + "containments": [ + { + "containment": { + "language": "LionCore-M3", + "version": "2023.1", + "key": "Language-entities" + }, + "children": [ + "ZGZkMmU2ZTktNTcyMS00OGQ5LTlkZTktMzZiZDU0MzQ1OTUwLzQxMzAzMzkxMjExNzAwNjExMTg" + ] + } + ], + "references": [ + { + "reference": { + "language": "LionCore-M3", + "version": "2023.1", + "key": "Language-dependsOn" + }, + "targets": [] + } + ], + "annotations": [], + "parent": null + }, + { + "id": "ZGZkMmU2ZTktNTcyMS00OGQ5LTlkZTktMzZiZDU0MzQ1OTUwLzQxMzAzMzkxMjExNzAwNjExMTg", + "classifier": { + "language": "LionCore-M3", + "version": "2023.1", + "key": "Concept" + }, + "properties": [ + { + "property": { + "language": "LionCore-M3", + "version": "2023.1", + "key": "Concept-abstract" + }, + "value": "false" + }, + { + "property": { + "language": "LionCore-M3", + "version": "2023.1", + "key": "Concept-partition" + }, + "value": "false" + }, + { + "property": { + "language": "LionCore-M3", + "version": "2023.1", + "key": "IKeyed-key" + }, + "value": "ZGZkMmU2ZTktNTcyMS00OGQ5LTlkZTktMzZiZDU0MzQ1OTUwLzQxMzAzMzkxMjExNzAwNjExMTg" + }, + { + "property": { + "language": "LionCore-builtins", + "version": "2023.1", + "key": "LionCore-builtins-INamed-name" + }, + "value": "Bar" + } + ], + "containments": [ + { + "containment": { + "language": "LionCore-M3", + "version": "2023.1", + "key": "Classifier-features" + }, + "children": [] + } + ], + "references": [ + { + "reference": { + "language": "LionCore-M3", + "version": "2023.1", + "key": "Concept-extends" + }, + "targets": [ + { + "resolveInfo": "Node", + "reference": "LionCore-builtins-Node" + } + ] + }, + { + "reference": { + "language": "LionCore-M3", + "version": "2023.1", + "key": "Concept-implements" + }, + "targets": [] + } + ], + "annotations": [], + "parent": "foo-language" + } + ] +} \ No newline at end of file diff --git a/test-project-externalLib/gradle.properties b/test-project-externalLib/gradle.properties new file mode 100644 index 00000000..1496ff3a --- /dev/null +++ b/test-project-externalLib/gradle.properties @@ -0,0 +1,6 @@ +lionwebVersion=0.2.9-SNAPSHOT +lionwebRelease=2023.1 +mpsVersionSuffix=2021.1 +mpsVersion=2021.1.4 +comSpecificlanguagesMpsVersion=1.6.0 +mpsExtensionsVersion=2021.1.2365.a4d7bb2 diff --git a/test-project-externalLib/gradle/libs.versions.toml b/test-project-externalLib/gradle/libs.versions.toml new file mode 100644 index 00000000..4ac3234a --- /dev/null +++ b/test-project-externalLib/gradle/libs.versions.toml @@ -0,0 +1,2 @@ +# This file was generated by the Gradle 'init' task. +# https://docs.gradle.org/current/userguide/platforms.html#sub::toml-dependencies-format diff --git a/test-project-externalLib/gradle/wrapper/gradle-wrapper.jar b/test-project-externalLib/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 00000000..d64cd491 Binary files /dev/null and b/test-project-externalLib/gradle/wrapper/gradle-wrapper.jar differ diff --git a/test-project-externalLib/gradle/wrapper/gradle-wrapper.properties b/test-project-externalLib/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 00000000..1af9e093 --- /dev/null +++ b/test-project-externalLib/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,7 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip +networkTimeout=10000 +validateDistributionUrl=true +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/test-project-externalLib/gradlew b/test-project-externalLib/gradlew new file mode 100755 index 00000000..1aa94a42 --- /dev/null +++ b/test-project-externalLib/gradlew @@ -0,0 +1,249 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# /~https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at /~https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (/~https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum + +warn () { + echo "$*" +} >&2 + +die () { + echo + echo "$*" + echo + exit 1 +} >&2 + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD=$JAVA_HOME/jre/sh/java + else + JAVACMD=$JAVA_HOME/bin/java + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD=java + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +fi + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac +fi + +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + + # Now convert the arguments - kludge to limit ourselves to /bin/sh + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) + fi + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg + done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/test-project-externalLib/gradlew.bat b/test-project-externalLib/gradlew.bat new file mode 100644 index 00000000..6689b85b --- /dev/null +++ b/test-project-externalLib/gradlew.bat @@ -0,0 +1,92 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%"=="" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if %ERRORLEVEL% equ 0 goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if %ERRORLEVEL% equ 0 goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/test-project-externalLib/languages/DependsOnMpsExtensions/DependsOnMpsExtensions.mpl b/test-project-externalLib/languages/DependsOnMpsExtensions/DependsOnMpsExtensions.mpl new file mode 100644 index 00000000..8d4a47ff --- /dev/null +++ b/test-project-externalLib/languages/DependsOnMpsExtensions/DependsOnMpsExtensions.mpl @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 92d2ea16-5a42-4fdf-a676-c7604efe3504(de.slisson.mps.richtext) + + + diff --git a/test-project-externalLib/languages/DependsOnMpsExtensions/models/DependsOnMpsExtensions.behavior.mps b/test-project-externalLib/languages/DependsOnMpsExtensions/models/DependsOnMpsExtensions.behavior.mps new file mode 100644 index 00000000..cf06eae0 --- /dev/null +++ b/test-project-externalLib/languages/DependsOnMpsExtensions/models/DependsOnMpsExtensions.behavior.mps @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/test-project-externalLib/languages/DependsOnMpsExtensions/models/DependsOnMpsExtensions.structure.mps b/test-project-externalLib/languages/DependsOnMpsExtensions/models/DependsOnMpsExtensions.structure.mps new file mode 100644 index 00000000..f8b9c7da --- /dev/null +++ b/test-project-externalLib/languages/DependsOnMpsExtensions/models/DependsOnMpsExtensions.structure.mps @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test-project-externalLib/scripts/export-DependsOnMpsExtensions.sh b/test-project-externalLib/scripts/export-DependsOnMpsExtensions.sh new file mode 100755 index 00000000..8e823834 --- /dev/null +++ b/test-project-externalLib/scripts/export-DependsOnMpsExtensions.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +OUTPUT_FILE=DependsOnMpsExtensions.lw-lang.json + +./gradlew runCommandLineTool -Pargs=". -lDependsOnMpsExtensions-lang actual/$OUTPUT_FILE -mlionweb-mps.home=./../ -s=fineGrainedClosure" + +diff actual/$OUTPUT_FILE expected/$OUTPUT_FILE diff --git a/test-project-externalLib/scripts/export-foo.sh b/test-project-externalLib/scripts/export-foo.sh new file mode 100755 index 00000000..b8ccd13e --- /dev/null +++ b/test-project-externalLib/scripts/export-foo.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +OUTPUT_FILE=foo.lw-lang.json + +./gradlew runCommandLineTool -Pargs=". -lfoo-language actual/$OUTPUT_FILE -mlionweb-mps.home=./../ -s=listed" + +diff actual/$OUTPUT_FILE expected/$OUTPUT_FILE diff --git a/test-project-externalLib/settings.gradle.kts b/test-project-externalLib/settings.gradle.kts new file mode 100644 index 00000000..d255a4a3 --- /dev/null +++ b/test-project-externalLib/settings.gradle.kts @@ -0,0 +1,8 @@ +//rootProject.name = "test-project" + +pluginManagement { + val comSpecificlanguagesMpsVersion: String by settings + plugins { + id("com.specificlanguages.mps") version comSpecificlanguagesMpsVersion + } +} \ No newline at end of file diff --git a/test-project-externalLib/solutions/testProjectExternalLib.build/models/testProjectExternalLib.build.mps b/test-project-externalLib/solutions/testProjectExternalLib.build/models/testProjectExternalLib.build.mps new file mode 100644 index 00000000..8c244c3a --- /dev/null +++ b/test-project-externalLib/solutions/testProjectExternalLib.build/models/testProjectExternalLib.build.mps @@ -0,0 +1,273 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test-project-externalLib/solutions/testProjectExternalLib.build/testProjectExternalLib.build.msd b/test-project-externalLib/solutions/testProjectExternalLib.build/testProjectExternalLib.build.msd new file mode 100644 index 00000000..78231013 --- /dev/null +++ b/test-project-externalLib/solutions/testProjectExternalLib.build/testProjectExternalLib.build.msd @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + 422c2909-59d6-41a9-b318-40e6256b250f(jetbrains.mps.ide.build) + bf3c8943-8801-4969-9ac2-7403444bbefa(io.lionweb.mps.build) + f1fb7b1c-ce0d-423c-9369-4a661d600029(de.itemis.mps.extensions.build) + + + + + + + + + + + + + + diff --git a/test-project/.gitignore b/test-project/.gitignore index 4c116a00..ca9e3081 100644 --- a/test-project/.gitignore +++ b/test-project/.gitignore @@ -1,11 +1,9 @@ # Ignore Gradle project-specific cache directory -.gradle +/.gradle/ # Ignore Gradle build output directory -build +/build/ # Ignore downloaded dependencies -dependencies +/dependencies/ -# Test files -/*.lw-lang.json diff --git a/test-project/.mps/modules.xml b/test-project/.mps/modules.xml index 39214096..c9e16ed2 100644 --- a/test-project/.mps/modules.xml +++ b/test-project/.mps/modules.xml @@ -2,13 +2,10 @@ + + - - - - - \ No newline at end of file diff --git a/test-project/.mps/vcs.xml b/test-project/.mps/vcs.xml new file mode 100644 index 00000000..fcf488cd --- /dev/null +++ b/test-project/.mps/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/test-project/actual/.gitignore b/test-project/actual/.gitignore new file mode 100644 index 00000000..9c08a126 --- /dev/null +++ b/test-project/actual/.gitignore @@ -0,0 +1,3 @@ +# Test files +/*.lw-lang.json + diff --git a/test-project/build.gradle.kts b/test-project/build.gradle.kts index 04ba8751..1a3c7294 100644 --- a/test-project/build.gradle.kts +++ b/test-project/build.gradle.kts @@ -21,6 +21,10 @@ dependencies { "generation"("io.lionweb.lionweb-mps:lionweb-mps-$mpsVersionSuffix-lw$lionwebRelease:$lionwebVersion") } +tasks.generateBuildscript { + args("--macro=lionweb-mps.home::${projectDir.parent}") +} + task("runCommandLineTool") { dependsOn("resolveGenerationDependencies") diff --git a/test-project/build.xml b/test-project/build.xml new file mode 100644 index 00000000..9090457e --- /dev/null +++ b/test-project/build.xml @@ -0,0 +1,296 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + testProject + test-project + 1.0 + jetbrains.mps.core + io.lionweb.mps + com.intellij.modules.platform + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + mps.build.number=${mps.build.number}${line.separator}mps.date=${mps.date}${line.separator}mps.build.vcs.number=${mps.build.vcs.number}${line.separator}mps.teamcity.buildConfName=${mps.teamcity.buildConfName}${line.separator}mps.idea.platform.build.number=${mps.idea.platform.build.number}${line.separator}mps.mps.build.counter=${mps.mps.build.counter}${line.separator}mpsBootstrapCore.version.major=${mpsBootstrapCore.version.major}${line.separator}mpsBootstrapCore.version.minor=${mpsBootstrapCore.version.minor}${line.separator}mpsBootstrapCore.version.bugfixNr=${mpsBootstrapCore.version.bugfixNr}${line.separator}mpsBootstrapCore.version.eap=${mpsBootstrapCore.version.eap}${line.separator}mpsBootstrapCore.version=${mpsBootstrapCore.version}${line.separator}io.lionweb.mps.version=${io.lionweb.mps.version} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/test-project/expected/foo.lw-lang.json b/test-project/expected/foo.lw-lang.json new file mode 100644 index 00000000..002dde8f --- /dev/null +++ b/test-project/expected/foo.lw-lang.json @@ -0,0 +1,150 @@ +{ + "serializationFormatVersion": "2023.1", + "languages": [ + { + "key": "LionCore-M3", + "version": "2023.1" + }, + { + "key": "LionCore-builtins", + "version": "2023.1" + } + ], + "nodes": [ + { + "id": "foo-language", + "classifier": { + "language": "LionCore-M3", + "version": "2023.1", + "key": "Language" + }, + "properties": [ + { + "property": { + "language": "LionCore-M3", + "version": "2023.1", + "key": "Language-version" + }, + "value": "0" + }, + { + "property": { + "language": "LionCore-M3", + "version": "2023.1", + "key": "IKeyed-key" + }, + "value": "foo-language" + }, + { + "property": { + "language": "LionCore-builtins", + "version": "2023.1", + "key": "LionCore-builtins-INamed-name" + }, + "value": "FooLanguage" + } + ], + "containments": [ + { + "containment": { + "language": "LionCore-M3", + "version": "2023.1", + "key": "Language-entities" + }, + "children": [ + "ZGZkMmU2ZTktNTcyMS00OGQ5LTlkZTktMzZiZDU0MzQ1OTUwLzQxMzAzMzkxMjExNzAwNjExMTg" + ] + } + ], + "references": [ + { + "reference": { + "language": "LionCore-M3", + "version": "2023.1", + "key": "Language-dependsOn" + }, + "targets": [] + } + ], + "annotations": [], + "parent": null + }, + { + "id": "ZGZkMmU2ZTktNTcyMS00OGQ5LTlkZTktMzZiZDU0MzQ1OTUwLzQxMzAzMzkxMjExNzAwNjExMTg", + "classifier": { + "language": "LionCore-M3", + "version": "2023.1", + "key": "Concept" + }, + "properties": [ + { + "property": { + "language": "LionCore-M3", + "version": "2023.1", + "key": "Concept-abstract" + }, + "value": "false" + }, + { + "property": { + "language": "LionCore-M3", + "version": "2023.1", + "key": "Concept-partition" + }, + "value": "false" + }, + { + "property": { + "language": "LionCore-M3", + "version": "2023.1", + "key": "IKeyed-key" + }, + "value": "ZGZkMmU2ZTktNTcyMS00OGQ5LTlkZTktMzZiZDU0MzQ1OTUwLzQxMzAzMzkxMjExNzAwNjExMTg" + }, + { + "property": { + "language": "LionCore-builtins", + "version": "2023.1", + "key": "LionCore-builtins-INamed-name" + }, + "value": "Bar" + } + ], + "containments": [ + { + "containment": { + "language": "LionCore-M3", + "version": "2023.1", + "key": "Classifier-features" + }, + "children": [] + } + ], + "references": [ + { + "reference": { + "language": "LionCore-M3", + "version": "2023.1", + "key": "Concept-extends" + }, + "targets": [ + { + "resolveInfo": "Node", + "reference": "LionCore-builtins-Node" + } + ] + }, + { + "reference": { + "language": "LionCore-M3", + "version": "2023.1", + "key": "Concept-implements" + }, + "targets": [] + } + ], + "annotations": [], + "parent": "foo-language" + } + ] +} \ No newline at end of file diff --git a/test-project/test-references/library.lw-lang.json b/test-project/expected/library.lw-lang.json similarity index 100% rename from test-project/test-references/library.lw-lang.json rename to test-project/expected/library.lw-lang.json diff --git a/test-project/test-references/multiple.lw-lang.json b/test-project/expected/multiple.lw-lang.json similarity index 100% rename from test-project/test-references/multiple.lw-lang.json rename to test-project/expected/multiple.lw-lang.json diff --git a/test-project/export-languages.json b/test-project/export-multiple.config.json similarity index 100% rename from test-project/export-languages.json rename to test-project/export-multiple.config.json diff --git a/test-project/gradle.properties b/test-project/gradle.properties index 24549ea9..1f442d64 100644 --- a/test-project/gradle.properties +++ b/test-project/gradle.properties @@ -3,3 +3,5 @@ lionwebRelease=2023.1 mpsVersionSuffix=2021.1 mpsVersion=2021.1.4 comSpecificlanguagesMpsVersion=1.6.0 +lionweb-mps.home=. +mps.macro.lionweb-mps.home=. \ No newline at end of file diff --git a/test-project/languages/FooLanguage/FooLanguage.mpl b/test-project/languages/FooLanguage/FooLanguage.mpl new file mode 100644 index 00000000..4b59836c --- /dev/null +++ b/test-project/languages/FooLanguage/FooLanguage.mpl @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test-project/languages/FooLanguage/models/FooLanguage.behavior.mps b/test-project/languages/FooLanguage/models/FooLanguage.behavior.mps new file mode 100644 index 00000000..4940119c --- /dev/null +++ b/test-project/languages/FooLanguage/models/FooLanguage.behavior.mps @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/test-project/languages/FooLanguage/models/FooLanguage.structure.mps b/test-project/languages/FooLanguage/models/FooLanguage.structure.mps new file mode 100644 index 00000000..ccf4fdce --- /dev/null +++ b/test-project/languages/FooLanguage/models/FooLanguage.structure.mps @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test-project/scripts/export-foo.sh b/test-project/scripts/export-foo.sh new file mode 100755 index 00000000..b8ccd13e --- /dev/null +++ b/test-project/scripts/export-foo.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +OUTPUT_FILE=foo.lw-lang.json + +./gradlew runCommandLineTool -Pargs=". -lfoo-language actual/$OUTPUT_FILE -mlionweb-mps.home=./../ -s=listed" + +diff actual/$OUTPUT_FILE expected/$OUTPUT_FILE diff --git a/test-project/scripts/export-library.sh b/test-project/scripts/export-library.sh new file mode 100755 index 00000000..71b19fbd --- /dev/null +++ b/test-project/scripts/export-library.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +OUTPUT_FILE=library.lw-lang.json + +./gradlew runCommandLineTool -Pargs=". -lNTM3ZjljYjAtMGYyNS0zYzc2LThiODYtMzA4ZjQ1MDEwMTAw actual/$OUTPUT_FILE -mlionweb-mps.home=./../ -s=listed" + +diff actual/$OUTPUT_FILE expected/$OUTPUT_FILE diff --git a/test-project/scripts/export-multiple.sh b/test-project/scripts/export-multiple.sh new file mode 100755 index 00000000..f6183461 --- /dev/null +++ b/test-project/scripts/export-multiple.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +OUTPUT_FILE=multiple.lw-lang.json + +./gradlew runCommandLineTool -Pargs=". export-multiple.config.json actual/$OUTPUT_FILE -mlionweb-mps.home=./../" + +diff actual/$OUTPUT_FILE expected/$OUTPUT_FILE diff --git a/test-project/solutions/test-project.build/models/test-project.build.mps b/test-project/solutions/test-project.build/models/test-project.build.mps new file mode 100644 index 00000000..f3b11e9f --- /dev/null +++ b/test-project/solutions/test-project.build/models/test-project.build.mps @@ -0,0 +1,269 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test-project/solutions/test-project.build/test-project.build.msd b/test-project/solutions/test-project.build/test-project.build.msd new file mode 100644 index 00000000..aa02fdd1 --- /dev/null +++ b/test-project/solutions/test-project.build/test-project.build.msd @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + 422c2909-59d6-41a9-b318-40e6256b250f(jetbrains.mps.ide.build) + bf3c8943-8801-4969-9ac2-7403444bbefa(io.lionweb.mps.build) + + + + + + + + + + + + + diff --git a/test-project/test-scripts/export-library.sh b/test-project/test-scripts/export-library.sh deleted file mode 100644 index 5fdfe44a..00000000 --- a/test-project/test-scripts/export-library.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh - -OUTPUT_FILE=library.lw-lang.json - -./gradlew runCommandLineTool -Pargs=". -lNTM3ZjljYjAtMGYyNS0zYzc2LThiODYtMzA4ZjQ1MDEwMTAw $OUTPUT_FILE -mlionweb-mps.home=./../ -s=listed" - -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 deleted file mode 100644 index 9b006c1d..00000000 --- a/test-project/test-scripts/export-multiple.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh - -OUTPUT_FILE=multiple.lw-lang.json - -./gradlew runCommandLineTool -Pargs=". export-languages.json $OUTPUT_FILE -mlionweb-mps.home=./../" - -diff $OUTPUT_FILE test-references/$OUTPUT_FILE