raydac / java-comment-preprocessor

preprocessor for computer languages with C-like comment format (C/C++/Java/Go)
Apache License 2.0
172 stars 27 forks source link

Add a testPreprocess goal #14

Closed htfv closed 7 years ago

htfv commented 7 years ago

Typical Maven plugins have separate goals for the main and test sources, for example compile and testCompile, resources and testResources. Having a testPreprocess goal bound to the generate-test-sources goal may greatly reduce configuration. The following

<executions>
    <execution>
        <id>preprocess-sources</id>
        <goals>
            <goal>preprocess</goal>
        </goals>
    </execution>
    <execution>
        <id>preprocess-test-sources</id>
        <configuration>
            <useTestSources>true</useTestSources>
        </configuration>
        <goals>
            <goal>preprocess</goal>
        </goals>
        <phase>generate-test-sources</phase>
    </execution>
</executions>

may be then replaced with

<executions>
    <execution>
        <goals>
            <goal>preprocess</goal>
            <goal>testPreprocess</goal>
        </goals>
    </execution>
</executions>

All existing properties may be supported, the testProcess goal may just have different defaults.

This is a minor improvement. I could create a pull request if you think that this feature has a value.

raydac commented 7 years ago

I made new goal preprocessTests which just provides true for useTestSources and processed in generate test source phase

htfv commented 7 years ago

Tested it and it works. Thank you for quick response.