Skip to content

Commit 02b8cbd

Browse files
committed
fixes
1 parent 5b584e5 commit 02b8cbd

1 file changed

Lines changed: 34 additions & 30 deletions

File tree

courses/GettingStarted/MavenPlugin/CompileMojo/CompileMojo.md

Lines changed: 34 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@ keywords:
77
- "rascal:compile"
88
---
99

10+
#### Synopsis
11+
12+
Basic project configuration for Rascal projects, checking, compilation and running.
13+
14+
#### Decription
15+
16+
The `compile` mojo calls the Rascal static checker and compiler on the source code in a Rascal project. Also it uses information from the libraries the current project depends on (including the standard library). The configuration here is also the core of the configuration for the other maven plugins.
17+
1018
All Rascal projects are assumed to be configured via a Maven `pom.xml` file. To use the Rascal compiler via the `mvn rascal:compile` goal:
1119
1. The Rascal compiler is made available to the project via adding a proper `<plugin>` tag for the `rascal-maven-plugin`.
1220
1. Dependencies on other Rascal or JVM-based projects are declared in with `<dependency>` tags.
@@ -32,7 +40,32 @@ Next to these files the compiler outputs messages and their origin location:
3240
* `[WARNING]` messages report on likely issues in `Module.rsc`; for example likely to be incomplete and throw an exception, or likely to never match and be dead, etc.
3341
* `[INFO]` messages provide information useful for understanding advanced features of Rascal or hint at to be deprecated behavior that a programmer might prepare themselves for.
3442

35-
#### Configuring the compiler with Maven
43+
The configuration tags for the compile mojo are an extended subset of the standard fields of ((data:PathConfig)).
44+
The defaults are chosen such that you hardly have to use these tags.
45+
46+
| *Configuration tag* | *Default* | *Description* |
47+
| ------------------- | ----------| ------------- |
48+
| `<srcs>` | `<src>./src/main/rascal</src>` | list of directories where `.rsc` files can be found |
49+
| `<libs>` | filled with `<dependencies>` | list of jar files or directories for the library dependencies |
50+
| `<ignores>` | empty | list of folders and files to skip while compiling |
51+
| `<generatedSources>` | `./target/generated-sources` | where the compiler stores intermediate Java code |
52+
| `<bin>` | `./target/classes` | where the binary output of the compiler is staged before it goes into the jar file |
53+
| `<logPathConfig>` | false | write the pathConfig to the log before compiling |
54+
| `<logImports>` | false | write imports and extends of each module to the log during compilation |
55+
| `<logWrittenFiles>` | false | log every file written including timestamp during compilation |
56+
| `<warnUnused>` | true | warn about unused declarations |
57+
| `<warnedUnusedFormals>` | true | warn about unused formal parameters (pattern variables of function signatures) |
58+
| `<warnUnusedPatternFormals>` | true | warn about unused variables in patterns |
59+
| `<errorsAsWarnings>` | false | with this the compiler never reports failure in the presence of errors |
60+
| `<warningsAsErrors>` | false | with this the compiler reports failure even if there are only warnings and no errors. Can not be true at the same time with `errorsAsWarnings` |
61+
| `<parallel>` | false | enables parallel compilation of a large group of `.rsc` source files |
62+
| `<parallelMax>` | `5` | restricts the number of parallel compiler processes. The mojo otherwises
63+
computes an estimate based on the number of processors and the available memory |
64+
| `<parallelPrechecks>` | empty | a list of files reachable from `<srcs>` that will be compiled before the
65+
other processes start. |
66+
| `<verbose>` | enables internal debugging prints of the compiler |
67+
68+
#### Examples
3669

3770
The compiler is configured in `pom.xml` in three locations:
3871
* `<dependencies>...</dependencies>` - each dependency leads to a compile-time library path entry, and a run-time JVM classpath entry.
@@ -73,37 +106,8 @@ The compiler is configured in `pom.xml` in three locations:
73106
```
74107
* The latter overwrites the first, tag-by-tag
75108

76-
The configuration tags are an extended subset of the standard fields of ((data:PathConfig)).
77-
The defaults are chosen such that you hardly have to use these tags.
78-
79-
| *Configuration tag* | *Default* | *Description* |
80-
| ------------------- | ----------| ------------- |
81-
| `<srcs>` | `<src>./src/main/rascal</src>` | list of directories where `.rsc` files can be found |
82-
| `<libs>` | filled with `<dependencies>` | list of jar files or directories for the library dependencies |
83-
| `<ignores>` | empty | list of folders and files to skip while compiling |
84-
| `<generatedSources>` | `./target/generated-sources` | where the compiler stores intermediate Java code |
85-
| `<bin>` | `./target/classes` | where the binary output of the compiler is staged before it goes into the jar file |
86-
| `<logPathConfig>` | false | write the pathConfig to the log before compiling |
87-
| `<logImports>` | false | write imports and extends of each module to the log during compilation |
88-
| `<logWrittenFiles>` | false | log every file written including timestamp during compilation |
89-
| `<warnUnused>` | true | warn about unused declarations |
90-
| `<warnedUnusedFormals>` | true | warn about unused formal parameters (pattern variables of function signatures) |
91-
| `<warnUnusedPatternFormals>` | true | warn about unused variables in patterns |
92-
| `<errorsAsWarnings>` | false | with this the compiler never reports failure in the presence of errors |
93-
| `<warningsAsErrors>` | false | with this the compiler reports failure even if there are only warnings and no errors. Can not be true at the same time with `errorsAsWarnings` |
94-
| `<parallel>` | false | enables parallel compilation of a large group of `.rsc` source files |
95-
| `<parallelMax>` | `5` | restricts the number of parallel compiler processes. The mojo otherwises
96-
computes an estimate based on the number of processors and the available memory |
97-
| `<parallelPrechecks>` | empty | a list of files reachable from `<srcs>` that will be compiled before the
98-
other processes start. |
99-
| `<verbose>` | enables internal debugging prints of the compiler |
100-
101-
#### Examples
102-
103109
Maven is typically executed on the Un*x or Windows commandline like so:
104110
```bash
105-
#! /bin/bash
106-
107111
# Typically runs the compiler and the tests before packaging everything
108112
# in a jar file, and copying it to your local Maven repository:
109113
mvn install

0 commit comments

Comments
 (0)