Skip to content

Commit

Permalink
Merge pull request #324 from tjeske/tjeske/dev
Browse files Browse the repository at this point in the history
Modernize Xpect
  • Loading branch information
cdietrich authored Sep 12, 2023
2 parents 0555a73 + f5e7268 commit 27dab6c
Show file tree
Hide file tree
Showing 276 changed files with 6,510 additions and 4,053 deletions.
13 changes: 9 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
*.class
*.jar
bin
target
.DS_Store
.settings/
bin/
build/
model/
src-gen/
xtend-gen/
xtext-gen/
target/
xpect-local-maven-repository
File renamed without changes.
37 changes: 11 additions & 26 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ timestamps() {
pipelineTriggers([cron('H 2 * * *')])
])
node('centos-8') {
def javaHome = tool 'temurin-jdk8-latest'
def javaHome = tool 'temurin-jdk11-latest'
def java17Home = tool 'temurin-jdk17-latest'
env.JAVA_HOME = "${javaHome}"
def java11Home = tool 'temurin-jdk11-latest'
def mvnHome = tool 'apache-maven-3.8.6'
def mvnParams = '--batch-mode --update-snapshots -fae -Dmaven.repo.local=xpect-local-maven-repository -DtestOnly=false'
timeout(time: 1, unit: 'HOURS') {
Expand All @@ -40,32 +40,17 @@ timestamps() {
echo("===================================")
}

stage('compile with Eclipse Luna and Xtext 2.9.2') {
sh "${mvnHome}/bin/mvn -P!tests -Declipsesign=true -Dtarget-platform=eclipse_4_4_2-xtext_2_9_2 ${mvnParams} clean install"
archiveArtifacts artifacts: 'org.eclipse.xpect.releng/p2-repository/target/repository/**/*.*,org.eclipse.xpect.releng/p2-repository/target/org.eclipse.xpect.repository-*.zip'
}

wrap([$class: 'Xvnc', useXauthority: true]) {

stage('test with Eclipse Luna and Xtext 2.9.2') {
try{
sh "${mvnHome}/bin/mvn -P!plugins -P!xtext-examples -Dtarget-platform=eclipse_4_4_2-xtext_2_9_2 ${mvnParams} clean integration-test"
}finally{
junit '**/TEST-*.xml'
}
}

stage('test with Eclipse Mars and Xtext 2.14') {
try{
sh "${mvnHome}/bin/mvn -P!plugins -P!xtext-examples -Dtarget-platform=eclipse_4_5_0-xtext_2_14_0 ${mvnParams} clean integration-test"
}finally {
junit '**/TEST-*.xml'
}
stage('compile with Eclipse 2023-03 and Xtext 2.31.0') {
sh "${mvnHome}/bin/mvn -P!tests -Declipsesign=true -Dtarget-platform=eclipse_2023_03-xtext_2_31_0 ${mvnParams} clean install"
archiveArtifacts artifacts: 'org.eclipse.xpect.releng/p2-repository/target/repository/**/*.*,org.eclipse.xpect.releng/p2-repository/target/org.eclipse.xpect.repository-*.zip'
}
}

stage('test with Eclipse 2022-03 and Xtext nighly') {
wrap([$class: 'Xvnc', useXauthority: true]) {
stage('test with Eclipse 2023-09 and Xtext nighly') {
try{
sh "JAVA_HOME=${java11Home} ${mvnHome}/bin/mvn -P!plugins -P!xtext-examples -Dtycho-version=2.7.5 -Dtarget-platform=eclipse_2022_03-xtext_nightly ${mvnParams} clean integration-test"
sh "JAVA_HOME=${java17Home} ${mvnHome}/bin/mvn -P!xtext-examples -Dtycho-version=2.7.5 -Dtarget-platform=eclipse_2023_09-xtext_nightly ${mvnParams} clean integration-test"
}finally {
junit '**/TEST-*.xml'
}
Expand All @@ -83,7 +68,7 @@ timestamps() {
echo -e "5\ny\n" | gpg --batch --command-fd 0 --expert --edit-key $fpr trust;
done
'''
sh "${mvnHome}/bin/mvn -P!tests -P maven-publish -Dtarget-platform=eclipse_4_4_2-xtext_2_9_2 ${mvnParams} clean deploy"
sh "${mvnHome}/bin/mvn -P!tests -P maven-publish -Dtarget-platform=eclipse_2023_03-xtext_2_31_0 ${mvnParams} clean deploy"
}

}
Expand All @@ -98,7 +83,7 @@ timestamps() {
echo -e "5\ny\n" | gpg --batch --command-fd 0 --expert --edit-key $fpr trust;
done
'''
sh "${mvnHome}/bin/mvn -P!tests -P!xtext-examples -P maven-publish -Dtarget-platform=eclipse_4_4_2-xtext_2_9_2 ${mvnParams} clean deploy"
sh "${mvnHome}/bin/mvn -P!tests -P!xtext-examples -P maven-publish -Dtarget-platform=eclipse_2023_03-xtext_2_31_0 ${mvnParams} clean deploy"
}

}
Expand Down
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,13 @@ Use Jenkins https://ci.eclipse.org/xpect/job/Xpect/job/master/lastSuccessfulBuil

## Compile and Build Xpect by Yourself

**The Fast Way:** Download [OOMPH](https://wiki.eclipse.org/Eclipse_Oomph_Installer) and point it to [Xpect.setup](https://github.com/eclipse/Xpect/raw/master/org.eclipse.xpect.releng/Xpect.setup).

**The Manual Way:** Prerequisite: Java 1.8 or newer; Eclipse 3.8 or 4.2 or newer; Xtext 2.9.2.
Prerequisite: Java 11 or newer; Eclipse (2023-03 or newer recommended); Xtext 2.31.0.

1. Clone https://github.com/eclipse/Xpect (this repository)
2. Import all projects into your Eclipse workspace.
3. Set target platform to /org.eclipse.xpect.releng/target-platforms/eclipse_4_6_3-xtext_2_9_2/org.eclipse.xpect.target.eclipse_4_6_3-xtext_2_9_2.target (Preferences -> Plug-in Development -> Target Platform)
3. Set target platform to /org.eclipse.xpect.releng/target-platforms/eclipse_2023_03-xtext_2_31_0/org.eclipse.xpect.target.eclipse_2023_03-xtext_2_31_0.target (Preferences -> Plug-in Development -> Target Platform)
4. Run /org.eclipse.xpect/src/org/eclipse/xpect/GenerateXpect.mwe2, /org.xtext.example.arithmetics/src/org/eclipse/xpect/example/arithmetics/GenerateXpect.mwe2, /org.xtext.example.domainmodel/src/org/xtext/example/domainmodel/GenerateDomainmodel.mwe2. Now your projects should be without errors markers. Sometimes, even after these steps, several projects still have error markers. However, this is a refresh problem in Eclipse. Simply clean build the projects with error markers will solve the issues.
5. Run `mvn -P '!tests' -Dtarget-platform=eclipse_4_4_2-xtext_2_9_2 --batch-mode --update-snapshots -fae -Dmaven.repo.local=xpect-local-maven-repository -DtestOnly=false clean install` to build artefacts and create a p2 repository (formerly known as update site).
5. Run `mvn -P '!tests' -Dtarget-platform=eclipse_2023_03-xtext_2_31_0 --batch-mode --update-snapshots -fae -Dmaven.repo.local=xpect-local-maven-repository -DtestOnly=false clean install` to build artefacts and create a p2 repository (formerly known as update site).



2 changes: 1 addition & 1 deletion org.eclipse.xpect.doc/.classpath
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11">
<accessrules>
<accessrule kind="accessible" pattern="com/sun/javadoc/**"/>
<accessrule kind="accessible" pattern="com/sun/tools/javadoc/**"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
eclipse.preferences.version=1
encoding/<project>=UTF-8
10 changes: 7 additions & 3 deletions org.eclipse.xpect.doc/.settings/org.eclipse.jdt.core.prefs
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
org.eclipse.jdt.core.compiler.codegen.targetPlatform=11
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.compliance=11
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.8
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=11
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
Expand Down
3 changes: 1 addition & 2 deletions org.eclipse.xpect.doc/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Bundle-Name: Doc
Bundle-SymbolicName: org.eclipse.xpect.doc
Bundle-Vendor: %providerName
Bundle-Version: 1.0.0.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-RequiredExecutionEnvironment: JavaSE-11
Require-Bundle: org.eclipse.xtext;bundle-version="2.4.0",
org.eclipse.xtext.common.types;bundle-version="2.4.0",
org.junit;bundle-version="4.10.0",
Expand All @@ -19,7 +19,6 @@ Require-Bundle: org.eclipse.xtext;bundle-version="2.4.0",
org.eclipse.ui.ide;bundle-version="3.7.0",
org.eclipse.jdt;bundle-version="3.7.0",
org.eclipse.jdt.junit;bundle-version="3.7.100",
org.eclipse.jdt.junit.runners;bundle-version="0.1.0",
org.eclipse.pde.ui;bundle-version="3.7.2",
org.eclipse.debug.ui;bundle-version="3.7.0",
org.eclipse.xpect;bundle-version="0.1.0",
Expand Down
2 changes: 1 addition & 1 deletion org.eclipse.xpect.examples/.classpath
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
eclipse.preferences.version=1
encoding/<project>=UTF-8
14 changes: 11 additions & 3 deletions org.eclipse.xpect.examples/.settings/org.eclipse.jdt.core.prefs
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
org.eclipse.jdt.core.compiler.codegen.targetPlatform=11
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=11
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.8
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=11
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
Expand Down
3 changes: 1 addition & 2 deletions org.eclipse.xpect.examples/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@ Bundle-Name: Examples
Bundle-SymbolicName: org.eclipse.xpect.examples
Bundle-Vendor: %providerName
Bundle-Version: 1.0.0.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-RequiredExecutionEnvironment: JavaSE-11
Require-Bundle: org.eclipse.xtend.lib,
com.google.guava,
org.eclipse.xtext.xbase.lib,
org.eclipse.xpect.xtext.lib;bundle-version="0.1.0",
org.eclipse.xtend.ide;bundle-version="2.4.0",
org.eclipse.xtext.xtext.ui;bundle-version="2.4.0",
org.eclipse.xtend;bundle-version="1.3.0",
org.eclipse.emf.codegen;bundle-version="2.8.0"
Automatic-Module-Name: org.eclipse.xpect.examples
8 changes: 8 additions & 0 deletions org.eclipse.xpect.ide/.classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="src-gen"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
40 changes: 40 additions & 0 deletions org.eclipse.xpect.ide/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>org.eclipse.xpect.ide</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.xtext.ui.shared.xtextBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.pde.PluginNature</nature>
</natures>
</projectDescription>
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
eclipse.preferences.version=1
encoding/<project>=UTF-8
10 changes: 10 additions & 0 deletions org.eclipse.xpect.ide/.settings/org.eclipse.jdt.core.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=11
org.eclipse.jdt.core.compiler.compliance=11
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
org.eclipse.jdt.core.compiler.release=enabled
org.eclipse.jdt.core.compiler.source=11
17 changes: 17 additions & 0 deletions org.eclipse.xpect.ide/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Manifest-Version: 1.0
Automatic-Module-Name: org.eclipse.xpect.ide
Bundle-ManifestVersion: 2
Bundle-Name: org.eclipse.xpect.ide
Bundle-Vendor: %providerName
Bundle-Version: 0.3.0.qualifier
Bundle-SymbolicName: org.eclipse.xpect.ide; singleton:=true
Bundle-ActivationPolicy: lazy
Require-Bundle: org.eclipse.xpect,
org.eclipse.xtext.ide,
org.eclipse.xtext.xbase.ide,
org.antlr.runtime;bundle-version="[3.2.0,3.2.1)"
Bundle-RequiredExecutionEnvironment: JavaSE-11
Export-Package: org.eclipse.xpect.ide.contentassist.antlr,
org.eclipse.xpect.ide.contentassist.antlr.lexer,
org.eclipse.xpect.lexer,
org.eclipse.xpect.ide.contentassist.antlr.internal
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
source.. = src/,\
src-gen/,\
xtend-gen/
src-gen/
bin.includes = .,\
META-INF/
bin.excludes = **/*.xtend
12 changes: 12 additions & 0 deletions org.eclipse.xpect.ide/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.eclipse.xpect</groupId>
<artifactId>org.eclipse.xpect.parent</artifactId>
<version>0.3.0-SNAPSHOT</version>
<relativePath>../org.eclipse.xpect.releng/maven-plugin-parent</relativePath>
</parent>
<artifactId>org.eclipse.xpect.ide</artifactId>
<packaging>eclipse-plugin</packaging>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/*
* generated by Xtext 2.31.0
*/
package org.eclipse.xpect.ide;


/**
* Use this class to register ide components.
*/
public class XpectIdeModule extends AbstractXpectIdeModule {
}
22 changes: 22 additions & 0 deletions org.eclipse.xpect.ide/src/org/eclipse/xpect/ide/XpectIdeSetup.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* generated by Xtext 2.31.0
*/
package org.eclipse.xpect.ide;

import com.google.inject.Guice;
import com.google.inject.Injector;
import org.eclipse.xpect.XpectRuntimeModule;
import org.eclipse.xpect.XpectStandaloneSetup;
import org.eclipse.xtext.util.Modules2;

/**
* Initialization support for running Xtext languages as language servers.
*/
public class XpectIdeSetup extends XpectStandaloneSetup {

@Override
public Injector createInjector() {
return Guice.createInjector(Modules2.mixin(new XpectRuntimeModule(), new XpectIdeModule()));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
* Moritz Eysholdt - Initial contribution and API
*******************************************************************************/

package org.eclipse.xpect.ui.services;
package org.eclipse.xpect.ide.services;

import org.antlr.runtime.CharStream;
import org.antlr.runtime.RecognitionException;
import org.antlr.runtime.RecognizerSharedState;

public abstract class Lexer extends org.eclipse.xtext.ui.editor.contentassist.antlr.internal.Lexer {
public abstract class Lexer extends org.eclipse.xtext.ide.editor.contentassist.antlr.internal.Lexer {
public Lexer() {
super();
}
Expand Down
2 changes: 0 additions & 2 deletions org.eclipse.xpect.mwe/xtend-gen/.gitignore

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src-gen"/>
<classpathentry kind="src" path="xtend-gen"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11">
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
eclipse.preferences.version=1
encoding/<project>=UTF-8
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
org.eclipse.jdt.core.compiler.codegen.targetPlatform=11
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.compliance=11
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.8
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=11
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
Expand Down
Loading

0 comments on commit 27dab6c

Please sign in to comment.