module org.lflang.GenerateLinguaFranca

import org.eclipse.xtext.xtext.generator.*
import org.eclipse.xtext.xtext.generator.model.project.*

var rootPath = ".."
var coreProject = "core"

Workflow {
    component = XtextGenerator {
        configuration = {
            project = StandardProjectConfig {
                baseName = coreProject
                rootPath = rootPath
                runtime = {
                    enabled = true
                    name = coreProject // generate core project
                    src = "src/main/java"
                }
                genericIde = {
                    enabled = true
                    name = coreProject // add into the core project
                    src = "src/main/java"
                }
                runtimeTest = {
                    enabled = false
                }
                // Only generate Eclipse infrastructure for the Epoch build (separate repository).
                createEclipseMetaData = false
                eclipsePlugin = {
                    enabled = false
                }
                eclipsePluginTest = {
                    enabled = false
                }
            }
            code = {
                encoding = "UTF-8"
                lineDelimiter = "\n"
                fileHeader = "/*\n * generated by Xtext \${version}\n */"
                preferXtendStubs = false
            }
        }
        /*
         * IMPORTANT: Any changes to this configuration must be synchronized with 
         * the GenerateLinguaFrancaEpoch.mwe2 file in the Epoch repository!
         */
        language = StandardLanguage {
            name = "org.lflang.LinguaFranca"
            fileExtensions = "lf"
            serializer = {
                generateStub = false
            }
            validator = {
                composedCheck = "org.eclipse.xtext.validation.NamesAreUniqueValidator"
                //composedCheck = "org.eclipse.xtext.validation.ImportUriValidator"
                // Generates checks for @Deprecated grammar annotations, an IssueProvider and a corresponding PropertyPage
                generateDeprecationValidation = true
                generateXtendStub = false
            }
            junitSupport = {
                junitVersion = "5"
                generateXtendStub = false
            }
            parserGenerator = {
                debugGrammar = true
            }
            generator = {
                generateXtendMain = false
            }
            formatter = {
                generateStub = true
            }
            projectWizard = {
                generate = false
            }
        }
    }
}
