Skip to content

Commit fe9e46f

Browse files
committed
Difficult merge branch of 'main' into replace-lib-scheme
Watch out the snapshot dependency on rascal also needs to change to "unshaded" again
2 parents 094a4e4 + df2aebf commit fe9e46f

File tree

10 files changed

+181
-262
lines changed

10 files changed

+181
-262
lines changed

.classpath

Lines changed: 0 additions & 62 deletions
This file was deleted.

.github/workflows/build.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ env:
1515
jobs:
1616
builds:
1717
if: ${{ !(github.ref == 'refs/heads/main' && contains(github.event.head_commit.message, '[maven-release-plugin]')) }}
18-
runs-on: buildjet-4vcpu-ubuntu-2204
18+
runs-on: buildjet-2vcpu-ubuntu-2204
1919
needs: [tests]
2020
steps:
2121
- uses: actions/checkout@v4
@@ -61,7 +61,7 @@ jobs:
6161
runs-on: ${{matrix.os}}
6262
strategy:
6363
matrix:
64-
os: [buildjet-4vcpu-ubuntu-2204, windows-latest, macos-latest]
64+
os: [buildjet-2vcpu-ubuntu-2204, windows-latest, macos-latest]
6565
steps:
6666
- uses: actions/checkout@v4
6767
- uses: actions/setup-java@v4

.project

Lines changed: 0 additions & 34 deletions
This file was deleted.
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
eclipse.preferences.version=1
22
org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
3-
org.eclipse.jdt.core.compiler.annotation.nonnull=javax.annotation.Nonnull
4-
org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=javax.annotation.ParametersAreNonnullByDefault
5-
org.eclipse.jdt.core.compiler.annotation.nullable=javax.annotation.Nullable
6-
org.eclipse.jdt.core.compiler.annotation.nullanalysis=enabled
3+
org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
4+
org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
5+
org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
6+
org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
77
org.eclipse.jdt.core.compiler.codegen.methodParameters=generate
88
org.eclipse.jdt.core.compiler.codegen.targetPlatform=11
99
org.eclipse.jdt.core.compiler.compliance=11
1010
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
1111
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
12-
org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=warning
12+
org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
1313
org.eclipse.jdt.core.compiler.problem.nullReference=warning
14-
org.eclipse.jdt.core.compiler.problem.nullSpecViolation=warning
15-
org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=ignore
16-
org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning
14+
org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
15+
org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
16+
org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
1717
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
18-
org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=enabled
18+
org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled
1919
org.eclipse.jdt.core.compiler.processAnnotations=enabled
2020
org.eclipse.jdt.core.compiler.release=enabled
2121
org.eclipse.jdt.core.compiler.source=11

pom.xml

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33

44
<groupId>org.rascalmpl</groupId>
55
<artifactId>rascal-maven-plugin</artifactId>
6-
<version>0.28.2-SNAPSHOT</version>
6+
<version>0.29.0-RC2-SNAPSHOT</version>
77
<packaging>maven-plugin</packaging>
88

99
<scm>
1010
<developerConnection>scm:git:ssh://git@github.com/usethesource/rascal-maven-plugin.git</developerConnection>
11-
<tag>HEAD</tag>
11+
<tag>SNAPSHOT</tag>
1212
</scm>
1313

1414
<name>Rascal Maven Plugin</name>
@@ -34,63 +34,68 @@
3434
<dependencies>
3535
<dependency>
3636
<groupId>org.rascalmpl</groupId>
37-
<artifactId>rascal</artifactId>
37+
<artifactId>rascal-unshaded</artifactId>
3838
<version>0.41.0-RC13-SNAPSHOT</version>
3939
</dependency>
40+
<dependency>
41+
<groupId>org.jline</groupId>
42+
<artifactId>jline-terminal</artifactId>
43+
<version>3.27.0</version>
44+
</dependency>
4045
<dependency>
4146
<groupId>org.rascalmpl</groupId>
4247
<artifactId>rascal-tutor</artifactId>
43-
<version>0.19.5</version>
48+
<version>0.19.9</version>
4449
</dependency>
4550
<dependency>
4651
<groupId>org.rascalmpl</groupId>
4752
<artifactId>typepal</artifactId>
48-
<version>0.13.4</version>
53+
<version>0.14.8</version>
4954
</dependency>
5055
<dependency>
5156
<groupId>org.rascalmpl</groupId>
5257
<artifactId>rascal-core</artifactId>
53-
<version>0.12.3</version>
58+
<version>0.12.12-fixrascal0.41.0</version>
5459
</dependency>
5560
<dependency>
5661
<groupId>org.apache.maven</groupId>
5762
<artifactId>maven-plugin-api</artifactId>
58-
<version>3.6.0</version>
63+
<version>3.9.9</version>
5964
</dependency>
6065
<dependency>
6166
<groupId>org.apache.maven.plugins</groupId>
6267
<artifactId>maven-compiler-plugin</artifactId>
63-
<version>3.8.1</version>
68+
<version>3.13.0</version>
6469
</dependency>
6570
<dependency>
6671
<groupId>org.apache.maven.plugin-tools</groupId>
6772
<artifactId>maven-plugin-annotations</artifactId>
68-
<version>3.6.0</version>
73+
<version>3.15.1</version>
6974
</dependency>
7075
<dependency>
7176
<groupId>org.apache.maven</groupId>
7277
<artifactId>maven-model</artifactId>
73-
<version>3.6.0</version>
78+
<version>3.9.9</version>
7479
</dependency>
7580
<dependency>
7681
<groupId>org.apache.maven</groupId>
7782
<artifactId>maven-artifact</artifactId>
78-
<version>3.6.0</version>
83+
<version>3.9.9</version>
7984
</dependency>
8085
<dependency>
8186
<groupId>org.apache.maven</groupId>
82-
<artifactId>maven-project</artifactId>
83-
<version>3.0-alpha-2</version>
87+
<artifactId>maven-core</artifactId>
88+
<version>3.9.9</version>
8489
</dependency>
8590
<dependency>
8691
<groupId>org.codehaus.plexus</groupId>
8792
<artifactId>plexus-utils</artifactId>
88-
<version>3.1.1</version>
93+
<version>3.6.0</version>
8994
</dependency>
9095
<dependency>
9196
<groupId>junit</groupId>
9297
<artifactId>junit</artifactId>
93-
<version>4.13.1</version>
98+
<version>4.13.2</version>
9499
<scope>test</scope>
95100
</dependency>
96101
</dependencies>

src/main/java/org/rascalmpl/maven/CompileRascalDocumentation.java

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545

4646
/**
4747
* Maven Goal for Rascal Tutor Documentation compilation. The input is a list of
48-
* Rascal source folders, and course folders, and the output is for each module
48+
* Rascal source folders, and course folders, and the output is for each module
4949
* a markdown file and for each markdown file in a source course an output markdown
5050
* file. The compiler also copies images from source to a target assets folder.
5151
* Also a list of errors and warnings is printed on stderr.
@@ -131,10 +131,6 @@ public class CompileRascalDocumentation extends AbstractMojo
131131
@Parameter(defaultValue = "${session}", required = true, readonly = true)
132132
private MavenSession session;
133133

134-
private Evaluator makeEvaluator(OutputStream err, OutputStream out) throws URISyntaxException, FactTypeUseException, IOException {
135-
return MojoUtils.makeEvaluator(getLog(), session, err, out, MAIN_COMPILER_SEARCH_PATH, MAIN_COMPILER_MODULE);
136-
}
137-
138134
public void execute() throws MojoExecutionException {
139135
try {
140136
ISourceLocation binLoc = URIUtil.getChildLocation(MojoUtils.location(bin), "docs");
@@ -164,18 +160,18 @@ public void execute() throws MojoExecutionException {
164160
}
165161

166162
PathConfig pcfg = new PathConfig(srcLocs, libLocs, binLoc, ignoredLocs, generatedSourcesLoc, Collections.emptyList());
167-
163+
168164
getLog().info("Paths have been configured: " + pcfg);
169165

170166
URIResolverRegistry.getInstance().registerLogical(
171167
new ProjectURIResolver(
172168
MojoUtils.location(
173-
project.getBasedir().getCanonicalFile().toString()),
169+
project.getBasedir().getCanonicalFile().toString()),
174170
project.getName()
175171
)
176172
);
177173

178-
Evaluator eval = makeEvaluator(System.err, System.out);
174+
Evaluator eval = MojoUtils.makeEvaluator(getLog(), session, MAIN_COMPILER_SEARCH_PATH, MAIN_COMPILER_MODULE);
179175
IList messages = runCompiler(eval.getMonitor(), eval, pcfg);
180176

181177
getLog().info("Tutor is done, reporting errors now.");
@@ -191,7 +187,7 @@ public void execute() throws MojoExecutionException {
191187
getLog().error(e.getLocation() + ": " + e.getMessage());
192188
getLog().error(e.getTrace().toString());
193189
throw new MojoExecutionException(UNEXPECTED_ERROR, e);
194-
}
190+
}
195191
}
196192

197193
private List<ISourceLocation> collectClasspath() throws URISyntaxException {
@@ -228,6 +224,16 @@ private List<ISourceLocation> collectClasspath() throws URISyntaxException {
228224
getLog().info("Current project does not have a dependency on org.rascalmpl:rascal");
229225
}
230226

227+
return builder;
228+
}
229+
230+
private List<ISourceLocation> collectPluginClasspath() throws URISyntaxException {
231+
List<ISourceLocation> builder = new LinkedList<>();
232+
233+
builder.add(MojoUtils.location(IValue.class.getProtectionDomain().getCodeSource().getLocation().getPath()));
234+
builder.add(MojoUtils.location(Evaluator.class.getProtectionDomain().getCodeSource().getLocation().getPath()));
235+
236+
231237
return builder;
232238
}
233239

@@ -247,7 +253,7 @@ private IList runCompiler(IRascalMonitor monitor, IEvaluator<Result<IValue>> eva
247253
if (issues != null) {
248254
pc = pc.asWithKeywordParameters().setParameter("issues", MojoUtils.location(issues));
249255
}
250-
256+
251257
pc = pc.asWithKeywordParameters().setParameter("license", MojoUtils.location(licenseFile));
252258
pc = pc.asWithKeywordParameters().setParameter("funding", MojoUtils.location(funding));
253259
pc = pc.asWithKeywordParameters().setParameter("citation", MojoUtils.location(citation));
@@ -257,13 +263,8 @@ private IList runCompiler(IRascalMonitor monitor, IEvaluator<Result<IValue>> eva
257263
return (IList) eval.call(monitor, "compile", pc);
258264
}
259265
finally {
260-
try {
261-
eval.getStdErr().flush();
262-
eval.getStdOut().flush();
263-
}
264-
catch (IOException ignored) {
265-
// this is ok
266-
}
266+
eval.getErrorPrinter().flush();
267+
eval.getOutPrinter().flush();
267268
}
268269
}
269270

0 commit comments

Comments
 (0)