From 1a0e3ae875de6c8d8d3f2a852d421d25dd73cd88 Mon Sep 17 00:00:00 2001 From: mmews Date: Thu, 14 Dec 2023 14:43:24 +0100 Subject: [PATCH] migrate files and remove xtend nature from regex --- plugins/org.eclipse.n4js.regex/.classpath | 1 - .../org.eclipse.n4js.regex/build.properties | 3 +- plugins/org.eclipse.n4js.regex/pom.xml | 5 --- ...nd => RegularExpressionRuntimeModule.java} | 10 +++--- ... => RegularExpressionStandaloneSetup.java} | 10 +++--- .../generator/RegularExpressionGenerator.java | 33 +++++++++++++++++++ .../RegularExpressionGenerator.xtend | 32 ------------------ ...nd => RegularExpressionScopeProvider.java} | 9 +++-- ....xtend => RegularExpressionValidator.java} | 24 +++++++------- .../xtend-gen/.gitignore | 2 -- 10 files changed, 60 insertions(+), 69 deletions(-) rename plugins/org.eclipse.n4js.regex/src/org/eclipse/n4js/regex/{RegularExpressionRuntimeModule.xtend => RegularExpressionRuntimeModule.java} (65%) rename plugins/org.eclipse.n4js.regex/src/org/eclipse/n4js/regex/{RegularExpressionStandaloneSetup.xtend => RegularExpressionStandaloneSetup.java} (74%) create mode 100644 plugins/org.eclipse.n4js.regex/src/org/eclipse/n4js/regex/generator/RegularExpressionGenerator.java delete mode 100644 plugins/org.eclipse.n4js.regex/src/org/eclipse/n4js/regex/generator/RegularExpressionGenerator.xtend rename plugins/org.eclipse.n4js.regex/src/org/eclipse/n4js/regex/scoping/{RegularExpressionScopeProvider.xtend => RegularExpressionScopeProvider.java} (71%) rename plugins/org.eclipse.n4js.regex/src/org/eclipse/n4js/regex/validation/{RegularExpressionValidator.xtend => RegularExpressionValidator.java} (54%) delete mode 100644 plugins/org.eclipse.n4js.regex/xtend-gen/.gitignore diff --git a/plugins/org.eclipse.n4js.regex/.classpath b/plugins/org.eclipse.n4js.regex/.classpath index 217ca618e4..5153825dfe 100644 --- a/plugins/org.eclipse.n4js.regex/.classpath +++ b/plugins/org.eclipse.n4js.regex/.classpath @@ -12,6 +12,5 @@ - diff --git a/plugins/org.eclipse.n4js.regex/build.properties b/plugins/org.eclipse.n4js.regex/build.properties index 4e5f9fdb5f..ac1f3722dc 100644 --- a/plugins/org.eclipse.n4js.regex/build.properties +++ b/plugins/org.eclipse.n4js.regex/build.properties @@ -1,6 +1,5 @@ source.. = src/,\ - src-gen/,\ - xtend-gen/ + src-gen/ bin.includes = model/,\ META-INF/,\ .,\ diff --git a/plugins/org.eclipse.n4js.regex/pom.xml b/plugins/org.eclipse.n4js.regex/pom.xml index b32fd2695f..613d662dde 100644 --- a/plugins/org.eclipse.n4js.regex/pom.xml +++ b/plugins/org.eclipse.n4js.regex/pom.xml @@ -73,11 +73,6 @@ Contributors: - - - org.eclipse.xtend - xtend-maven-plugin - diff --git a/plugins/org.eclipse.n4js.regex/src/org/eclipse/n4js/regex/RegularExpressionRuntimeModule.xtend b/plugins/org.eclipse.n4js.regex/src/org/eclipse/n4js/regex/RegularExpressionRuntimeModule.java similarity index 65% rename from plugins/org.eclipse.n4js.regex/src/org/eclipse/n4js/regex/RegularExpressionRuntimeModule.xtend rename to plugins/org.eclipse.n4js.regex/src/org/eclipse/n4js/regex/RegularExpressionRuntimeModule.java index 7e0943ffd4..5cd4418fb9 100644 --- a/plugins/org.eclipse.n4js.regex/src/org/eclipse/n4js/regex/RegularExpressionRuntimeModule.xtend +++ b/plugins/org.eclipse.n4js.regex/src/org/eclipse/n4js/regex/RegularExpressionRuntimeModule.java @@ -8,20 +8,20 @@ * Contributors: * NumberFour AG - Initial API and implementation */ -package org.eclipse.n4js.regex +package org.eclipse.n4js.regex; -import org.eclipse.xtext.conversion.impl.INTValueConverter +import org.eclipse.xtext.conversion.impl.INTValueConverter; /** * Use this class to register components to be used at runtime / without the Equinox extension registry. */ -class RegularExpressionRuntimeModule extends AbstractRegularExpressionRuntimeModule { +public class RegularExpressionRuntimeModule extends AbstractRegularExpressionRuntimeModule { /** * INT is a data type rule thus the specialized binding */ - def Class bindINTValueConverter() { - return RegExINTValueConverter; + public Class bindINTValueConverter() { + return RegExINTValueConverter.class; } } diff --git a/plugins/org.eclipse.n4js.regex/src/org/eclipse/n4js/regex/RegularExpressionStandaloneSetup.xtend b/plugins/org.eclipse.n4js.regex/src/org/eclipse/n4js/regex/RegularExpressionStandaloneSetup.java similarity index 74% rename from plugins/org.eclipse.n4js.regex/src/org/eclipse/n4js/regex/RegularExpressionStandaloneSetup.xtend rename to plugins/org.eclipse.n4js.regex/src/org/eclipse/n4js/regex/RegularExpressionStandaloneSetup.java index b69feb848e..6f00167592 100644 --- a/plugins/org.eclipse.n4js.regex/src/org/eclipse/n4js/regex/RegularExpressionStandaloneSetup.xtend +++ b/plugins/org.eclipse.n4js.regex/src/org/eclipse/n4js/regex/RegularExpressionStandaloneSetup.java @@ -8,15 +8,15 @@ * Contributors: * NumberFour AG - Initial API and implementation */ -package org.eclipse.n4js.regex - +package org.eclipse.n4js.regex; /** * Initialization support for running Xtext languages without Equinox extension registry. */ -class RegularExpressionStandaloneSetup extends RegularExpressionStandaloneSetupGenerated { +public class RegularExpressionStandaloneSetup extends RegularExpressionStandaloneSetupGenerated { - def static void doSetup() { - new RegularExpressionStandaloneSetup().createInjectorAndDoEMFRegistration() + /***/ + static public void doSetup() { + new RegularExpressionStandaloneSetup().createInjectorAndDoEMFRegistration(); } } diff --git a/plugins/org.eclipse.n4js.regex/src/org/eclipse/n4js/regex/generator/RegularExpressionGenerator.java b/plugins/org.eclipse.n4js.regex/src/org/eclipse/n4js/regex/generator/RegularExpressionGenerator.java new file mode 100644 index 0000000000..35eb206c3b --- /dev/null +++ b/plugins/org.eclipse.n4js.regex/src/org/eclipse/n4js/regex/generator/RegularExpressionGenerator.java @@ -0,0 +1,33 @@ +/** + * Copyright (c) 2016 NumberFour AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * NumberFour AG - Initial API and implementation + */ +package org.eclipse.n4js.regex.generator; + +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.xtext.generator.AbstractGenerator; +import org.eclipse.xtext.generator.IFileSystemAccess2; +import org.eclipse.xtext.generator.IGeneratorContext; + +/** + * Generates code from your model files on save. + * + * See https://www.eclipse.org/Xtext/documentation/303_runtime_concepts.html#code-generation + */ +public class RegularExpressionGenerator extends AbstractGenerator { + + @Override + public void doGenerate(Resource resource, IFileSystemAccess2 fsa, IGeneratorContext context) { + // fsa.generateFile('greetings.txt', 'People to greet: ' + + // resource.allContents + // .filter(typeof(Greeting)) + // .map[name] + // .join(', ')) + } +} diff --git a/plugins/org.eclipse.n4js.regex/src/org/eclipse/n4js/regex/generator/RegularExpressionGenerator.xtend b/plugins/org.eclipse.n4js.regex/src/org/eclipse/n4js/regex/generator/RegularExpressionGenerator.xtend deleted file mode 100644 index b63de1fecc..0000000000 --- a/plugins/org.eclipse.n4js.regex/src/org/eclipse/n4js/regex/generator/RegularExpressionGenerator.xtend +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Copyright (c) 2016 NumberFour AG. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * NumberFour AG - Initial API and implementation - */ -package org.eclipse.n4js.regex.generator - -import org.eclipse.emf.ecore.resource.Resource -import org.eclipse.xtext.generator.AbstractGenerator -import org.eclipse.xtext.generator.IFileSystemAccess2 -import org.eclipse.xtext.generator.IGeneratorContext - -/** - * Generates code from your model files on save. - * - * See https://www.eclipse.org/Xtext/documentation/303_runtime_concepts.html#code-generation - */ -class RegularExpressionGenerator extends AbstractGenerator { - - override void doGenerate(Resource resource, IFileSystemAccess2 fsa, IGeneratorContext context) { -// fsa.generateFile('greetings.txt', 'People to greet: ' + -// resource.allContents -// .filter(typeof(Greeting)) -// .map[name] -// .join(', ')) - } -} diff --git a/plugins/org.eclipse.n4js.regex/src/org/eclipse/n4js/regex/scoping/RegularExpressionScopeProvider.xtend b/plugins/org.eclipse.n4js.regex/src/org/eclipse/n4js/regex/scoping/RegularExpressionScopeProvider.java similarity index 71% rename from plugins/org.eclipse.n4js.regex/src/org/eclipse/n4js/regex/scoping/RegularExpressionScopeProvider.xtend rename to plugins/org.eclipse.n4js.regex/src/org/eclipse/n4js/regex/scoping/RegularExpressionScopeProvider.java index ed6c9c4794..d974dbbbdf 100644 --- a/plugins/org.eclipse.n4js.regex/src/org/eclipse/n4js/regex/scoping/RegularExpressionScopeProvider.xtend +++ b/plugins/org.eclipse.n4js.regex/src/org/eclipse/n4js/regex/scoping/RegularExpressionScopeProvider.java @@ -8,14 +8,13 @@ * Contributors: * NumberFour AG - Initial API and implementation */ -package org.eclipse.n4js.regex.scoping +package org.eclipse.n4js.regex.scoping; /** * This class contains custom scoping description. * - * see : http://www.eclipse.org/Xtext/documentation.html#scoping - * on how and when to use it + * see : http://www.eclipse.org/Xtext/documentation.html#scoping on how and when to use it */ -class RegularExpressionScopeProvider extends org.eclipse.xtext.scoping.impl.AbstractDeclarativeScopeProvider { - +public class RegularExpressionScopeProvider extends org.eclipse.xtext.scoping.impl.AbstractDeclarativeScopeProvider { + // empty } diff --git a/plugins/org.eclipse.n4js.regex/src/org/eclipse/n4js/regex/validation/RegularExpressionValidator.xtend b/plugins/org.eclipse.n4js.regex/src/org/eclipse/n4js/regex/validation/RegularExpressionValidator.java similarity index 54% rename from plugins/org.eclipse.n4js.regex/src/org/eclipse/n4js/regex/validation/RegularExpressionValidator.xtend rename to plugins/org.eclipse.n4js.regex/src/org/eclipse/n4js/regex/validation/RegularExpressionValidator.java index 141632cdf4..2ecc798cd8 100644 --- a/plugins/org.eclipse.n4js.regex/src/org/eclipse/n4js/regex/validation/RegularExpressionValidator.xtend +++ b/plugins/org.eclipse.n4js.regex/src/org/eclipse/n4js/regex/validation/RegularExpressionValidator.java @@ -8,7 +8,7 @@ * Contributors: * NumberFour AG - Initial API and implementation */ -package org.eclipse.n4js.regex.validation +package org.eclipse.n4js.regex.validation; //import org.eclipse.xtext.validation.Check /** @@ -16,16 +16,16 @@ * * see http://www.eclipse.org/Xtext/documentation.html#validation */ -class RegularExpressionValidator extends AbstractRegularExpressionValidator { +public class RegularExpressionValidator extends AbstractRegularExpressionValidator { -// public static val INVALID_NAME = 'invalidName' -// -// @Check -// def checkGreetingStartsWithCapital(Greeting greeting) { -// if (!Character.isUpperCase(greeting.name.charAt(0))) { -// warning('Name should start with a capital', -// MyDslPackage.Literals.GREETING__NAME, -// INVALID_NAME) -// } -// } + // public static val INVALID_NAME = 'invalidName' + // + // @Check + // def checkGreetingStartsWithCapital(Greeting greeting) { + // if (!Character.isUpperCase(greeting.name.charAt(0))) { + // warning('Name should start with a capital', + // MyDslPackage.Literals.GREETING__NAME, + // INVALID_NAME) + // } + // } } diff --git a/plugins/org.eclipse.n4js.regex/xtend-gen/.gitignore b/plugins/org.eclipse.n4js.regex/xtend-gen/.gitignore deleted file mode 100644 index c96a04f008..0000000000 --- a/plugins/org.eclipse.n4js.regex/xtend-gen/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -* -!.gitignore \ No newline at end of file