-
Notifications
You must be signed in to change notification settings - Fork 317
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
First test of xtext-maven-plugin accessing a Java record
Currently, we force the JDT version 3.37.0, the one supporting Java 21, as an explicit dependency of the plugin in the IT project
- Loading branch information
1 parent
64c02b0
commit a358d08
Showing
4 changed files
with
90 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
71 changes: 71 additions & 0 deletions
71
org.eclipse.xtext.maven.plugin/src/test/resources/it/generate/java-lang-21-bi-ref/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>org.eclipse.xtext</groupId> | ||
<artifactId>xtext-maven-plugin-it</artifactId> | ||
<version>IT-SNAPSHOT</version> | ||
</parent> | ||
|
||
<properties> | ||
<maven.compiler.source>21</maven.compiler.source> | ||
<maven.compiler.target>21</maven.compiler.target> | ||
</properties> | ||
|
||
<artifactId>java-lang-21-bi-ref</artifactId> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.codehaus.mojo</groupId> | ||
<artifactId>build-helper-maven-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<id>add-source</id> | ||
<phase>generate-sources</phase> | ||
<goals> | ||
<goal>add-source</goal> | ||
</goals> | ||
<configuration> | ||
<sources> | ||
<source>src-gen</source> | ||
</sources> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.eclipse.xtext</groupId> | ||
<artifactId>xtext-maven-plugin</artifactId> | ||
<configuration> | ||
<languages> | ||
<language> | ||
<setup>org.eclipse.xtext.purexbase.PureXbaseStandaloneSetup</setup> | ||
</language> | ||
</languages> | ||
</configuration> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.eclipse.xtext</groupId> | ||
<artifactId>org.eclipse.xtext.purexbase</artifactId> | ||
<version>${xtext-version}</version> | ||
</dependency> | ||
<!-- force the version of JDT that supports Java 21 --> | ||
<dependency> | ||
<groupId>org.eclipse.jdt</groupId> | ||
<artifactId>ecj</artifactId> | ||
<version>3.37.0</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.eclipse.jdt</groupId> | ||
<artifactId>org.eclipse.jdt.core</artifactId> | ||
<version>3.37.0</version> | ||
</dependency> | ||
</dependencies> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
</project> |
5 changes: 5 additions & 0 deletions
5
...xtext.maven.plugin/src/test/resources/it/generate/java-lang-21-bi-ref/src/JavaRecord.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
public record JavaRecord(String name) { | ||
public void useXbaseType(XbaseReferToJava xbaseType) throws Throwable { | ||
xbaseType.myMethod(); | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
...aven.plugin/src/test/resources/it/generate/java-lang-21-bi-ref/src/XbaseReferToJava.xbase
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
val JavaRecord jr = new JavaRecord("test") | ||
val name = jr.name() | ||
jr.useXbaseType(this) |