buildscript {
    ext {
        KOTLIN_VERSION = "2.1.21"
        KETHEREUM_VERSION = "0.86.0"
    }

    repositories {
        gradlePluginPortal()
    }

    dependencies {
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${KOTLIN_VERSION}"
        classpath 'com.github.ben-manes:gradle-versions-plugin:0.52.0'
    }
}

apply plugin: "kotlin"
apply plugin: "application"
apply plugin: "com.github.ben-manes.versions"

mainClassName = "org.ethereum.lists.tokens.MainKt"

repositories {
    mavenCentral()
    maven { url 'https://jitpack.io' }
}

task onChainCheck(type: JavaExec) {
    mainClass = "org.ethereum.lists.tokens.OnChainCheckKt"
    classpath = sourceSets.main.runtimeClasspath
    if (project.hasProperty("fileToCheck")) {
        args fileToCheck
    }
}

task correctFileNames(type: JavaExec) {
    mainClass = "org.ethereum.lists.tokens.CorrectFileNamesKt"
    classpath = sourceSets.main.runtimeClasspath
}

task correctDecimals(type: JavaExec) {
    mainClass = "org.ethereum.lists.tokens.CorrectDecimalsKt"
    classpath = sourceSets.main.runtimeClasspath
}

task importMEW(type: JavaExec) {
    mainClass = "org.ethereum.lists.tokens.ImportKt"
    classpath = sourceSets.main.runtimeClasspath
    if (project.hasProperty("importPath")) {
        args importPath
    }
}

dependencies {
    implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.10.2"
    implementation "org.jetbrains.kotlin:kotlin-stdlib:${KOTLIN_VERSION}"

    implementation "com.github.komputing.kethereum:erc20:${KETHEREUM_VERSION}"
    implementation "com.github.komputing.kethereum:erc55:${KETHEREUM_VERSION}"
    implementation "com.github.komputing.kethereum:erc1191:${KETHEREUM_VERSION}"
    implementation "com.github.komputing.kethereum:model:${KETHEREUM_VERSION}"
    implementation "com.github.komputing.kethereum:rpc:${KETHEREUM_VERSION}"
    implementation "com.github.komputing.kethereum:crypto_impl_bouncycastle:${KETHEREUM_VERSION}"

    implementation "com.github.ethereum-lists.chains:httpsloader:1.6"
    implementation "com.github.ethereum-lists.chains:model:1.6"
    implementation "com.squareup.okhttp3:okhttp:4.12.0"

    implementation 'com.beust:klaxon:5.6'
    implementation 'com.squareup.moshi:moshi-kotlin:1.15.2'

    testImplementation "org.jetbrains.kotlin:kotlin-test"
    testImplementation "org.jetbrains.kotlin:kotlin-test-junit"
}