<?xml version="1.0" encoding="UTF-8"?>
<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>de.mirkosertic.bytecoder</groupId>
        <artifactId>bytecoder-parent</artifactId>
        <version>2023-05-19</version>
    </parent>

    <artifactId>bytecoder-integrationtest</artifactId>
    <packaging>war</packaging>
    <name>Bytecoder Integrationtest</name>
    <description>Bytecoder Integration Tests</description>

    <properties>
        <timestamp>${maven.build.timestamp}</timestamp>
        <maven.build.timestamp.format>yyyy-MM-dd HH:mm</maven.build.timestamp.format>
    </properties>

    <dependencies>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>bytecoder-core</artifactId>
        </dependency>

        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>bytecoder.vue</artifactId>
        </dependency>

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.jbox2d</groupId>
            <artifactId>jbox2d-library</artifactId>
            <version>2.2.1.1</version>
        </dependency>

        <dependency>
            <groupId>org.luaj</groupId>
            <artifactId>luaj-jse</artifactId>
            <version>3.0.1</version>
        </dependency>

        <dependency>
            <groupId>org.jetbrains.kotlin</groupId>
            <artifactId>kotlin-stdlib</artifactId>
            <version>${kotlin.version}</version>
        </dependency>

        <dependency>
            <groupId>org.clojure</groupId>
            <artifactId>clojure</artifactId>
            <version>${clojure.version}</version>
        </dependency>

        <dependency>
            <groupId>am.ik.yavi</groupId>
            <artifactId>yavi</artifactId>
            <version>0.12.1</version>
            <scope>test</scope>
        </dependency>

    </dependencies>

    <build>
        <finalName>bytecoder-integrationtest</finalName>
        <plugins>
            <plugin>
                <artifactId>kotlin-maven-plugin</artifactId>
                <groupId>org.jetbrains.kotlin</groupId>
                <version>${kotlin.version}</version>
                <executions>
                    <execution>
                        <id>compile</id>
                        <goals>
                            <goal>compile</goal> </goals>
                        <configuration>
                            <sourceDirs>
                                <sourceDir>${project.basedir}/src/main/kotlin</sourceDir>
                                <sourceDir>${project.basedir}/src/main/java</sourceDir>
                            </sourceDirs>
                        </configuration>
                    </execution>
                    <execution>
                        <id>test-compile</id>
                        <goals>
                            <goal>test-compile</goal> </goals>
                        <configuration>
                            <sourceDirs>
                                <sourceDir>${project.basedir}/src/test/kotlin</sourceDir>
                                <sourceDir>${project.basedir}/src/test/java</sourceDir>
                            </sourceDirs>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>com.theoryinpractise</groupId>
                <artifactId>clojure-maven-plugin</artifactId>
                <version>1.9.2</version>
                <executions>
                    <execution>
                        <id>compile</id>
                        <phase>compile</phase>
                        <goals>
                            <goal>compile</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>test</id>
                        <phase>test</phase>
                        <goals>
                            <goal>test</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.11.0</version>
                <executions>
                    <!-- Replacing default-compile as it is treated specially by maven -->
                    <execution>
                        <id>default-compile</id>
                        <phase>none</phase>
                    </execution>
                    <!-- Replacing default-testCompile as it is treated specially by maven -->
                    <execution>
                        <id>default-testCompile</id>
                        <phase>none</phase>
                    </execution>
                    <execution>
                        <id>java-compile</id>
                        <phase>compile</phase>
                        <goals>
                            <goal>compile</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>java-test-compile</id>
                        <phase>test-compile</phase>
                        <goals>
                            <goal>testCompile</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>de.mirkosertic.bytecoder</groupId>
                <artifactId>bytecoder-mavenplugin</artifactId>
                <version>${project.version}</version>
                <executions>
                    <execution>
                        <id>javascript</id>
                        <goals>
                            <goal>compile</goal>
                        </goals>
                        <configuration>
                            <mainClass>de.mirkosertic.bytecoder.integrationtest.JBox2DSimulation</mainClass>
                            <backend>js</backend>
                            <filenamePrefix>jbox2d_js</filenamePrefix>
                        </configuration>
                    </execution>
                    <execution>
                        <id>javascript-kotlin</id>
                        <goals>
                            <goal>compile</goal>
                        </goals>
                        <configuration>
                            <mainClass>de.mirkosertic.bytecoder.integrationtest.JBox2DSimulationKotlin</mainClass>
                            <backend>js</backend>
                            <filenamePrefix>jbox2d_kotlin_js</filenamePrefix>
                        </configuration>
                    </execution>
                    <execution>
                        <id>wasm</id>
                        <goals>
                            <goal>compile</goal>
                        </goals>
                        <configuration>
                            <mainClass>de.mirkosertic.bytecoder.integrationtest.JBox2DSimulation</mainClass>
                            <backend>wasm</backend>
                            <filenamePrefix>jbox2d_wasm</filenamePrefix>
                            <debugOutput>false</debugOutput>
                        </configuration>
                    </execution>
                    <execution>
                        <id>wasm-kotlin</id>
                        <goals>
                            <goal>compile</goal>
                        </goals>
                        <configuration>
                            <mainClass>de.mirkosertic.bytecoder.integrationtest.JBox2DSimulationKotlin</mainClass>
                            <backend>wasm</backend>
                            <filenamePrefix>jbox2d_wasm_kotlin</filenamePrefix>
                            <debugOutput>false</debugOutput>
                        </configuration>
                    </execution>
                    <execution>
                        <id>vue-wasm</id>
                        <goals>
                            <goal>compile</goal>
                        </goals>
                        <configuration>
                            <mainClass>de.mirkosertic.bytecoder.integrationtest.VueDemo</mainClass>
                            <backend>wasm</backend>
                            <filenamePrefix>vue_wasm</filenamePrefix>
                            <debugOutput>false</debugOutput>
                        </configuration>
                    </execution>
                    <execution>
                        <id>lua-js</id>
                        <goals>
                            <goal>compile</goal>
                        </goals>
                        <configuration>
                            <mainClass>de.mirkosertic.bytecoder.integrationtest.LuaDemo</mainClass>
                            <backend>js</backend>
                            <filenamePrefix>lua_js</filenamePrefix>
                        </configuration>
                    </execution>
                    <execution>
                        <id>lua-wasm</id>
                        <goals>
                            <goal>compile</goal>
                        </goals>
                        <configuration>
                            <mainClass>de.mirkosertic.bytecoder.integrationtest.LuaDemo</mainClass>
                            <backend>wasm</backend>
                            <filenamePrefix>lua_wasm</filenamePrefix>
                            <debugOutput>false</debugOutput>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>3.5.0</version>
                <executions>
                    <execution>
                        <id>src-dependencies</id>
                        <phase>prepare-package</phase>
                        <goals>
                            <!-- use copy-dependencies instead if you don't want to explode the sources -->
                            <goal>unpack-dependencies</goal>
                        </goals>
                        <configuration>
                            <classifier>sources</classifier>
                            <failOnMissingClassifierArtifact>false</failOnMissingClassifierArtifact>
                            <outputDirectory>${project.build.directory}/bytecoder</outputDirectory>
                            <includeGroupIds>de.mirkosertic.bytecoder,org.jbox2d</includeGroupIds>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <configuration>
                    <webResources>
                        <resource>
                            <filtering>true</filtering>
                            <directory>src/main/webresources/</directory>
                        </resource>
                        <webResource>
                            <directory>${project.build.directory}/bytecoder</directory>
                        </webResource>
                        <webResource>
                            <directory>src/main/java</directory>
                        </webResource>
                        <webResource>
                            <directory>src/main/kotlin</directory>
                        </webResource>
                    </webResources>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>
