Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better handling of output folders in example project #10

Open
victornoel opened this issue Nov 28, 2013 · 3 comments
Open

Better handling of output folders in example project #10

victornoel opened this issue Nov 28, 2013 · 3 comments

Comments

@victornoel
Copy link

Hi,

Would be best if the example project was using two different output folders for xtend and the hero language.

And by the way, I'm surprised that one has to explicitly tell maven to add the source folder of xtend (or hero?) and to clean it...

I know that with the xtend-maven-plugin there is no need for that, is that needed for xtext-maven-plugin? If yes... why? :)

@svenefftinge
Copy link
Member

Yes it is, because we currently don't know whether we have to treat an output folder as a Java source folder or not.
See https://bugs.eclipse.org/bugs/show_bug.cgi?id=422462

@victornoel
Copy link
Author

Ok, I see, thanks :)

Still, in the example pom here, I think it would be best to separate the output folders for xtend from those for hero.

@victornoel
Copy link
Author

Hi,

A little feedback on that bug I opened a long time ago.

On the first point, it seems that now (or maybe even before and I misunderstood how things worked at that time) xtend is generated to src/main/xtend-gen without having to explicitly configure it in the pom.xml, while the hero language is generated to src/main/generated-sources/xtend/.
-> I would propose to change the name of the folder where hero files are generated for something more relevant such as src/main/hero-gen/ or src/main/generated-sources/hero/.

On the second point, I have nothing to add except that the xtend-gen folder is not cleaned while the folder where hero files are generated is.
-> I would propose to restore coherence and either clean both of them or none. I personally think it's best not to clean them on clean, but optionally clean them before generating code.
The following configuration can be used (that's what I use in my projects):

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-clean-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>clean</goal>
                        </goals>
                        <configuration>
                            <!-- this is the important part on top of the chosen phase -->
                            <excludeDefaultDirectories>true</excludeDefaultDirectories>
                            <filesets>
                                <fileset>
                                    <directory>${project.basedir}/src/main/hero-gen</directory>
                                </fileset>
                                <fileset>
                                    <directory>${project.basedir}/src/main/xtend-gen</directory>
                                </fileset>
                                <fileset>
                                    <directory>${project.basedir}/src/test/xtend-gen</directory>
                                </fileset>
                            </filesets>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

(edit: I had forgotten the test directories)
(edit2: no test dir for hero, and corrected filesets)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants