<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>com.kohlschutter.jacline</groupId>
        <artifactId>jacline</artifactId>
        <version>1.0.2</version>
        <relativePath>../pom.xml</relativePath>
    </parent>

    <artifactId>jacline-jrejs</artifactId>

    <properties>
        <maven.compiler.source>11</maven.compiler.source>
        <maven.compiler.target>11</maven.compiler.target>
        <xlint.compiler.arg></xlint.compiler.arg>
        <spotbugs.disabled>true</spotbugs.disabled>
        <checkstyle.disabled>false</checkstyle.disabled>
    </properties>

    <profiles>
        <profile>
            <id>not-eclipse</id>
            <activation>
                <property>
                    <name>!m2e.version</name>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>build-helper-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>add-sources</id>
                                <phase>generate-sources</phase>
                                <goals>
                                    <goal>add-source</goal>
                                </goals>
                                <configuration>
                                    <sources>
                                        <source>src/main/java</source>
                                        <source>src/fixes/java</source>
                                    </sources>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>bootstrap-fixes</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>com.kohlschutter.jacline</groupId>
                        <artifactId>jacline-maven-plugin</artifactId>
                        <version>${project.version}</version>
                        <executions>
                            <execution>
                                <id>default-jacline-compile</id>
                                <goals>
                                    <goal>compile</goal>
                                </goals>
                                <phase>compile</phase>
                                <configuration>
                                    <transpileSourceRoots>
                                        <transpileSourceRoot>src/fixes/java</transpileSourceRoot>
                                    </transpileSourceRoots>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <build>
        <sourceDirectory>src/shared/java</sourceDirectory>
        <plugins>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <compilerArgs>
                        <arg>--system=none</arg>
                        <arg>--patch-module</arg>
                        <arg>java.base=.</arg>
                        <arg>--add-reads</arg>
                        <arg>java.base=ALL-UNNAMED</arg>
                        <arg>-XDstringConcat=inline</arg>
                    </compilerArgs>
                    <fork>true</fork>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-pmd-plugin</artifactId>
                <configuration>
                    <skip>true</skip>
                </configuration>
                <executions>
                    <execution>
                        <id>default-check</id>
                        <phase>none</phase>
                    </execution>
                    <execution>
                        <id>default-cpd-check</id>
                        <phase>none</phase>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>com.mycila</groupId>
                <artifactId>license-maven-plugin</artifactId>
                <configuration>
                    <skip>true</skip>
                </configuration>
                <executions>
                    <execution>
                        <id>check-license-headers</id>
                        <phase>none</phase>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>de.thetaphi</groupId>
                <artifactId>forbiddenapis</artifactId>
                <configuration>
                    <skip>true</skip>
                </configuration>
                <executions>
                    <execution>
                        <id>default</id>
                        <phase>none</phase>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>com.github.spotbugs</groupId>
                <artifactId>spotbugs-maven-plugin</artifactId>
                <configuration>
                    <skip>true</skip>
                </configuration>
                <executions>
                    <execution>
                        <id>spotbugs-during-install</id>
                        <phase>none</phase>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <executions>
                    <execution>
                        <id>checkstyle-during-compile</id>
                        <phase>none</phase>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <configuration>
                    <failOnError>false</failOnError>
                    <failOnWarnings>false</failOnWarnings>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <executions>
                    <execution>
                        <id>default-jar</id>
                        <configuration>
                            <includes>
                                <include>META-INF/jacline/**</include>
                                <include>javaemul/**</include>
                            </includes>
                        </configuration>
                    </execution>
                    <execution>
                        <id>bootstrap-jar</id>
                        <phase>process-classes</phase>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                        <configuration>
                            <classifier>bootstrap</classifier>
                            <excludes>
                                <exclude>META-INF/jacline/**</exclude>
                            </excludes>
                        </configuration>
                    </execution>
                    <execution>
                        <id>embedded-bootstrap-jar</id>
                        <phase>package</phase>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                        <configuration>
                            <classifier>bootstrap-embedded</classifier>
                            <classesDirectory>${project.build.directory}</classesDirectory>
                            <includes>
                                <include>
                                    jacline-jrejs-${project.version}-bootstrap.jar</include>
                            </includes>
                            <archive>
                                <addMavenDescriptor>false</addMavenDescriptor>
                            </archive>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>com.kohlschutter.jacline</groupId>
                <artifactId>jacline-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>default-jacline-compile</id>
                        <goals>
                            <goal>compile</goal>
                        </goals>
                        <phase>compile</phase>
                        <configuration>
                            <transpileSourceRoots>
                                <transpileSourceRoot>src/main/java</transpileSourceRoot>
                                <transpileSourceRoot>src/shared/java</transpileSourceRoot>
                                <transpileSourceRoot>src/fixes/java</transpileSourceRoot>
                            </transpileSourceRoots>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>

        <resources>
            <resource>
                <directory>src/main/resources</directory>
            </resource>
            <resource>
                <directory>src/fixes/resources</directory>
            </resource>
        </resources>
    </build>

    <dependencies>
        <dependency>
            <groupId>com.kohlschutter.jacline</groupId>
            <artifactId>jacline-jsinterop-base</artifactId>
        </dependency>
    </dependencies>
</project>
