Skip to main content



      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 04:20 Go to next message
Eclipse UserFriend
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 04:21] by Moderator

Re: Project wizard: how to set the JRE System Library programmatically? [message #1821341 is a reply to message #1821340] Tue, 11 February 2020 04:27 Go to previous messageGo to next message
Eclipse UserFriend
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)
Re: Project wizard: how to set the JRE System Library programmatically? [message #1821342 is a reply to message #1821341] Tue, 11 February 2020 04:32 Go to previous message
Eclipse UserFriend
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 Jul 23 14:39:00 EDT 2025

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

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

Back to the top