Search in sources :

Example 1 with HeadlessExtensionRegistrationHelper

use of org.eclipse.n4js.hlc.base.HeadlessExtensionRegistrationHelper in project n4js by eclipse.

the class HeadlessCompilerFactory method createCompilerWithProperties.

/**
 * Construct a {@link N4HeadlessCompiler} with configuration based on the provided properties.
 *
 * @param properties
 *            preferences.
 */
public static N4HeadlessCompiler createCompilerWithProperties(Properties properties) {
    Injector localinjector = new N4JSHeadlessStandaloneSetup(properties).createInjectorAndDoEMFRegistration();
    N4HeadlessCompiler instance = localinjector.getInstance(N4HeadlessCompiler.class);
    HeadlessExtensionRegistrationHelper headlessExtensionRegistrationHelper = localinjector.getInstance(HeadlessExtensionRegistrationHelper.class);
    headlessExtensionRegistrationHelper.registerExtensions();
    return instance;
}
Also used : Injector(com.google.inject.Injector) N4JSHeadlessStandaloneSetup(org.eclipse.n4js.generator.headless.N4JSHeadlessStandaloneSetup) N4HeadlessCompiler(org.eclipse.n4js.generator.headless.N4HeadlessCompiler) HeadlessExtensionRegistrationHelper(org.eclipse.n4js.hlc.base.HeadlessExtensionRegistrationHelper)

Aggregations

Injector (com.google.inject.Injector)1 N4HeadlessCompiler (org.eclipse.n4js.generator.headless.N4HeadlessCompiler)1 N4JSHeadlessStandaloneSetup (org.eclipse.n4js.generator.headless.N4JSHeadlessStandaloneSetup)1 HeadlessExtensionRegistrationHelper (org.eclipse.n4js.hlc.base.HeadlessExtensionRegistrationHelper)1