Skip to content

Commit

Permalink
Update migration documentation wrt new project structure
Browse files Browse the repository at this point in the history
  • Loading branch information
Gohla committed Mar 24, 2016
1 parent 86747a0 commit 54fbfc8
Showing 1 changed file with 85 additions and 4 deletions.
89 changes: 85 additions & 4 deletions source/release/migrate/2.0.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,34 @@ The following files and directories are no longer part of the project structure:
* Refactoring: <span class='file'>lib/refactor-common.generated.str</span>
* Deprecated ESV files: <span class='file'>editor/langname-Completions.esv</span>, <span class='file'>editor/langname-Folding.esv</span>, <span class='file'>editor/langname-Outliner.str</span>, <span class='file'>editor/langname-Refactorings.esv</span>
* Generated ESV files: <span class='file'>editor/langname-\*.generated.esv</span>, <span class='file'>editor/langname-Outliner.generated.str</span>
* The RTG and signatures files are no longer generated for SDF3 projects, since SDF3 generates its own signatures.
* The generated box pp files are no longer generated, and box pp files are no longer converted into pp.af files.

The following files and directories have been moved:

* ESV
* Main ESV file must be at <span class='file'>editor/Main.esv</span>. If it does not exist, no packed ESV file will be generated.
* Packed ESV file: <span class='file'>target/metaborg/editor.esv.af</span>
* SDF
* Definition: <span class='file'>src-gen/syntax/[LanguageName].def</span>
* Permissive definition: <span class='file'>src-gen/syntax/[LanguageName]-permissive.def</span>
* Parenthesizer: <span class='file'>src-gen/pp/[LanguageName]-parenthesize.str</span>
* Parse table: <span class='file'>target/metaborg/sdf.tbl</span>
* Stratego
* 'editor-common.generated' file: <span class='file'>src-gen/stratego/metaborg.str</span>
* Ctree: <span class='file'>target/metaborg/stratego.ctree</span>
* Generated Java files: <span class='file'>src-gen/stratego-java</span>
* JAR: <span class='file'>target/metaborg/stratego.jar</span>
* Java strategies: <span class='file'>src/main/strategies</span>
* Java strategies JAR: <span class='file'>target/metaborg/stratego-javastrat.jar</span>
* Build cache: <span class='file'>target/stratego-cache</span>
* DynSem
* Manual Java: <span class='file'>src/main/ds</span>
* Generated Java: <span class='file'>src-gen/ds-java</span>

The following generated files and directories still exist, but should not be published to source control any more:

* <span class='file'>lib/editor-common.generated.str</span>
* <span class='file'>lib/editor-common.generated.str</span> or <span class='file'>stratego/metaborg.str</span>
* <span class='file'>src-gen</span>

When importing a language specification project into Eclipse or IntelliJ, several platform-specific files will be generated. These files should not be published to source control to keep projects as platform-agnostic as possible.
Expand Down Expand Up @@ -145,7 +169,28 @@ The [manual page on configuration](../../langdev/manual/config.md) lists all con

#### Imports

Remove `src-gen`, `lib`, and `trans`, from Stratego module names and imports. These paths are now on the source path of the Stratego compiler.
In Stratego, SDF2, SDF3, NaBL, and TS files:

* Remove `src-gen`, `lib`, and `trans`, from module names and imports. These paths are now on the source path of the SDF and Stratego compilers.

In Stratego, NaBL, and TS files:

* Instead of importing `lib/editor-common.generated`, import `stratego/metaborg`.
* Instead of importing `include/<langname>-parenthesize`, import `pp/<langname>-parenthesize`.
* If you're using SDF3:
* Instead of importing the signatures from `include/<langname>`, import them from `signatures/<langname>-sig`. These signatures are spread over multiple files, import all the required files to fix errors, since the Stratego editor does not handle transitive imports. You can also use the wildcard import `signatures/-` to import all signature files, if your syntax definition is not spread over multiple directories.
* If you're using SDF2 or an external definition file:
* Instead of importing the signatures from `include/<langname>`, import them from `signatures/<langname>`.

#### SDF

If you are still using SDF2 instead of SDF3, add the following setting to the <span class='file'>metaborg.yaml</span> file:

```yaml
language:
sdf:
version: sdf2
```

#### NaBL and TS

Expand All @@ -167,7 +212,7 @@ with the `pre-analysis`, `post-analysis`, and `pp-message` arguments that you we
#### ESV

* The following ESV files are now deprecated, delete and remove any imports to these files:
* <span class='file'>editor/langname-Colorer.esv</span>
* <span class='file'>editor/langname-Completions.esv</span>
* <span class='file'>editor/langname-Folding.esv</span>
* <span class='file'>editor/langname-Refactorings.esv</span>
* Previously generated ESV files in the <span class='file'>editor</span> directory are not generated any more. Delete the generated files and remove the imports to generated files.
Expand All @@ -180,7 +225,43 @@ language
block comment : "/*" * "*/"
fences : [ ] ( ) { }
```
* The outliner (<span class='file'>editor/langname-Outliner.str</span>) must be moved to the <span class='file'>trans</span> directory. The <span class='file'>editor</span> directory is no longer a source directory for Stratego.
* The outliner (<span class='file'>editor/langname-Outliner.str</span>) must be moved to the <span class='file'>trans</span> directory. Rename it to <span class='file'>trans/outline.str</file>, change its module to `outline`, and fix imports of the outliner.
* Change the file name of the main ESV file to <span class='file'>Main.esv</span>, and change its module to `Main`.
* In the main ESV file:
* Change the parse table:
```esv
table : target/metaborg/sdf.tbl
```
* Change the Stratego providers
* For ctree projects:
```esv
provider : target/metaborg/stratego.ctree
```
* For jar projects:
```esv
provider : target/metaborg/stratego.jar
```
* For projects with Java strategies:
```esv
provider : target/metaborg/stratego.jar
provider : target/metaborg/stratego-javastrat.jar
```

#### Java strategies

If your project has Java strategies:

* Create the <span class='file'>src/main/strategies</span> directory.
* Move Java strategies from <span class='file'>editor/java</span> into the <span class='file'>src/main/strategies</span> directory. Be sure to preserve the existing Java package structure.
* Perform a Maven update by right clicking the project and choosing <span class='menuselection'>Maven ‣ Update Project...</span>, to update the Java source directories of the project.

#### DynSem

If your project has manual DynSem Java files:

* Create the <span class='file'>src/main/ds</span> directory.
* Move manual DynSem Java files from <span class='file'>editor/java</span> into the <span class='file'>src/main/ds</span> directory. Be sure to preserve the existing Java package structure.
* Perform a Maven update by right clicking the project and choosing <span class='menuselection'>Maven ‣ Update Project...</span>, to update the Java source directories of the project.

#### Ant build customization

Expand Down

0 comments on commit 54fbfc8

Please sign in to comment.