apply plugin: 'kotlin'

dependencies {
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:${kotlin_version}"
    implementation 'com.google.code.gson:gson:2.8.8'
    implementation 'com.squareup:javapoet:1.13.0'
    implementation 'com.squareup:kotlinpoet:1.10.1'
    implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.2-native-mt'
    implementation 'junit:junit:4.13.2'
    implementation 'commons-io:commons-io:20030203.000550'
    implementation project(':aspoet-input')

    testImplementation 'junit:junit:4.13.2'
    testImplementation 'org.mockito:mockito-inline:3.7.7'
    testImplementation 'com.nhaarman.mockitokotlin2:mockito-kotlin:2.2.0'
    testImplementation "org.jetbrains.kotlin:kotlin-reflect:${kotlin_version}"
    testImplementation 'com.google.truth:truth:1.1.3'
}

// java -jar aspoet/build/libs/aspoet-all.jar
task fatJar(type: Jar) {
    manifest {
        attributes (
                'Main-Class': 'com.google.androidstudiopoet.AndroidStudioPoet',
        )
    }
    archiveBaseName = project.name + '-all'
    from { configurations.runtimeClasspath.collect { it.directory ? it : zipTree(it) } }
    with jar
    duplicatesStrategy = 'include'
}

task runGenerator(type: JavaExec) {
    mainClass = 'com.google.androidstudiopoet.AndroidStudioPoet'
    classpath = sourceSets.main.runtimeClasspath
}