// Example project to show how to use Atrium in a multiplatform project
// For more information on how to setup Atrium for a multiplatform project -> https://github.com/robstoll/atrium#common

import org.gradle.api.tasks.testing.logging.TestExceptionFormat

buildscript {
    ext {
        // for infix-api -> change to 'atrium-infix-en_GB'
        atrium_api = 'atrium-fluent-en_GB'
        atrium_version = '0.16.0'
        junit_version = '5.7.2'
    }
}

plugins {
    id 'org.jetbrains.kotlin.multiplatform' version '1.5.20'
}

group 'org.atriumlib.samples'
version '0.0.1'

repositories {
    mavenCentral()
}

kotlin {
    jvm()
    js().nodejs{}
    sourceSets {
        commonTest {
            dependencies {
                // setup for Atrium:
                implementation "ch.tutteli.atrium:$atrium_api-common:$atrium_version"

                // setup for common tests:
                implementation kotlin('test-common')
                implementation kotlin('test-annotations-common')
            }
        }
        jvmTest {
            dependencies {
                // setup for Atrium:
                implementation "ch.tutteli.atrium:$atrium_api:$atrium_version"

                // setup for Junit5:
                implementation kotlin('test')
                implementation kotlin('test-junit')
                implementation "org.junit.jupiter:junit-jupiter-api:$junit_version"
            }
        }
        jsTest {
            dependencies {
                // setup for Atrium:
                implementation "ch.tutteli.atrium:$atrium_api-js:$atrium_version"

                // setup for mocha:
                implementation kotlin('test-js')
            }
        }
    }
}

jvmTest {
    testLogging {
        exceptionFormat TestExceptionFormat.FULL
        showExceptions true
        showCauses true
        showStackTraces true
    }
}
