<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.cucumber</groupId>
        <artifactId>cucumber-scala-aggregator</artifactId>
        <version>5.7.0</version>
    </parent>

    <artifactId>cucumber-scala_2.13</artifactId>
    <packaging>jar</packaging>
    <name>Cucumber-JVM: Scala (2.13)</name>

    <dependencies>
        <dependency>
            <groupId>org.scala-lang</groupId>
            <artifactId>scala-compiler</artifactId>
            <version>${scala.2.13.version}</version>
            <scope>provided</scope>
        </dependency>

        <!-- Users have to provide it (for JacksonDefaultDataTableTransformer) -->
        <dependency>
            <groupId>com.fasterxml.jackson.module</groupId>
            <artifactId>jackson-module-scala_2.13</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.scala-lang</groupId>
            <artifactId>scala-library</artifactId>
            <version>${scala.2.13.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-scala_2.13</artifactId>
            <version>${mockito-scala.version}</version>
            <scope>test</scope>
        </dependency>

    </dependencies>

    <build>
        <sourceDirectory>../sources/src/main/scala</sourceDirectory>
        <resources>
            <resource>
                <directory>../sources/src/main/resources</directory>
            </resource>
        </resources>
        <testSourceDirectory>../sources/src/test/scala</testSourceDirectory>
        <testResources>
            <testResource>
                <directory>../sources/src/test/resources</directory>
            </testResource>
        </testResources>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>net.alchim31.maven</groupId>
                <artifactId>scala-maven-plugin</artifactId>
                <configuration>
                    <!-- https://nathankleyn.com/2019/05/13/recommended-scalac-flags-for-2-13/ -->
                    <args>
                        <!-- Emit warning and location for usages of deprecated APIs. -->
                        <arg>-deprecation</arg>
                        <!-- Explain type errors in more detail. -->
                        <arg>-explaintypes</arg>
                        <!-- Emit warning and location for usages of features that should be imported explicitly. -->
                        <arg>-feature</arg>
                        <!-- Existential types (besides wildcard types) can be written and inferred -->
                        <arg>-language:existentials</arg>
                        <!-- Allow macro definition (besides implementation and application) -->
                        <arg>-language:experimental.macros</arg>
                        <!-- Allow higher-kinded types -->
                        <arg>-language:higherKinds</arg>
                        <!-- Allow definition of implicit functions called views -->
                        <arg>-language:implicitConversions</arg>
                        <!-- Enable additional warnings where generated code depends on assumptions. -->
                        <arg>-unchecked</arg>
                        <!-- Wrap field accessors to throw an exception on uninitialized access. -->
                        <arg>-Xcheckinit</arg>
                        <!-- Fail the compilation if there are any warnings. -->
                        <arg>-Xfatal-warnings</arg>
                        <!-- Warn if an argument list is modified to match the receiver. -->
                        <arg>-Xlint:adapted-args</arg>
                        <!-- Evaluation of a constant arithmetic expression results in an error. -->
                        <arg>-Xlint:constant</arg>
                        <!-- Selecting member of DelayedInit. -->
                        <arg>-Xlint:delayedinit-select</arg>
                        <!-- A Scaladoc comment appears to be detached from its element. -->
                        <arg>-Xlint:doc-detached</arg>
                        <!-- Warn about inaccessible types in method signatures. -->
                        <arg>-Xlint:inaccessible</arg>
                        <!-- Warn when a type argument is inferred to be `Any`. -->
                        <arg>-Xlint:infer-any</arg>
                        <!-- A string literal appears to be missing an interpolator id. -->
                        <arg>-Xlint:missing-interpolator</arg>
                        <!-- Warn when non-nullary `def f()' overrides nullary `def f'. -->
                        <arg>-Xlint:nullary-override</arg>
                        <!-- Warn when nullary methods return Unit. -->
                        <arg>-Xlint:nullary-unit</arg>
                        <!-- Option.apply used implicit view. -->
                        <arg>-Xlint:option-implicit</arg>
                        <!-- Class or object defined in package object. -->
                        <arg>-Xlint:package-object-classes</arg>
                        <!-- Parameterized overloaded implicit methods are not visible as view bounds. -->
                        <arg>-Xlint:poly-implicit-overload</arg>
                        <!-- A private field (or class parameter) shadows a superclass field. -->
                        <arg>-Xlint:private-shadow</arg>
                        <!-- Pattern sequence wildcard must align with sequence component. -->
                        <arg>-Xlint:stars-align</arg>
                        <!-- A local type parameter shadows a type already in scope. -->
                        <arg>-Xlint:type-parameter-shadow</arg>
                        <!-- Warn when dead code is identified. -->
                        <arg>-Ywarn-dead-code</arg>
                        <!-- Warn when more than one implicit parameter section is defined. -->
                        <arg>-Ywarn-extra-implicit</arg>
                        <!-- Warn when numerics are widened. -->
                        <arg>-Ywarn-numeric-widen</arg>
                        <!-- Warn if an implicit parameter is unused. -->
                        <arg>-Ywarn-unused:implicits</arg>
                        <!-- Warn if an import selector is not referenced. -->
                        <arg>-Ywarn-unused:imports</arg>
                        <!-- Warn if a local definition is unused. -->
                        <arg>-Ywarn-unused:locals</arg>
                        <!-- Warn if a value parameter is unused. -->
                        <arg>-Ywarn-unused:params</arg>
                        <!-- Warn if a variable bound in a pattern is unused. -->
                        <arg>-Ywarn-unused:patvars</arg>
                        <!-- Warn if a private member is unused. -->
                        <arg>-Ywarn-unused:privates</arg>
                        <!-- Warn when non-Unit expression results are unused. -->
                        <arg>-Ywarn-value-discard</arg>
                        <!-- Enable paralellisation — change to desired number! -->
                        <arg>-Ybackend-parallelism</arg>
                        <arg>8</arg>
                        <!-- Enables caching of classloaders for compiler plugins -->
                        <arg>-Ycache-plugin-class-loader:last-modified</arg>
                        <!-- and macro definitions. This can lead to performance improvements. -->
                        <arg>-Ycache-macro-class-loader:last-modified</arg>
                    </args>
                    <excludes>
                        <exclude>**/*.java</exclude>
                    </excludes>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-antrun-plugin</artifactId>
            </plugin>
        </plugins>
    </build>
</project>
