<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>io.github.mathcoach</groupId>
        <artifactId>sablecc-maven-plugin-metapom</artifactId>
        <version>1.1.2</version>
    </parent>


    <artifactId>sablecc-plugin-user-test</artifactId>

    <packaging>jar</packaging>
    <name>sablecc-plugin-user-test</name>

    <url>https://not-ereachable.org</url>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <gensource.dir>${basedir}/target/generated-sources</gensource.dir>
    </properties>

    <build>
        <plugins>

            <plugin>
                <groupId>io.github.mathcoach</groupId>
                <artifactId>sablecc-maven-plugin</artifactId>
                <version>1.1.2</version>
                <configuration>
                    <!-- =======================================================
                        the grammar file
                    -->
                    <grammar>src/main/resources/MySQLGrammar.scc</grammar>
                    <!-- =======================================================
                        (option: -d) destination directory, where the generated files
                        are saved. The default is shown below in comments.
                        With this configuration the generated files are save in
                        ${gensource.dir}/xxxx as default.
                    ======================================================== -->
                    <!-- destination>${gensource.dir}/sablecc</destination -->
                    <destination>${gensource.dir}/xxxx</destination>

                    <!-- =======================================================
                        (option: no-inline) default false (no make any effect now)
                    ======================================================= -->

                    <noInline></noInline>
                    <!-- =======================================================
                        (option: inline-max-alts) default 20 (no make any effect now)
                    ======================================================= -->
                    <inlineMaxAlts></inlineMaxAlts>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>io.github.mathcoach</groupId>
                        <artifactId>sablecc-java21</artifactId>
                        <version>3.7</version>
                    </dependency>
                </dependencies>
                <executions>
                    <!-- this execution will call sablecc for the file
                            src/main/resources/MySQLGrammar.scc
                            If you have only one grammar, you just nedd only the
                            tag goals|goal|sablecc to call sablecc. You don't
                            even need the tag ID.
                    -->
                    <execution>
                        <id>mysql grammar</id>
                        <goals>
                            <goal>sablecc</goal>
                        </goals>
                    </execution>

                    <!-- This execution will call sablecc for the file
                            src/main/resources/complex.scc
                            and save all generated files in
                            ${gensource.dir}/complex
                            because the tag grammar and destination are set here.

                            If you have more than one grammar files, you must
                            set the tag grammar to point to one of your grammar files
                            in each execution tag. You must also provide an id tag
                            for each execution.

                        If you don't set the tag destination for each execution,
                        the generated
                        files are saved in the default directory, which is
                        either defined in the "global" configuration tag
                        above, or is the implicit default value
                        ${gensource.dir}/sablecc
                    -->
                    <execution>
                        <id>complex grammar</id>
                        <configuration>
                            <grammar>src/main/resources/complex.scc</grammar>
                            <destination>${gensource.dir}/java_g</destination>
                            <outputPackage>xx.yy.zz</outputPackage>
                        </configuration>
                        <goals>
                            <goal>sablecc</goal>
                        </goals>
                    </execution>

                    <!--
                    <execution>
                        <id>java grammar</id>
                        <configuration>
                            <grammar>src/main/resources/java-1.5.scc</grammar>
                            <destination>${gensource.dir}/java_g</destination>
                            <outputPackage>org.sablecc.grammars.java_1_5</outputPackage>
                        </configuration>
                        <goals>
                            <goal>sablecc</goal>
                        </goals>
                    </execution>
                    -->

                    <execution>
                        <!-- this execution demonstrates the explanation in the
                            execution "complex grammar" above.
                        -->
                        <id>simple grammar</id>
                        <configuration>
                            <grammar>src/main/resources/simple.scc</grammar>
                        </configuration>
                        <goals>
                            <goal>sablecc</goal>
                        </goals>
                    </execution>

                    <execution>
                        <!-- This execution demonstrates that the plugin search the
                        file MySQLGrammarCopy.scc in the folder
                        ${basedir}/src/main/sablecc
                        if there is no Folder-Separator in the configuration-parameter
                        <grammar>
                        -->
                        <id>found sablecc file in sablecc dir</id>
                        <configuration>
                            <grammar>MySQLGrammarCopy.scc</grammar>
                            <outputPackage>mysqlgrm.copy</outputPackage>
                            <destination>${gensource.dir}/sablecc</destination>
                        </configuration>
                        <goals>
                            <goal>sablecc</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
		
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>                
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>                
                <configuration>
                    <doclint>none</doclint>
                </configuration>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <dependencies>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-api</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-engine</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>
</project>
