blob: b7965055f8501fafd28ad026d571400ab4f48cef [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2011 Willink Transformations and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v20.html
*
* Contributors:
* E.D.Willink - initial API and implementation
*
* Run As->MWE2 Workflow to regenerate the editor.
* If it fails with a stack dump, open the Xtext file and do
* a dummy edit. Generally there is an error in the source file.
*******************************************************************************/
module GenerateMarkupEditor
import org.eclipse.emf.mwe.utils.*
import org.eclipse.ocl.examples.build.*
import org.eclipse.ocl.examples.build.utilities.*
import org.eclipse.ocl.examples.build.xtend.*
import org.eclipse.xtext.generator.*
import org.eclipse.xtext.ui.generator.*
var markup.file.extensions = "markupocl"
var markupProjectName = "org.eclipse.ocl.xtext.markup"
var markupRuntimeProject = "../../plugins/${markupProjectName}"
/**
* Generate the markup Editor.
*/
Workflow {
bean = StandaloneSetup {
scanClassPath = true
platformUri = ".."
registerGeneratedEPackage = "org.eclipse.ocl.xtext.markupcs.MarkupPackage"
registerGenModelFile = "platform:/resource/org.eclipse.ocl.xtext.markup/model/Markup.genmodel"
}
component = DirectoryCleaner {
directory = "${markupRuntimeProject}/src-gen"
}
component = DirectoryCleaner {
directory = "${markupRuntimeProject}.ui/src-gen"
}
component = Generator {
pathRtProject = markupRuntimeProject
pathUiProject = "${markupRuntimeProject}.ui"
projectNameRt = markupProjectName
projectNameUi = "${markupProjectName}.ui"
mergeManifest = false
fileHeader =
"/*******************************************************************************
* Copyright (c) 2011, \${year} Willink Transformations and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v20.html
*
* Contributors:
* E.D.Willink - initial API and implementation
*******************************************************************************/"
language = {
uri = "classpath:/org/eclipse/ocl/xtext/markup/Markup.xtext"
fileExtensions = markup.file.extensions
// Java API to access grammar elements (required by several other fragments)
fragment = grammarAccess.GrammarAccessFragment {}
// the serialization component
fragment = serializer.SerializerFragment {}
// a custom ResourceFactory for use with EMF
fragment = resourceFactory.ResourceFactoryFragment {
fileExtensions = markup.file.extensions
}
fragment = parser.antlr.XtextAntlrGeneratorFragment {
options = { backtrack = true classSplitting = true }
}
// check-based API for validation
/*
fragment = validation.CheckFragment {}
*/
// java-based API for validation
fragment = validation.JavaValidatorFragment {
composedCheck = "org.eclipse.xtext.validation.ImportUriValidator"
// composedCheck = "org.eclipse.xtext.validation.NamesAreUniqueValidator"
}
// scoping and exporting API
fragment = scoping.ImportNamespacesScopingFragment {}
fragment = exporting.QualifiedNamesFragment {}
// formatter API
fragment = formatting.FormatterFragment {}
// labeling API
fragment = labeling.LabelProviderFragment {}
// outline API
fragment = outline.OutlineTreeProviderFragment {}
fragment = outline.QuickOutlineFragment {}
// java-based API for content assistance
fragment = contentAssist.JavaBasedContentAssistFragment {}
fragment = parser.antlr.XtextAntlrUiGeneratorFragment {
options = { backtrack = true classSplitting = true}
}
fragment = builder.BuilderIntegrationFragment {}
// quickfix API
fragment = quickfix.QuickfixProviderFragment {}
// *.xtextbin support on Xtext 2.3
fragment = fragments.CompatibilityFragment {}
}
}
component = GenerateGrammarXtend {
javaFolder = "${markupRuntimeProject}/src-gen"
javaPackageName = "${markupProjectName}"
grammarFileStem = "Markup"
}
component = ConvertToUnixLineEndings {
directory = "${markupRuntimeProject}/src-gen"
}
component = ConvertToUnixLineEndings {
directory = "${markupRuntimeProject}.ui/src-gen"
}
}