plugins {
    id 'checkstyle'
}

test {
    // Pass on downloader type to tests for different CI jobs. See DownloaderFactory.java and ci.yml
    if (System.properties.containsKey('downloader')) {
        systemProperty('downloader', System.getProperty('downloader'))
    }
    useJUnitPlatform()
    dependsOn checkstyleMain // run checkstyle when testing
}

checkstyle {
    getConfigDirectory().set(rootProject.file("checkstyle"))
    ignoreFailures false
    showViolations true
    toolVersion checkstyleVersion
}

checkstyleTest {
    enabled false // do not checkstyle test files
}

dependencies {
    implementation project(':timeago-parser')

    implementation "com.github.TeamNewPipe:nanojson:$nanojsonVersion"
    implementation 'org.jsoup:jsoup:1.18.3'
    implementation "com.google.code.findbugs:jsr305:$jsr305Version"

    implementation 'org.mozilla:rhino:1.7.15'

    checkstyle "com.puppycrawl.tools:checkstyle:$checkstyleVersion"

    testImplementation platform("org.junit:junit-bom:$junitVersion")
    testImplementation 'org.junit.jupiter:junit-jupiter-api'
    testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
    testImplementation 'org.junit.jupiter:junit-jupiter-params'

    testImplementation "com.squareup.okhttp3:okhttp:4.12.0"
    testImplementation 'com.google.code.gson:gson:2.12.1'
}
