diff --git a/XPlus.setup b/XPlus.setup index 968f63c..cf41b4c 100644 --- a/XPlus.setup +++ b/XPlus.setup @@ -57,7 +57,7 @@ Set an Oomph redirection system property to redirect the logical location of this setup to its physical location in the Git clone. @@ -116,13 +116,13 @@ value="false"/> - - + xsi:type="setup:CompoundTask" + name="Java Development"> + + diff --git a/bundles/nl.esi.xplus.doc.design/GenerateGrammarsDiagram.launch b/bundles/nl.esi.xplus.doc.design/GenerateGrammarsDiagram.launch new file mode 100644 index 0000000..661ec8a --- /dev/null +++ b/bundles/nl.esi.xplus.doc.design/GenerateGrammarsDiagram.launch @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/bundles/nl.esi.xplus.doc.design/adoc/_section_xtext_languages.adoc b/bundles/nl.esi.xplus.doc.design/adoc/_section_xtext_languages.adoc index 0f66e51..9f1f5d8 100644 --- a/bundles/nl.esi.xplus.doc.design/adoc/_section_xtext_languages.adoc +++ b/bundles/nl.esi.xplus.doc.design/adoc/_section_xtext_languages.adoc @@ -35,8 +35,6 @@ For more information about the reuse of existing grammars, please read the (i.e. include::{gendocdir}/xtext-grammars.plantuml[] -artifact nl.esi.xtext.types.Types #white/aqua - @enduml .... diff --git a/bundles/nl.esi.xplus.doc.design/pom.xml b/bundles/nl.esi.xplus.doc.design/pom.xml index d25a174..a01d15f 100644 --- a/bundles/nl.esi.xplus.doc.design/pom.xml +++ b/bundles/nl.esi.xplus.doc.design/pom.xml @@ -30,6 +30,24 @@ org.apache.maven.plugins maven-dependency-plugin + + unpack-ecore-models + generate-sources + + unpack-dependencies + + + true + true + true + true + true + true + nl.esi.xplus + META-INF/MANIFEST.MF,model/generated/*.*,**/*.xtext + ${project.build.directory}/meta-models/ + + unpack-adoc-resources generate-sources @@ -37,12 +55,39 @@ unpack-dependencies + true + true adoc/** ${project.build.directory}/adoc-ext + + + + + + maven-antrun-plugin + + + prepare-package + + + + + + + + + run + + + + + + org.codehaus.mojo exec-maven-plugin @@ -57,7 +102,7 @@ nl.esi.xplus.doc.design.GenerateGrammarsDiagram true - ${project.basedir}/.. + ${project.build.directory}/meta-models ${project.build.directory}/adoc-gen/xtext-grammars.plantuml @@ -73,54 +118,6 @@ - - - - - org.apache.maven.plugins - maven-resources-plugin - - - prepare-package - - copy-resources - - - - - ${project.basedir}/.. - - */model/generated/*.ecore - - - - ${project.build.directory}/meta-models - - - - - - - maven-antrun-plugin - - - prepare-package - - - - - - - - - run - - - - - - com.altran.general.emf.ecoredoc ecoredoc-maven-plugin @@ -291,6 +288,30 @@ + + + + org.apache.maven.plugins + maven-clean-plugin + + + remove-meta-models + package + + clean + + + true + + + ${project.build.directory}/meta-models/ + + + + + + \ No newline at end of file diff --git a/bundles/nl.esi.xplus.doc.design/src/nl/esi/xplus/doc/design/GenerateGrammarsDiagram.xtend b/bundles/nl.esi.xplus.doc.design/src/nl/esi/xplus/doc/design/GenerateGrammarsDiagram.xtend index ac87f13..88a508e 100644 --- a/bundles/nl.esi.xplus.doc.design/src/nl/esi/xplus/doc/design/GenerateGrammarsDiagram.xtend +++ b/bundles/nl.esi.xplus.doc.design/src/nl/esi/xplus/doc/design/GenerateGrammarsDiagram.xtend @@ -21,14 +21,14 @@ import org.eclipse.xtend.lib.annotations.Accessors class GenerateGrammarsDiagram { static val TERMINALS_GRAMMAR = new Grammar => [ - bundle = 'org.eclipse.xtext.common' + bundle = 'org.eclipse.xtext' name = 'org.eclipse.xtext.common.Terminals' ] - static val GRAMMAR_PATTERN = Pattern.compile('''^grammar\s+((\w+\.)*\w+)\s+with\s+((\w+\.)*\w+)''') + static val GRAMMAR_PATTERN = Pattern.compile('''^grammar\s+((\w+\.)*\w+)(\s+with\s+((\w+\.)*\w+))?(\s+hidden\s*\((\w+(,\s*\w+)*)\))?\s*''') static val GENERATE_PATTERN = Pattern.compile('''^generate\s+(\w+)\s+"([^"]+)"''') static val IMPORT_PATTERN = Pattern.compile('''^import\s+"([^"]+)"\s+as\s+(\w+)''') - static val FILE_EXTENSIONS_PATTERN = Pattern.compile('''^\s*fileExtensions\s+=\s+"([^"]+)"''') + static val FILE_EXTENSIONS_PATTERN = Pattern.compile('''^.*fileExtensions\s*=\s*"([^"]+)".*''') def static void main(String[] args) { if (args.size != 2) { @@ -39,12 +39,14 @@ class GenerateGrammarsDiagram { val outputFile = Path.of(args.get(1)) println('''Generate diagram: «bundlesDir» => «outputFile»''') - val xtextFiles = Files.find(bundlesDir, Integer.MAX_VALUE, [$0.toString.endsWith('.xtext')]).toIterable + val xtextFiles = Files.find(bundlesDir, Integer.MAX_VALUE, [$1.regularFile && $0.toString.endsWith('.xtext')]).toIterable val grammars = xtextFiles.map[createGrammar(bundlesDir)].filterNull.toList - grammars += TERMINALS_GRAMMAR + if (!grammars.exists[name == 'org.eclipse.xtext.common.Terminals']) { + grammars += TERMINALS_GRAMMAR + } // Reduce grammar dependencies grammars.forEach[ - bundleUses.removeAll(getParentGrammar(grammars)?.bundle) + bundleUses.removeAll(getParentGrammars(grammars).map[bundle]) grammarUses.removeAll(getParentGrammars(grammars).map[uri]) ] grammars.sortInplace[a, b | @@ -97,24 +99,26 @@ class GenerateGrammarsDiagram { ''' def static Grammar createGrammar(Path xtextFile, Path bundlesDir) { - if (xtextFile.contains(Path.of('target')) || xtextFile.contains(Path.of('bin'))) { - return null - } val fileName = com.google.common.io.Files.getNameWithoutExtension(xtextFile.fileName.toString) - val xtextLines = Files.lines(xtextFile).toIterable - val mwe2Lines = Files.lines(xtextFile.resolveSibling('''Generate«fileName».mwe2''')).toIterable val bundlePath = xtextFile.getName(bundlesDir.nameCount) + + val xtextLines = Files.lines(xtextFile).toIterable + val genmodel = bundlesDir.resolve(bundlePath).resolve('''model/generated/«fileName».genmodel''') + val fileExtensions = if (Files.isRegularFile(genmodel)) { + val genmodelLines = Files.lines(genmodel).toIterable + genmodelLines.matchAndReturn(FILE_EXTENSIONS_PATTERN, '$1').head + } val manifest = new Manifest(bundlesDir.resolve(bundlePath).resolve('META-INF/MANIFEST.MF').read) val requiredBundles = manifest.mainAttributes.getValue('Require-Bundle') - return new Grammar => [ - bundle = bundlePath.toString - name = xtextLines.matchAndReturn(GRAMMAR_PATTERN, '$1').head - parent = xtextLines.matchAndReturn(GRAMMAR_PATTERN, '$3').head - uri = xtextLines.matchAndReturn(GENERATE_PATTERN, '$2').head - grammarUses += xtextLines.matchAndReturn(IMPORT_PATTERN, '$1') - bundleUses += requiredBundles.split(',').map[split(';').head] - fileExtensions = mwe2Lines.matchAndReturn(FILE_EXTENSIONS_PATTERN, '$1').head + return new Grammar => [ g | + g.bundle = bundlePath.toString + g.name = xtextLines.matchAndReturn(GRAMMAR_PATTERN, '$1').head + g.parent = xtextLines.matchAndReturn(GRAMMAR_PATTERN, '$4').head + g.uri = xtextLines.matchAndReturn(GENERATE_PATTERN, '$2').head + g.grammarUses += xtextLines.matchAndReturn(IMPORT_PATTERN, '$1') + g.bundleUses += requiredBundles.split(',').map[split(';').head] + g.fileExtensions = fileExtensions ] } @@ -137,14 +141,13 @@ class GenerateGrammarsDiagram { def Set getParentGrammars(Iterable grammars) { val parents = newLinkedHashSet var parent = this.getParentGrammar(grammars) - while (parent !== null) { - parents += parent + while (parent !== null && parents.add(parent)) { parent = parent.getParentGrammar(grammars) } return parents } - def Grammar getParentGrammar(Iterable grammars) { + def private Grammar getParentGrammar(Iterable grammars) { return grammars.findFirst[g | g.name == this.parent] } } diff --git a/bundles/nl.esi.xtext.expressions/adoc/nl.esi.xtext.expressions.adoc b/bundles/nl.esi.xtext.expressions/adoc/nl.esi.xtext.expressions.adoc index 7b9ccec..bb8eee8 100644 --- a/bundles/nl.esi.xtext.expressions/adoc/nl.esi.xtext.expressions.adoc +++ b/bundles/nl.esi.xtext.expressions/adoc/nl.esi.xtext.expressions.adoc @@ -203,4 +203,4 @@ Operators are evaluated in the following order (highest to lowest): * Operator associativity: most operators are left-associative; the power operator `^` is right-associative. * Variables can be declared with optional initialization: `Type name = expression` or just `Type name`. -NOTE: When invoking functions with custom Java types, `IExpressionConverter` instances are evaluated in order until one successfully converts the argument. The first successful conversion is used. This allows custom converters to handle specific types while falling back to default converters for built-in types. See <> for details on implementing custom converters. \ No newline at end of file +NOTE: When invoking functions with custom Java types, `IExpressionConverter` instances are evaluated in order until one successfully converts the argument. The first successful conversion is used. This allows custom converters to handle specific types while falling back to default converters for built-in types. See <> for details on implementing custom converters. \ No newline at end of file diff --git a/bundles/nl.esi.xtext.launch/Maven Re-build.launch b/bundles/nl.esi.xtext.launch/Maven Re-build.launch index 1f6c661..a1fe112 100644 --- a/bundles/nl.esi.xtext.launch/Maven Re-build.launch +++ b/bundles/nl.esi.xtext.launch/Maven Re-build.launch @@ -2,7 +2,7 @@ - + diff --git a/bundles/nl.esi.xtext.launch/Maven Validate.launch b/bundles/nl.esi.xtext.launch/Maven Validate.launch new file mode 100644 index 0000000..d4f7c39 --- /dev/null +++ b/bundles/nl.esi.xtext.launch/Maven Validate.launch @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/bundles/nl.esi.xtext.types/plugin.xml b/bundles/nl.esi.xtext.types/plugin.xml index 70aa20e..5ccb6de 100644 --- a/bundles/nl.esi.xtext.types/plugin.xml +++ b/bundles/nl.esi.xtext.types/plugin.xml @@ -12,39 +12,11 @@ --> - + - - - - - - - - - - - - - - diff --git a/bundles/nl.esi.xtext.types/schema/xplusValidator.exsd b/bundles/nl.esi.xtext.types/schema/xplusValidator.exsd index e6fd46f..1b7bbfb 100644 --- a/bundles/nl.esi.xtext.types/schema/xplusValidator.exsd +++ b/bundles/nl.esi.xtext.types/schema/xplusValidator.exsd @@ -123,7 +123,7 @@ - <extension point="nl.esi.xtext.types.commaValidator"> + <extension point="nl.esi.xtext.types.xplusValidator"> <customValidator class="nl.esi.xplus.project.dynamics.validation.InterfaceValidator" language="InterfaceDefinition"> diff --git a/bundles/nl.esi.xtext.types/src/nl/esi/xtext/types/generator/XPlusFileSystemAccess.xtend b/bundles/nl.esi.xtext.types/src/nl/esi/xtext/types/generator/XPlusFileSystemAccess.xtend index 1c38a57..9f5d441 100644 --- a/bundles/nl.esi.xtext.types/src/nl/esi/xtext/types/generator/XPlusFileSystemAccess.xtend +++ b/bundles/nl.esi.xtext.types/src/nl/esi/xtext/types/generator/XPlusFileSystemAccess.xtend @@ -25,12 +25,12 @@ class XPlusFileSystemAccess implements IFileSystemAccess { public String outputConfiguration = DEFAULT_OUTPUT String generationFolder - final public static String COMMA_OUTPUT_ID = "outputCommaGen" - final public static String COMMA_OUTPUT_FOLDER = "./xplus-gen" - public static val OutputConfiguration COMMA_OUTPUT_CONF = { - val config = new OutputConfiguration(COMMA_OUTPUT_ID) - config.outputDirectory = COMMA_OUTPUT_FOLDER - config.description = COMMA_OUTPUT_FOLDER + final public static String XPLUS_OUTPUT_ID = "outputXPlusGen" + final public static String XPLUS_OUTPUT_FOLDER = "./xplus-gen" + public static val OutputConfiguration XPLUS_OUTPUT_CONF = { + val config = new OutputConfiguration(XPLUS_OUTPUT_ID) + config.outputDirectory = XPLUS_OUTPUT_FOLDER + config.description = XPLUS_OUTPUT_FOLDER config.createOutputDirectory = true config.canClearOutputDirectory = true config.cleanUpDerivedResources = true @@ -56,7 +56,7 @@ class XPlusFileSystemAccess implements IFileSystemAccess { this.fileSystemAccess = fsa this.generationFolder = generationFolder if(xplusGen) { - setOutPutCommaGen + setOutPutXPlusGen } } @@ -98,17 +98,17 @@ class XPlusFileSystemAccess implements IFileSystemAccess { return sb.toString } - def setOutPutCommaGen() { + def setOutPutXPlusGen() { if (fileSystemAccess instanceof AbstractFileSystemAccess) { - outputConfiguration = COMMA_OUTPUT_ID + outputConfiguration = XPLUS_OUTPUT_ID val configurations = fileSystemAccess.outputConfigurations - if (!configurations.containsKey(COMMA_OUTPUT_ID)) { + if (!configurations.containsKey(XPLUS_OUTPUT_ID)) { val newConfigurations = new HashMap(configurations) - newConfigurations.put(COMMA_OUTPUT_ID, COMMA_OUTPUT_CONF) + newConfigurations.put(XPLUS_OUTPUT_ID, XPLUS_OUTPUT_CONF) fileSystemAccess.outputConfigurations = newConfigurations } } else { - generationFolder = FOLDER_UP + "comma-gen/" + generationFolder + generationFolder = FOLDER_UP + "xplus-gen/" + generationFolder } } diff --git a/bundles/nl.esi.xtext.types/src/nl/esi/xtext/types/generator/XPlusMain.xtend b/bundles/nl.esi.xtext.types/src/nl/esi/xtext/types/generator/XPlusMain.xtend index 7593ca0..c0178d2 100644 --- a/bundles/nl.esi.xtext.types/src/nl/esi/xtext/types/generator/XPlusMain.xtend +++ b/bundles/nl.esi.xtext.types/src/nl/esi/xtext/types/generator/XPlusMain.xtend @@ -41,7 +41,7 @@ class XPlusMain { static final String ERR_LOCATION_WRONG = 'Location could not be found. ' static final String INFO_GENERATION_FINISHED = 'Code generation finished.' - static final String INFO_COMMA_FINISHED = 'All XPlus Tasks are finished.' + static final String INFO_XPLUS_FINISHED = 'All XPlus Tasks are finished.' static final String INFO_SEARCHING = 'Searching for {0} ({1}) files in {2}' static final String INFO_OUTPUT = 'Output set: ' static final String INFO_STOP = 'Errors found, stopping generation.' @@ -219,7 +219,7 @@ class XPlusMain { // Configure and start the generator fileAccess.outputPath = outputdir.toString - setCommaGen(fileAccess, outputdir.toString) + setXPlusGen(fileAccess, outputdir.toString) generator.generate(resource, fileAccess, cliContext) } @@ -335,7 +335,7 @@ class XPlusMain { } System.out.println(INFO_GENERATION_FINISHED) System.out.println("") - System.out.println(INFO_COMMA_FINISHED) + System.out.println(INFO_XPLUS_FINISHED) } def Options createOptions() { @@ -467,7 +467,7 @@ class XPlusMain { // Configure and start the generator fileAccess.outputPath = outputdir - setCommaGen(fileAccess, outputdir) + setXPlusGen(fileAccess, outputdir) generator.generate(resource, fileAccess, cliContext) } @@ -488,7 +488,7 @@ class XPlusMain { var cliContext = new StepsParserContext(stepsPath.toString, contexts, outputdir) // Configure and start the generator fileAccess.outputPath = outputdir - setCommaGen(fileAccess, outputdir) + setXPlusGen(fileAccess, outputdir) generator.generate(resource, fileAccess, cliContext) } @@ -517,7 +517,7 @@ class XPlusMain { } // Configure and start the generator fileAccess.outputPath = outputdir - setCommaGen(fileAccess, outputdir) + setXPlusGen(fileAccess, outputdir) try { generator.generate(resource, fileAccess, new CmdLineContext) @@ -532,16 +532,16 @@ class XPlusMain { def cleanOutput(CommandLine cmdLine, Path outputdir) { if (cmdLine.hasOption(OPT_CLEAN)) { println("Start cleaning output directory.") - val commagendir = outputdir.parent.resolve(nl.esi.xtext.types.generator.XPlusFileSystemAccess.COMMA_OUTPUT_CONF.outputDirectory).normalize + val xplusgendir = outputdir.parent.resolve(nl.esi.xtext.types.generator.XPlusFileSystemAccess.XPLUS_OUTPUT_CONF.outputDirectory).normalize //clean src-gen if(new File(outputdir.toString).exists){ Files.walk(outputdir) .sorted(Comparator.reverseOrder()) .forEach[Files::delete(it)] } - //clean comma-gen - if(new File(commagendir.toString).exists){ - Files.walk(commagendir) + //clean xplus-gen + if(new File(xplusgendir.toString).exists){ + Files.walk(xplusgendir) .sorted(Comparator.reverseOrder()) .forEach[Files::delete(it)] } @@ -549,15 +549,15 @@ class XPlusMain { } } - def setCommaGen(JavaIoFileSystemAccess fileAccess, String outputdir) { - val commaConf = nl.esi.xtext.types.generator.XPlusFileSystemAccess.COMMA_OUTPUT_CONF - commaConf.outputDirectory = Paths.get(outputdir).parent.toString + commaConf.outputDirectory - fileAccess.outputConfigurations.put(nl.esi.xtext.types.generator.XPlusFileSystemAccess.COMMA_OUTPUT_ID, commaConf) + def setXPlusGen(JavaIoFileSystemAccess fileAccess, String outputdir) { + val xplusConf = nl.esi.xtext.types.generator.XPlusFileSystemAccess.XPLUS_OUTPUT_CONF + xplusConf.outputDirectory = Paths.get(outputdir).parent.toString + xplusConf.outputDirectory + fileAccess.outputConfigurations.put(nl.esi.xtext.types.generator.XPlusFileSystemAccess.XPLUS_OUTPUT_ID, xplusConf) } - def getCommaGen() { - val commaGen = fileAccess.outputConfigurations.get(nl.esi.xtext.types.generator.XPlusFileSystemAccess.COMMA_OUTPUT_ID) - commaGen.outputDirectory + def getXPlusGen() { + val xplusGen = fileAccess.outputConfigurations.get(nl.esi.xtext.types.generator.XPlusFileSystemAccess.XPLUS_OUTPUT_ID) + xplusGen.outputDirectory } def getJarDir() { diff --git a/bundles/nl.esi.xtext.types/src/nl/esi/xtext/types/utilities/XPlusUtilities.xtend b/bundles/nl.esi.xtext.types/src/nl/esi/xtext/types/utilities/XPlusUtilities.xtend index fdb13f4..90a6130 100644 --- a/bundles/nl.esi.xtext.types/src/nl/esi/xtext/types/utilities/XPlusUtilities.xtend +++ b/bundles/nl.esi.xtext.types/src/nl/esi/xtext/types/utilities/XPlusUtilities.xtend @@ -27,9 +27,4 @@ class XPlusUtilities { } result } - - static def commaVersion(){ - "4.0.0" - } - } \ No newline at end of file diff --git a/bundles/nl.esi.xtext.types/src/nl/esi/xtext/types/validation/TypesValidator.xtend b/bundles/nl.esi.xtext.types/src/nl/esi/xtext/types/validation/TypesValidator.xtend index 64e1c68..760d31e 100644 --- a/bundles/nl.esi.xtext.types/src/nl/esi/xtext/types/validation/TypesValidator.xtend +++ b/bundles/nl.esi.xtext.types/src/nl/esi/xtext/types/validation/TypesValidator.xtend @@ -252,7 +252,7 @@ class TypesValidator extends AbstractTypesValidator { @Inject override register(EValidatorRegistrar registrar) { super.register(registrar) - val VALIDATOR_ID = "nl.esi.xtext.types.commaValidator" + val VALIDATOR_ID = "nl.esi.xtext.types.xplusValidator" val reg = Platform.getExtensionRegistry() if(reg !== null){ val extensions = reg.getConfigurationElementsFor(VALIDATOR_ID) diff --git a/features/nl.esi.xplus.feature/feature.xml b/features/nl.esi.xplus.feature/feature.xml index 74b8bf6..4fd37f4 100644 --- a/features/nl.esi.xplus.feature/feature.xml +++ b/features/nl.esi.xplus.feature/feature.xml @@ -31,6 +31,10 @@ Languages. %license + + + + @@ -63,8 +67,4 @@ Languages. id="nl.esi.xtext.common.lang.ide" version="0.0.0"/> - - diff --git a/features/nl.esi.xplus.lsp.feature/feature.xml b/features/nl.esi.xplus.lsp.feature/feature.xml index 473b2dd..7625288 100644 --- a/features/nl.esi.xplus.lsp.feature/feature.xml +++ b/features/nl.esi.xplus.lsp.feature/feature.xml @@ -31,9 +31,9 @@ Languages. %license - + + + + + diff --git a/features/nl.esi.xplus.ui.feature/feature.xml b/features/nl.esi.xplus.ui.feature/feature.xml index dfe8624..8b251d6 100644 --- a/features/nl.esi.xplus.ui.feature/feature.xml +++ b/features/nl.esi.xplus.ui.feature/feature.xml @@ -50,4 +50,8 @@ id="nl.esi.xtext.common.lang.ui" version="0.0.0"/> + + diff --git a/releng/nl.esi.xplus.standard.site/category.xml b/releng/nl.esi.xplus.standard.site/category.xml index 227244d..1c250cf 100644 --- a/releng/nl.esi.xplus.standard.site/category.xml +++ b/releng/nl.esi.xplus.standard.site/category.xml @@ -32,6 +32,15 @@ + + + + + + + + + XPlus Framework @@ -47,4 +56,5 @@ UI Project of XPlus + diff --git a/releng/nl.esi.xplus.target/nl.esi.xplus.target.target b/releng/nl.esi.xplus.target/nl.esi.xplus.target.target index 74a98c1..09739c0 100644 --- a/releng/nl.esi.xplus.target/nl.esi.xplus.target.target +++ b/releng/nl.esi.xplus.target/nl.esi.xplus.target.target @@ -2,6 +2,7 @@ + @@ -25,7 +26,6 @@ - @@ -63,6 +63,7 @@ + @@ -71,11 +72,11 @@ - + - + @@ -86,6 +87,5 @@ - - \ No newline at end of file +