blob: 1baabc3441c1a12ba2aad4c5cb17a8d8212a5e32 [file] [log] [blame]
/**
*
* Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany)
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation
*
*/
package org.eclipse.osbp.xtext.i18n;
import java.util.Set;
import org.eclipse.xtext.generator.IFileSystemAccess;
import org.eclipse.xtext.generator.IOutputConfigurationProvider;
import org.eclipse.xtext.generator.OutputConfiguration;
import static com.google.common.collect.Sets.*;
public class DSLOutputConfigurationProvider implements IOutputConfigurationProvider {
public static final String SMOOKS_OUTPUT_ONCE = "DEFAULT_OUTPUT_ONCE";
public static final String SMOOKS_OUTPUT_DIRECTORY = "smooks";
public static final String DEFAULT_OUTPUT_I18N = "DEFAULT_OUTPUT_I18N";
public static final String I18N_OUTPUT_DIRECTORY = "i18n";
public static final String DEFAULT_REPORT_OUTPUT = "DEFAULT_REPORT_OUTPUT";
public static final String CUBE_CATALOG_OUTPUT = "CUBE_CATALOG_OUTPUT";
public static final String CUBE_CATALOG_DIRECTORY = "catalog";
public static final String CONFIGURATION_DIRECTORY = "config";
@Override
public Set<OutputConfiguration> getOutputConfigurations() {
Set<OutputConfiguration> configs = newHashSet();
OutputConfiguration defaultOutput = new OutputConfiguration(IFileSystemAccess.DEFAULT_OUTPUT);
defaultOutput.setDescription("Output Folder");
defaultOutput.setOutputDirectory("./src-gen");
defaultOutput.setOverrideExistingResources(true);
defaultOutput.setCreateOutputDirectory(true);
defaultOutput.setCleanUpDerivedResources(true);
defaultOutput.setSetDerivedProperty(true);
defaultOutput.setKeepLocalHistory(true);
configs.add(defaultOutput);
OutputConfiguration onceOutput = new OutputConfiguration(SMOOKS_OUTPUT_ONCE);
onceOutput.setDescription("Output Folder (once)");
onceOutput.setOutputDirectory("./"+SMOOKS_OUTPUT_DIRECTORY);
onceOutput.setOverrideExistingResources(true);
onceOutput.setCreateOutputDirectory(true);
onceOutput.setCleanUpDerivedResources(true);
onceOutput.setSetDerivedProperty(true);
configs.add(onceOutput);
OutputConfiguration catalogOutput = new OutputConfiguration(CUBE_CATALOG_OUTPUT);
catalogOutput.setDescription("Output Folder (catalog)");
catalogOutput.setOutputDirectory("./"+CUBE_CATALOG_DIRECTORY);
catalogOutput.setOverrideExistingResources(true);
catalogOutput.setCreateOutputDirectory(true);
catalogOutput.setCleanUpDerivedResources(true);
catalogOutput.setSetDerivedProperty(true);
configs.add(catalogOutput);
OutputConfiguration resourceOutput = new OutputConfiguration(DEFAULT_OUTPUT_I18N);
resourceOutput.setDescription("Output Folder (i18n)");
resourceOutput.setOutputDirectory("./"+I18N_OUTPUT_DIRECTORY);
resourceOutput.setOverrideExistingResources(true);
resourceOutput.setCreateOutputDirectory(true);
resourceOutput.setCleanUpDerivedResources(false);
resourceOutput.setSetDerivedProperty(false);
configs.add(resourceOutput);
OutputConfiguration reportOutput = new OutputConfiguration(DEFAULT_REPORT_OUTPUT);
reportOutput.setDescription("Output Folder");
reportOutput.setOutputDirectory("./rptdesign-gen");
reportOutput.setOverrideExistingResources(true);
reportOutput.setCreateOutputDirectory(true);
reportOutput.setCleanUpDerivedResources(true);
reportOutput.setSetDerivedProperty(true);
configs.add(reportOutput);
OutputConfiguration componentOutput = new OutputConfiguration(
"OSGI-INF");
componentOutput.setDescription("OSGi-Services");
componentOutput.setOutputDirectory("./OSGI-INF");
componentOutput.setOverrideExistingResources(true);
componentOutput.setCreateOutputDirectory(true);
componentOutput.setCleanUpDerivedResources(true);
componentOutput.setSetDerivedProperty(true);
componentOutput.setKeepLocalHistory(true);
configs.add(componentOutput);
OutputConfiguration dtoOutput = new OutputConfiguration("DTOs");
dtoOutput.setDescription("derived DTOs");
dtoOutput.setOutputDirectory("./dto-models");
dtoOutput.setOverrideExistingResources(false);
dtoOutput.setCreateOutputDirectory(true);
dtoOutput.setCleanUpDerivedResources(false);
dtoOutput.setSetDerivedProperty(false);
dtoOutput.setKeepLocalHistory(true);
configs.add(dtoOutput);
OutputConfiguration dtoMapperOutput = new OutputConfiguration(
"Dto-Mappers");
dtoMapperOutput.setDescription("Dto Mappers");
dtoMapperOutput.setOutputDirectory("./src-gen");
dtoMapperOutput.setOverrideExistingResources(true);
dtoMapperOutput.setCreateOutputDirectory(true);
dtoMapperOutput.setCleanUpDerivedResources(true);
dtoMapperOutput.setSetDerivedProperty(true);
dtoMapperOutput.setKeepLocalHistory(true);
configs.add(dtoMapperOutput);
OutputConfiguration servicesOutput = new OutputConfiguration(
"Services-DSL");
servicesOutput.setDescription("Services-DSL");
servicesOutput.setOutputDirectory("./service-models");
servicesOutput.setOverrideExistingResources(true);
servicesOutput.setCreateOutputDirectory(true);
servicesOutput.setCleanUpDerivedResources(true);
servicesOutput.setSetDerivedProperty(true);
servicesOutput.setKeepLocalHistory(true);
configs.add(servicesOutput);
OutputConfiguration binOutput = new OutputConfiguration(
"ModelBin");
binOutput.setDescription("ModelBin");
binOutput.setOutputDirectory("./modelsbin");
binOutput.setOverrideExistingResources(true);
binOutput.setCreateOutputDirectory(true);
binOutput.setCleanUpDerivedResources(true);
binOutput.setSetDerivedProperty(true);
binOutput.setKeepLocalHistory(true);
configs.add(binOutput);
OutputConfiguration configOutput = new OutputConfiguration(CONFIGURATION_DIRECTORY);
configOutput.setDescription("Configuration Folder (once)");
configOutput.setOutputDirectory("./"+CONFIGURATION_DIRECTORY);
configOutput.setOverrideExistingResources(false);
configOutput.setCreateOutputDirectory(true);
configOutput.setCleanUpDerivedResources(false);
configOutput.setSetDerivedProperty(false);
configs.add(configOutput);
return configs;
}
}