Search in sources :

Example 1 with WizardConfiguration

use of org.eclipse.xtext.xtext.wizard.WizardConfiguration in project xtext-core by eclipse.

the class WizardConfigurationTest method setupConfig.

@Before
public void setupConfig() {
    WizardConfiguration _wizardConfiguration = new WizardConfiguration();
    final Procedure1<WizardConfiguration> _function = (WizardConfiguration it) -> {
        it.setBaseName("org.example.mydsl");
        it.setRootLocation("");
        LanguageDescriptor _language = it.getLanguage();
        final Procedure1<LanguageDescriptor> _function_1 = (LanguageDescriptor it_1) -> {
            it_1.setName("org.example.mydsl.MyDsl");
            it_1.setFileExtensions(LanguageDescriptor.FileExtensions.fromString("mydsl"));
        };
        ObjectExtensions.<LanguageDescriptor>operator_doubleArrow(_language, _function_1);
    };
    WizardConfiguration _doubleArrow = ObjectExtensions.<WizardConfiguration>operator_doubleArrow(_wizardConfiguration, _function);
    this.config = _doubleArrow;
}
Also used : Procedure1(org.eclipse.xtext.xbase.lib.Procedures.Procedure1) LanguageDescriptor(org.eclipse.xtext.xtext.wizard.LanguageDescriptor) WizardConfiguration(org.eclipse.xtext.xtext.wizard.WizardConfiguration) Before(org.junit.Before)

Example 2 with WizardConfiguration

use of org.eclipse.xtext.xtext.wizard.WizardConfiguration in project xtext-core by eclipse.

the class CliWizardIntegrationTest method newProjectConfig.

private static WizardConfiguration newProjectConfig() {
    WizardConfiguration _wizardConfiguration = new WizardConfiguration();
    final Procedure1<WizardConfiguration> _function = (WizardConfiguration it) -> {
        XtextVersion _xtextVersion = new XtextVersion("unspecified");
        it.setXtextVersion(_xtextVersion);
        it.setEncoding(Charsets.UTF_8);
        LanguageDescriptor _language = it.getLanguage();
        final Procedure1<LanguageDescriptor> _function_1 = (LanguageDescriptor it_1) -> {
            it_1.setName("org.xtext.example.mydsl.MyDsl");
            it_1.setFileExtensions(LanguageDescriptor.FileExtensions.fromString("mydsl"));
        };
        ObjectExtensions.<LanguageDescriptor>operator_doubleArrow(_language, _function_1);
    };
    return ObjectExtensions.<WizardConfiguration>operator_doubleArrow(_wizardConfiguration, _function);
}
Also used : XtextVersion(org.eclipse.xtext.util.XtextVersion) Procedure1(org.eclipse.xtext.xbase.lib.Procedures.Procedure1) LanguageDescriptor(org.eclipse.xtext.xtext.wizard.LanguageDescriptor) WizardConfiguration(org.eclipse.xtext.xtext.wizard.WizardConfiguration)

Example 3 with WizardConfiguration

use of org.eclipse.xtext.xtext.wizard.WizardConfiguration in project xtext-core by eclipse.

the class CliWizardIntegrationTest method main.

/**
 * Use this main method to update the expectations to whatever the wizard currently generates
 */
public static void main(final String[] args) {
    final CliProjectsCreator creator = CliWizardIntegrationTest.newProjectCreator();
    final Consumer<WizardConfiguration> _function = (WizardConfiguration config) -> {
        try {
            String _baseName = config.getBaseName();
            final File targetLocation = new File("testdata/wizard-expectations", _baseName);
            targetLocation.mkdirs();
            Files.sweepFolder(targetLocation);
            config.setRootLocation(targetLocation.getPath());
            creator.createProjects(config);
            String _baseName_1 = config.getBaseName();
            String _plus = ("Updating expectations for " + _baseName_1);
            InputOutput.<String>println(_plus);
        } catch (Throwable _e) {
            throw Exceptions.sneakyThrow(_e);
        }
    };
    CliWizardIntegrationTest.projectConfigs.forEach(_function);
}
Also used : CliProjectsCreator(org.eclipse.xtext.xtext.wizard.cli.CliProjectsCreator) WizardConfiguration(org.eclipse.xtext.xtext.wizard.WizardConfiguration) File(java.io.File)

Aggregations

WizardConfiguration (org.eclipse.xtext.xtext.wizard.WizardConfiguration)3 Procedure1 (org.eclipse.xtext.xbase.lib.Procedures.Procedure1)2 LanguageDescriptor (org.eclipse.xtext.xtext.wizard.LanguageDescriptor)2 File (java.io.File)1 XtextVersion (org.eclipse.xtext.util.XtextVersion)1 CliProjectsCreator (org.eclipse.xtext.xtext.wizard.cli.CliProjectsCreator)1 Before (org.junit.Before)1