Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Project wizard: how to set the JRE System Library programmatically?
Project wizard: how to set the JRE System Library programmatically? [message #1821340] Tue, 11 February 2020 09:20 Go to next message
Nikita Dümmel is currently offline Nikita DümmelFriend
Messages: 19
Registered: September 2017
Junior Member
Hi,

my DSL offers libraries which use Java 8 features.
The projects created with the project wizard are however set to JavaSE-1.6 which has to be changed manually after project creation.

Can I set the both JRE System Library and Bundle-RequiredExecutionEnvironment in the manifest programmatically to JavaSE-1.8?

Here is my project template provider:
class MuLEProjectTemplateProvider implements IProjectTemplateProvider {
	override getProjectTemplates() {
		#[new EmptyProject]
	}
}

@ProjectTemplate(label="Empty Project", icon="project_template.png", description="<p><b>Empty Project</b></p>
<p>This is a clean MuLE project. You have to create new MuLE files via the new file wizard in the src folder to start programming.</p>")
final class EmptyProject {
	override generateProjects(IProjectGenerator generator) {		
		generator.generate(new PluginProjectFactory => [
			projectName = projectInfo.projectName
			location = projectInfo.locationPath
			projectNatures += #[JavaCore.NATURE_ID, "org.eclipse.pde.PluginNature", XtextProjectHelper.NATURE_ID]
			builderIds += #[JavaCore.BUILDER_ID, org.eclipse.xtext.builder.impl.XtextBuilder.BUILDER_ID]
			requiredBundles += "de.ubt.ai1.mule"
			exportedPackages += "generated"
			folders += #["src", "src-gen"]	
		])
	}
}


Kind Regards,
Nikita Dümmel

[Updated on: Tue, 11 February 2020 09:21]

Report message to a moderator

Re: Project wizard: how to set the JRE System Library programmatically? [message #1821341 is a reply to message #1821340] Tue, 11 February 2020 09:27 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13659
Registered: July 2009
Senior Member
you may have a look at / take some inspiration from

org.eclipse.xtext.xtext.ui.wizard.project.XtextProjectCreator.configureJavaProject(ProjectDescriptor, JavaProjectFactory)
org.eclipse.xtext.ui.util.PluginProjectFactory.setBreeToUse(String)
org.eclipse.xtext.xtext.ui.wizard.project.XtextProjectCreator.createPluginProject(ProjectDescriptor, SubMonitor)


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Project wizard: how to set the JRE System Library programmatically? [message #1821342 is a reply to message #1821341] Tue, 11 February 2020 09:32 Go to previous message
Nikita Dümmel is currently offline Nikita DümmelFriend
Messages: 19
Registered: September 2017
Junior Member
Thank you for the quick answer!
Previous Topic:Keep the Grammar structure same as before saving the file
Next Topic:Xtext will drop support for the old generator in 2.22 / 2020-06
Goto Forum:
  


Current Time: Wed Nov 25 06:07:29 GMT 2020

Powered by FUDForum. Page generated in 0.02258 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top