plugins {
    id 'java-gradle-plugin'
    id("io.gitlab.arturbosch.detekt").version("$detekt_version")
}

apply plugin: 'kotlin'
apply from: "$rootDir/dependencies.gradle"
apply plugin: 'com.novoda.bintray-release'

publish {
    userOrg = 'fourlastor'
    groupId = 'com.fourlastor'
    artifactId = 'pickle-plugin'
    publishVersion = "$pickle_version"
    desc = 'Cucumber implementation via code generation (plugin)'
    website = 'https://github.com/fourlastor/pickle'
}

detekt {
    toolVersion = "$detekt_version"
    config = rootProject.files('config/detekt/detekt.yml')
}

repositories {
    google()
    mavenCentral()
}

configurations {
    includeInJar
}

gradlePlugin {
    plugins {
        pickle {
            id = 'com.fourlastor.pickle'
            implementationClass = 'com.fourlastor.pickle.PicklePlugin'
        }
    }
}

dependencies {
    implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
    implementation 'com.squareup:javapoet:1.11.1'
    implementation "com.android.tools.build:gradle:$agp_version"
    implementation project(':pickle-lib')
    includeInJar project(':pickle-lib')
}

jar {
    from configurations.includeInJar.collect { it.isDirectory() ? it : zipTree(it) }
}
