dependencies {
    api project(':rest')
    api project(':gateway')
    api project(':voice')

    api "com.discord4j:stores-jdk:$storesVersion"

    compileOnly "$immutables_group:value:$immutables_version"
    compileOnly "$immutables_group:builder:$immutables_version"
    annotationProcessor "$immutables_group:value:$immutables_version"

    compileOnly "com.discord4j:discord-json-encoding:$discordJsonVersion"

    testImplementation "org.junit.jupiter:junit-jupiter-engine:$junit_version"
    testImplementation "org.mockito:mockito-core:$mockito_version"
    testImplementation "ch.qos.logback:logback-classic:$logback_version"
    testImplementation "io.projectreactor:reactor-test"
    testImplementation "org.reflections:reflections:$reflections_version"
    testImplementation "com.github.walkyst:lavaplayer-fork:$lavaplayer_version"
}

javadoc {
    dependsOn project(':rest').javadoc
    dependsOn project(':gateway').javadoc
    dependsOn project(':voice').javadoc

    options.linksOffline rootProject.buildDocsUrl('discord4j-common'), project(':common').javadoc.destinationDir.toURI() as String
    options.linksOffline rootProject.buildDocsUrl('discord4j-rest'), project(':rest').javadoc.destinationDir.toURI() as String
    options.linksOffline rootProject.buildDocsUrl('discord4j-gateway'), project(':gateway').javadoc.destinationDir.toURI() as String
    options.linksOffline rootProject.buildDocsUrl('discord4j-voice'), project(':voice').javadoc.destinationDir.toURI() as String
}

jar {
    manifest {
        attributes 'Implementation-Title': base.archivesName.get(),
                'Implementation-Version': archiveVersion,
                'Automatic-Module-Name': 'discord4j.core'
    }
}

sourcesJar {
    dependsOn project(':core').compileJava
    from "build/generated/sources/annotationProcessor/java/main"
}
