apply plugin: 'java-library'
apply plugin: 'kotlin'
apply plugin: 'maven-publish'

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])

    implementation 'com.squareup:kotlinpoet:1.4.0'
    implementation 'com.google.auto.service:auto-service:1.0-rc6'
    annotationProcessor 'com.google.auto.service:auto-service:1.0-rc6'
    implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
    implementation 'com.google.code.gson:gson:2.8.5'

    implementation deps.ktnail.x

    implementation deps.kotlin.blueprint

    compileOnly project(':rubik:rubik_annotations')
}

sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8

tasks.withType(JavaCompile) {
    options.encoding = "UTF-8"
}

compileKotlin {
    kotlinOptions.freeCompilerArgs += ['-module-name', "kmd.mars.rubik.kapt"]
}

tasks.withType(GenerateModuleMetadata) {
    enabled = false
}

publishing {
    publications {
        rubikKapt(MavenPublication) {
            groupId "com.rubik"
            artifactId 'kapt'
            version pubs.rubik.kapt
            description 'kapt'
            from components.java
        }
    }

    apply from: '../rubik_maven_repositories.gradle'
    addRubikMavenRepos(repositories)
}
