@@ -10,24 +10,29 @@ import org.eclipse.xtext.generator.IFileSystemAccess2
1010import org.eclipse.xtext.generator.IGeneratorContext
1111import org.eclipse.xtext.generator.IOutputConfigurationProvider
1212import org.eclipse.xtext.generator.OutputConfiguration
13+ import org.eclipse.xtext.generator.IContextualOutputConfigurationProvider
1314import ros.Node
1415import ros.Package
1516
16- class CICustomOutputProvider implements IOutputConfigurationProvider {
17- public final static String COM_OUTPUT = " COM_OUTPUT"
18-
17+ class CICustomOutputProvider implements IOutputConfigurationProvider , IContextualOutputConfigurationProvider {
1918
19+ public static String COMPONENTS_OUTPUT = " COMPONENTS_OUTPUT" ;
20+
2021 override Set<OutputConfiguration > getOutputConfigurations () {
2122
22- var OutputConfiguration default_config = new OutputConfiguration (COM_OUTPUT )
23- default_config. setDescription(" COM_OUTPUT " );
23+ var OutputConfiguration default_config = new OutputConfiguration (" COMPONENTS_OUTPUT " )
24+ default_config. setDescription(" COMPONENTS_OUTPUT " );
2425 default_config. setOutputDirectory(" ./components/" );
2526 default_config. setOverrideExistingResources(true );
2627 default_config. setCreateOutputDirectory(true );
2728 default_config. setCleanUpDerivedResources(false );
2829 default_config. setSetDerivedProperty(false );
2930 return newHashSet(default_config)
3031 }
32+
33+ override Set<OutputConfiguration > getOutputConfigurations (Resource context ) {
34+ return getOutputConfigurations()
35+ }
3136}
3237
3338/**
@@ -57,7 +62,8 @@ class RosGenerator extends AbstractGenerator {
5762 }
5863 }
5964 for (node : resource. allContents. toIterable. filter(Node )){
60- fsa. generateFile(node. getName()+ " .componentinterface" ,CICustomOutputProvider :: COM_OUTPUT ,compile(node,package_name,artifact_name))
65+ // fsa.generateFile(node.getName()+".componentinterface",CICustomOutputProvider::COMPONENTS_OUTPUT,compile(node,package_name,artifact_name))
66+ fsa. generateFile(node. getName()+ " .componentinterface" ,compile(node,package_name,artifact_name))
6167 }
6268 }
6369
0 commit comments