Java Code Examples for org.eclipse.xtext.generator.OutputConfiguration#setCreateOutputDirectory()
The following examples show how to use
org.eclipse.xtext.generator.OutputConfiguration#setCreateOutputDirectory() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: N4IDLSubGenerator.java From n4js with Eclipse Public License 1.0 | 6 votes |
private static CompilerDescriptor createDescriptor() { final CompilerDescriptor result = new CompilerDescriptor(); result.setIdentifier(COMPILER_ID); result.setName("N4IDL to ECMAScript transpiler"); result.setDescription( "Transpiles N4IDL to ECMAScript, currently ES5 plus some selected ES6 features supported by V8."); result.setActive(true); result.setCompiledFileExtension("js"); result.setCompiledFileSourceMapExtension("map"); final OutputConfiguration outCfg = new OutputConfiguration(COMPILER_ID); outCfg.setDescription("N4IDL to ECMAScript transpiler"); outCfg.setOutputDirectory(N4JSLanguageConstants.DEFAULT_PROJECT_OUTPUT); outCfg.setOverrideExistingResources(true); outCfg.setCreateOutputDirectory(true); outCfg.setCleanUpDerivedResources(true); outCfg.setSetDerivedProperty(true); outCfg.setKeepLocalHistory(true); outCfg.setCanClearOutputDirectory(true); result.setOutputConfiguration(outCfg); return result; }
Example 2
Source File: BuilderParticipantTest.java From xtext-eclipse with Eclipse Public License 2.0 | 6 votes |
@Test public void testNoOutputFolderCreation() throws Exception { OutputConfigurationProvider outputConfigurationProvider = new OutputConfigurationProvider() { @Override public Set<OutputConfiguration> getOutputConfigurations() { final Set<OutputConfiguration> result = super.getOutputConfigurations(); OutputConfiguration configuration = result.iterator().next(); configuration.setCreateOutputDirectory(false); return result; } }; BuilderPreferenceAccess.Initializer initializer = new BuilderPreferenceAccess.Initializer(); initializer.setOutputConfigurationProvider(outputConfigurationProvider); initializer.initialize(preferenceStoreAccess); IJavaProject project = createJavaProject("foo"); addNature(project.getProject(), XtextProjectHelper.NATURE_ID); IFolder folder = project.getProject().getFolder("src"); IFile file = folder.getFile("Foo" + F_EXT); file.create(new StringInputStream("object Foo"), true, monitor()); build(); final IFile generatedFile = project.getProject().getFile("./src-gen/Foo.txt"); assertFalse(generatedFile.exists()); }
Example 3
Source File: EcmaScriptSubGenerator.java From n4js with Eclipse Public License 1.0 | 5 votes |
/** Creates a default OutputConfiguration */ public static OutputConfiguration createDefaultOutputConfiguration() { final OutputConfiguration outCfg = new OutputConfiguration(COMPILER_ID); outCfg.setDescription("N4JS to ECMAScript transpiler"); outCfg.setOutputDirectory(N4JSLanguageConstants.DEFAULT_PROJECT_OUTPUT); outCfg.setOverrideExistingResources(true); outCfg.setCreateOutputDirectory(true); outCfg.setCleanUpDerivedResources(true); outCfg.setSetDerivedProperty(true); outCfg.setKeepLocalHistory(true); outCfg.setCanClearOutputDirectory(true); return outCfg; }
Example 4
Source File: EclipseOutputConfigurationProvider.java From xtext-eclipse with Eclipse Public License 2.0 | 5 votes |
/** * @deprecated use {@link #createAndOverlayOutputConfiguration(IProject, IPreferenceStore, OutputConfiguration)} */ @Deprecated protected OutputConfiguration createAndOverlayOutputConfiguration(IPreferenceStore store, OutputConfiguration output) { OutputConfiguration result = new OutputConfiguration(output.getName()); boolean clearOutputDirectory = getBoolean(output, OUTPUT_CLEAN_DIRECTORY, store, output.isCanClearOutputDirectory()); result.setCanClearOutputDirectory(clearOutputDirectory); boolean cleanUpDerivedResources = getBoolean(output, OUTPUT_CLEANUP_DERIVED, store, output.isCleanUpDerivedResources()); result.setCleanUpDerivedResources(cleanUpDerivedResources); boolean createOutputDirectory = getBoolean(output, OUTPUT_CREATE_DIRECTORY, store, output.isCreateOutputDirectory()); result.setCreateOutputDirectory(createOutputDirectory); boolean overrideExistingResources = getBoolean(output, OUTPUT_OVERRIDE, store, output.isOverrideExistingResources()); result.setOverrideExistingResources(overrideExistingResources); boolean setDerivedProperty = getBoolean(output, OUTPUT_DERIVED, store, output.isSetDerivedProperty()); result.setSetDerivedProperty(setDerivedProperty); boolean installDslAsPrimarySource = getBoolean(output, INSTALL_DSL_AS_PRIMARY_SOURCE, store, output.isInstallDslAsPrimarySource()); result.setInstallDslAsPrimarySource(installDslAsPrimarySource); boolean hideSyntheticLocalVariables = getBoolean(output, HIDE_LOCAL_SYNTHETIC_VARIABLES, store, output.isHideSyntheticLocalVariables()); result.setHideSyntheticLocalVariables(hideSyntheticLocalVariables); String description = getString(output, OUTPUT_DESCRIPTION, store, output.getDescription()); result.setDescription(description); String directory = getString(output, OUTPUT_DIRECTORY, store, output.getOutputDirectory()); result.setOutputDirectory(directory); boolean keepLocalHistory = getBoolean(output, OUTPUT_KEEP_LOCAL_HISTORY, store, output.isKeepLocalHistory()); result.setKeepLocalHistory(keepLocalHistory); boolean useOutputPerSourceFolder = getBoolean(output, USE_OUTPUT_PER_SOURCE_FOLDER, store, output.isUseOutputPerSourceFolder()); result.setUseOutputPerSourceFolder(useOutputPerSourceFolder); return result; }
Example 5
Source File: XtendOutputConfigurationProvider.java From xtext-xtend with Eclipse Public License 2.0 | 5 votes |
@Override public Set<OutputConfiguration> getOutputConfigurations() { OutputConfiguration defaultOutput = new OutputConfiguration(IFileSystemAccess.DEFAULT_OUTPUT); defaultOutput.setDescription("Output folder for generated Java files"); defaultOutput.setOutputDirectory("xtend-gen"); defaultOutput.setOverrideExistingResources(true); defaultOutput.setCreateOutputDirectory(true); defaultOutput.setCanClearOutputDirectory(false); defaultOutput.setCleanUpDerivedResources(true); defaultOutput.setSetDerivedProperty(true); defaultOutput.setKeepLocalHistory(false); return newHashSet(defaultOutput); }
Example 6
Source File: CheckOutputConfigurationProvider.java From dsl-devkit with Eclipse Public License 1.0 | 5 votes |
/** * Gets the check documentation output configuration. * * @return the check documentation configuration */ private OutputConfiguration getCheckDocumentationConfig() { OutputConfiguration config = new OutputConfiguration(CheckGeneratorConstants.CHECK_DOC_OUTPUT); config.setDescription("Output configuration for check documentation use"); config.setOutputDirectory(DOCS_PATH); config.setCreateOutputDirectory(true); config.setCanClearOutputDirectory(true); return config; }
Example 7
Source File: CheckOutputConfigurationProvider.java From dsl-devkit with Eclipse Public License 1.0 | 5 votes |
/** * Gets the service registry output configuration. * * @return the service registry configuration */ private OutputConfiguration getServiceRegistryConfig() { OutputConfiguration config = new OutputConfiguration(CheckGeneratorConstants.CHECK_REGISTRY_OUTPUT); config.setDescription("Output configuration for service registry use"); config.setOutputDirectory("META-INF/services"); config.setOverrideExistingResources(true); config.setCreateOutputDirectory(true); config.setCleanUpDerivedResources(false); config.setSetDerivedProperty(true); return config; }
Example 8
Source File: DefaultFileSystemAccessFactory.java From statecharts with Eclipse Public License 1.0 | 5 votes |
protected void initLibraryTargetFolder(ISCTFileSystemAccess access, GeneratorEntry entry) { FeatureParameterValue libraryTargetFolderValue = helper.getLibraryTargetFolderValue(entry); if (libraryTargetFolderValue != null) { String folderName = libraryTargetFolderValue.getStringValue(); access.setOutputPath(LIBRARY_TARGET_FOLDER_OUTPUT, folderName); OutputConfiguration output = access.getOutputConfigurations().get(LIBRARY_TARGET_FOLDER_OUTPUT); checkWriteAccess(access, LIBRARY_TARGET_FOLDER_OUTPUT, folderName); output.setCreateOutputDirectory(true); output.setCanClearOutputDirectory(false); output.setOverrideExistingResources(false); } }
Example 9
Source File: DefaultFileSystemAccessFactory.java From statecharts with Eclipse Public License 1.0 | 5 votes |
protected void initApiTargetFolder(ISCTFileSystemAccess access, GeneratorEntry entry) { FeatureParameterValue apiTargetFolderValue = helper.getApiTargetFolderValue(entry); if (apiTargetFolderValue != null) { String folderName = apiTargetFolderValue.getStringValue(); access.setOutputPath(API_TARGET_FOLDER_OUTPUT, folderName); OutputConfiguration output = access.getOutputConfigurations().get(API_TARGET_FOLDER_OUTPUT); checkWriteAccess(access, API_TARGET_FOLDER_OUTPUT, folderName); output.setCreateOutputDirectory(true); } }
Example 10
Source File: SarlOutputConfigurationProvider.java From sarl with Apache License 2.0 | 5 votes |
/** Create the standard output configuration. * * @return the configuration, never {@code null}. * @since 0.8 */ @SuppressWarnings("static-method") protected OutputConfiguration createStandardOutputConfiguration() { final OutputConfiguration defaultOutput = new OutputConfiguration(IFileSystemAccess.DEFAULT_OUTPUT); defaultOutput.setDescription(Messages.SarlOutputConfigurationProvider_0); defaultOutput.setOutputDirectory(SARLConfig.FOLDER_SOURCE_GENERATED); defaultOutput.setOverrideExistingResources(true); defaultOutput.setCreateOutputDirectory(true); defaultOutput.setCanClearOutputDirectory(false); defaultOutput.setCleanUpDerivedResources(true); defaultOutput.setSetDerivedProperty(true); defaultOutput.setKeepLocalHistory(false); return defaultOutput; }
Example 11
Source File: SarlOutputConfigurationProvider.java From sarl with Apache License 2.0 | 5 votes |
/** Create the unit test output configuration. * * @return the configuration, never {@code null}. * @since 0.8 */ @SuppressWarnings("static-method") protected OutputConfiguration createTestOutputConfiguration() { final OutputConfiguration testOutput = new OutputConfiguration(SARLConfig.TEST_OUTPUT_CONFIGURATION); testOutput.setDescription(Messages.SarlOutputConfigurationProvider_1); testOutput.setOutputDirectory(SARLConfig.FOLDER_TEST_SOURCE_GENERATED); testOutput.setOverrideExistingResources(true); testOutput.setCreateOutputDirectory(true); testOutput.setCanClearOutputDirectory(false); testOutput.setCleanUpDerivedResources(true); testOutput.setSetDerivedProperty(true); testOutput.setKeepLocalHistory(false); return testOutput; }
Example 12
Source File: PyOutputConfigurationProvider.java From sarl with Apache License 2.0 | 5 votes |
@Override public Set<OutputConfiguration> getOutputConfigurations() { final OutputConfiguration pythonOutput = new OutputConfiguration(OUTPUT_CONFIGURATION_NAME); pythonOutput.setDescription(Messages.PyOutputConfigurationProvider_0); pythonOutput.setOutputDirectory(OUTPUT_FOLDER); pythonOutput.setOverrideExistingResources(true); pythonOutput.setCreateOutputDirectory(true); pythonOutput.setCanClearOutputDirectory(true); pythonOutput.setCleanUpDerivedResources(true); pythonOutput.setSetDerivedProperty(true); pythonOutput.setKeepLocalHistory(false); return newHashSet(pythonOutput); }