diff --git a/auth/build.gradle.kts b/auth/build.gradle.kts index a7b0886eb..e057a71d6 100644 --- a/auth/build.gradle.kts +++ b/auth/build.gradle.kts @@ -10,8 +10,14 @@ dependencies { api(group = "com.fasterxml.jackson.core", name = "jackson-databind") } +tasks.javadoc { + options { + title = "Twitch4J (v${version}) - Auth Module" + windowTitle = "Twitch4J (v${version}) - Auth Module" + } +} + publishing.publications.withType { - artifactId = "twitch4j-auth" pom { name.set("Twitch4J Auth Module") description.set("Authentication dependency") diff --git a/build.gradle.kts b/build.gradle.kts index 9059ead02..4e4908800 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -17,6 +17,41 @@ allprojects { repositories { mavenCentral() } + + tasks { + withType { + options { + this as StandardJavadocDocletOptions + links( + "https://javadoc.io/doc/org.jetbrains/annotations/latest", + "https://javadoc.io/doc/com.github.ben-manes.caffeine/caffeine/2.9.2", + "https://commons.apache.org/proper/commons-configuration/javadocs/v1.10/apidocs", + "https://javadoc.io/doc/com.github.vladimir-bukhtoyarov/bucket4j-core/4.7.0/", + "https://square.github.io/okhttp/4.x/okhttp/", + "https://javadoc.io/doc/com.github.philippheuer.events4j/events4j-core/latest", + "https://javadoc.io/doc/com.github.philippheuer.events4j/events4j-handler-simple/latest", + "https://javadoc.io/doc/com.github.philippheuer.credentialmanager/credentialmanager/latest", + "https://javadoc.io/doc/io.github.openfeign/feign-slf4j/latest", + "https://javadoc.io/doc/io.github.openfeign/feign-okhttp/latest", + "https://javadoc.io/doc/io.github.openfeign/feign-jackson/latest", + "https://javadoc.io/doc/io.github.openfeign/feign-hystrix/latest", + "https://javadoc.io/doc/io.github.openfeign/feign-hystrix/latest", + "https://netflix.github.io/Hystrix/javadoc/", + "https://takahikokawasaki.github.io/nv-websocket-client/", + "https://commons.apache.org/proper/commons-io/apidocs/", + "https://commons.apache.org/proper/commons-lang/apidocs/", + "https://www.javadoc.io/doc/org.slf4j/slf4j-api/1.7.32", + "https://fasterxml.github.io/jackson-databind/javadoc/2.13/", + "https://fasterxml.github.io/jackson-core/javadoc/2.13/", + "https://fasterxml.github.io/jackson-annotations/javadoc/2.13/", + "https://fasterxml.github.io/jackson-modules-java8/javadoc/datetime/2.13/", + "https://projectlombok.org/api/", + "https://twitch4j.github.io/javadoc" + ) + locale = "en" + } + } + } } // Subprojects @@ -28,10 +63,6 @@ subprojects { apply(plugin = "com.coditory.manifest") apply(plugin = "com.github.johnrengelman.shadow") - base { - archivesBaseName = artifactId - } - lombok { version.set("1.18.22") disableConfig.set(true) @@ -113,7 +144,6 @@ subprojects { publications { create("main") { from(components["java"]) - artifactId = project.artifactId pom.default() } } @@ -126,16 +156,6 @@ subprojects { // Source encoding tasks { - // javadoc / html5 support - withType { - // hide javadoc warnings (a lot from delombok) - (options as StandardJavadocDocletOptions).addStringOption("Xdoclint:none", "-quiet") - - if (JavaVersion.current().isJava9Compatible) { - (options as StandardJavadocDocletOptions).addBooleanOption("html5", true) - } - } - // shadowjar & relocation val relocateShadowJar by creating(com.github.jengelman.gradle.plugins.shadow.tasks.ConfigureShadowRelocation::class) { target = shadowJar.get() @@ -163,9 +183,17 @@ subprojects { dependsOn(delombok) source(delombok) options { - title = "${project.artifactId} (v${project.version})" - windowTitle = "${project.artifactId} (v${project.version})" + title = "${project.name} (v${project.version})" + windowTitle = "${project.name} (v${project.version})" encoding = "UTF-8" + overview = file("${rootDir}/buildSrc/overview-single.html").absolutePath + this as StandardJavadocDocletOptions + // hide javadoc warnings (a lot from delombok) + addStringOption("Xdoclint:none", "-quiet") + if (JavaVersion.current().isJava9Compatible) { + // javadoc / html5 support + addBooleanOption("html5", true) + } } } @@ -180,15 +208,44 @@ subprojects { } tasks.register("aggregateJavadoc") { + enabled = JavaVersion.current().isJava9Compatible group = JavaBasePlugin.DOCUMENTATION_GROUP options { title = "${rootProject.name} (v${project.version})" windowTitle = "${rootProject.name} (v${project.version})" encoding = "UTF-8" + this as StandardJavadocDocletOptions + overview = file("${rootDir}/buildSrc/overview-general.html").absolutePath + group("Common", "com.github.twitch4j.common*") + group("Core", "com.github.twitch4j", "com.github.twitch4j.domain*", "com.github.twitch4j.events*", "com.github.twitch4j.modules*") + group("Auth", "com.github.twitch4j.auth*") + group("Chat", "com.github.twitch4j.chat*") + group("EventSub", "com.github.twitch4j.eventsub*") + group("PubSub", "com.github.twitch4j.pubsub*") + group("Helix API", "com.github.twitch4j.helix*") + group("Twitch Message Interface - API", "com.github.twitch4j.tmi*") + group("GraphQL", "com.github.twitch4j.graphql*") + group("Extensions API", "com.github.twitch4j.extensions*") + group("Kraken API v5 (deprecated)", "com.github.twitch4j.kraken*") + addBooleanOption("html5").setValue(true) } - source(subprojects.map { it.tasks.delombok.get() }) - classpath = files(subprojects.map { it.sourceSets["main"].compileClasspath }) + source(subprojects.map { it.tasks.javadoc.get().source }) + classpath = files(subprojects.map { it.tasks.javadoc.get().classpath }) setDestinationDir(file("${rootDir}/docs/static/javadoc")) + + doFirst { + if (destinationDir?.exists() == true) { + destinationDir?.deleteRecursively() + } + } + + doLast { + copy { + from(file("${destinationDir!!}/element-list")) + into(destinationDir!!) + rename { "package-list" } + } + } } diff --git a/buildSrc/overview-general.html b/buildSrc/overview-general.html new file mode 100644 index 000000000..e557f1505 --- /dev/null +++ b/buildSrc/overview-general.html @@ -0,0 +1,10 @@ + + +

Twitch4J Logo

+

Check out our documentation at twitch4j.github.io

+ + + diff --git a/buildSrc/overview-single.html b/buildSrc/overview-single.html new file mode 100644 index 000000000..2ad4a0936 --- /dev/null +++ b/buildSrc/overview-single.html @@ -0,0 +1,11 @@ + + +

Twitch4J Logo

+

Check out our documentation at twitch4j.github.io

+ + + diff --git a/buildSrc/src/main/kotlin/globals.kt b/buildSrc/src/main/kotlin/globals.kt index 0204a1dbe..d0bc1ecc7 100644 --- a/buildSrc/src/main/kotlin/globals.kt +++ b/buildSrc/src/main/kotlin/globals.kt @@ -1,6 +1,4 @@ import org.gradle.api.Project -import org.gradle.api.internal.project.DefaultProject -import org.gradle.util.Path val Project.mavenRepositoryUrl: String get() = System.getenv("MAVEN_REPO_URL") ?: findProperty("maven.repository.url").toString() @@ -11,8 +9,3 @@ val Project.mavenRepositoryUsername: String val Project.mavenRepositoryPassword: String get() = System.getenv("MAVEN_REPO_PASSWORD") ?: findProperty("maven.repository.password").toString() -val Project.artifactId: String - get() = (this as DefaultProject).identityPath.path.replace(Path.SEPARATOR, "-").let { - if (rootProject.name.equals(it.substring(1), true)) rootProject.name - else (rootProject.name + if (it.startsWith("-") && it.length > 1) it else "") - }.toLowerCase() diff --git a/chat/build.gradle.kts b/chat/build.gradle.kts index 19114ac82..278e28b64 100644 --- a/chat/build.gradle.kts +++ b/chat/build.gradle.kts @@ -7,12 +7,18 @@ dependencies { api(group = "com.github.vladimir-bukhtoyarov", name = "bucket4j-core") // Twitch4J Modules - api(project(":common")) - api(project(":auth")) + api(project(":twitch4j-common")) + api(project(":twitch4j-auth")) +} + +tasks.javadoc { + options { + title = "Twitch4J (v${version}) - Chat Module" + windowTitle = "Twitch4J (v${version}) - Chat Module" + } } publishing.publications.withType { - artifactId = "twitch4j-chat" pom { name.set("Twitch4J Chat Module") description.set("Chat dependency") diff --git a/common/build.gradle.kts b/common/build.gradle.kts index ee37e3a97..6140ccbff 100644 --- a/common/build.gradle.kts +++ b/common/build.gradle.kts @@ -20,11 +20,17 @@ dependencies { compileOnly(group = "com.github.vladimir-bukhtoyarov", name = "bucket4j-core") // Twitch4J Modules - api(project(":auth")) + api(project(":twitch4j-auth")) +} + +tasks.javadoc { + options { + title = "Twitch4J (v${version}) - Common Module API" + windowTitle = "Twitch4J (v${version}) - Common Module API" + } } publishing.publications.withType { - artifactId = "twitch4j-common" pom { name.set("Twitch4J API - Common Module") description.set("Common API dependency") diff --git a/eventsub-common/build.gradle.kts b/eventsub-common/build.gradle.kts index 1fa98599d..75ef19993 100644 --- a/eventsub-common/build.gradle.kts +++ b/eventsub-common/build.gradle.kts @@ -8,11 +8,17 @@ dependencies { api(group = "com.github.ben-manes.caffeine", name = "caffeine") // Twitch4J Modules - api(project(":common")) + api(project(":twitch4j-common")) +} + +tasks.javadoc { + options { + title = "Twitch4J (v${version}) - EventSub Common Module API" + windowTitle = "Twitch4J (v${version}) - EventSub Common Module API" + } } publishing.publications.withType { - artifactId = "twitch4j-eventsub-common" pom { name.set("Twitch4J API - EventSub Common Module") description.set("EventSub Common dependency") diff --git a/graphql/build.gradle.kts b/graphql/build.gradle.kts index a3111fca9..97471dc3b 100644 --- a/graphql/build.gradle.kts +++ b/graphql/build.gradle.kts @@ -16,21 +16,29 @@ dependencies { api(group = "com.github.ben-manes.caffeine", name = "caffeine") // Twitch4J Modules - api(project(":common")) - api(project(":auth")) + api(project(":twitch4j-common")) + api(project(":twitch4j-auth")) } -tasks.withType { - dependsOn("generateMainServiceApolloSources") -} +tasks { + withType { + dependsOn("generateMainServiceApolloSources") + } -tasks.withType { - // Ignore auto-generated files from apollo graphql - exclude("com/github/twitch4j/graphql/internal/**") + withType { + // Ignore auto-generated files from apollo graphql + exclude("com/github/twitch4j/graphql/internal/**") + } + + javadoc { + options { + title = "Twitch4J (v${version}) - GraphQL Module" + windowTitle = "Twitch4J (v${version}) - GraphQL Module" + } + } } publishing.publications.withType { - artifactId = "twitch4j-graphql" pom { name.set("Twitch4J GraphQL Module") description.set("GraphQL dependency") diff --git a/pubsub/build.gradle.kts b/pubsub/build.gradle.kts index 3151812af..6a71820a3 100644 --- a/pubsub/build.gradle.kts +++ b/pubsub/build.gradle.kts @@ -13,13 +13,25 @@ dependencies { api(group = "org.jetbrains", name = "annotations") // Twitch4J Modules - api(project(":eventsub-common")) - api(project(":common")) - api(project(":auth")) + api(project(":twitch4j-eventsub-common")) + api(project(":twitch4j-common")) + api(project(":twitch4j-auth")) +} + +base { + archivesName.set("twitch4j-pubsub") +} + +tasks { + javadoc { + options { + title = "${base.archivesName.get()} (v${project.version})" + windowTitle = "${base.archivesName.get()} (v${project.version})" + } + } } publishing.publications.withType { - artifactId = "twitch4j-pubsub" pom { name.set("Twitch4J API - PubSub Module") description.set("PubSub API dependency") diff --git a/rest-extensions/build.gradle.kts b/rest-extensions/build.gradle.kts index 05ff929b8..e8e407a12 100644 --- a/rest-extensions/build.gradle.kts +++ b/rest-extensions/build.gradle.kts @@ -12,11 +12,17 @@ dependencies { api(group = "com.fasterxml.jackson.datatype", name = "jackson-datatype-jsr310") // Twitch4J Modules - api(project(":common")) + api(project(":twitch4j-common")) +} + +tasks.javadoc { + options { + title = "Twitch4J (v${version}) - Extensions Module API" + windowTitle = "Twitch4J (v${version}) - Extensions Module API" + } } publishing.publications.withType { - artifactId = "twitch4j-extensions" pom { name.set("Twitch4J API - Extensions Module") description.set("Extensions API dependency") diff --git a/rest-helix/build.gradle.kts b/rest-helix/build.gradle.kts index 1af088e86..3c70b4068 100644 --- a/rest-helix/build.gradle.kts +++ b/rest-helix/build.gradle.kts @@ -17,13 +17,19 @@ dependencies { api(group = "com.github.ben-manes.caffeine", name = "caffeine") // Twitch4J Modules - api(project(":eventsub-common")) - api(project(":common")) - api(project(":auth")) + api(project(":twitch4j-eventsub-common")) + api(project(":twitch4j-common")) + api(project(":twitch4j-auth")) +} + +tasks.javadoc { + options { + title = "Twitch4J (v${version}) - Helix Module API" + windowTitle = "Twitch4J (v${version}) - Helix Module API" + } } publishing.publications.withType { - artifactId = "twitch4j-helix" pom { name.set("Twitch4J API - Helix Module") description.set("Helix API dependency") diff --git a/rest-helix/src/main/java/com/github/twitch4j/helix/domain/BanUsersList.java b/rest-helix/src/main/java/com/github/twitch4j/helix/domain/BanUsersList.java index 7bfd9b082..e558c6171 100644 --- a/rest-helix/src/main/java/com/github/twitch4j/helix/domain/BanUsersList.java +++ b/rest-helix/src/main/java/com/github/twitch4j/helix/domain/BanUsersList.java @@ -27,7 +27,7 @@ public class BanUsersList { /** * The list of users that weren't banned. - * The string is in the form: : . + * The string is in the form: {@code <user_id>: <error message>}. * The list is empty if all users were successfully banned. */ private List errors; diff --git a/rest-kraken/build.gradle.kts b/rest-kraken/build.gradle.kts index 4d0b792dc..aac6dac6b 100644 --- a/rest-kraken/build.gradle.kts +++ b/rest-kraken/build.gradle.kts @@ -12,12 +12,18 @@ dependencies { api(group = "com.fasterxml.jackson.datatype", name = "jackson-datatype-jsr310") // Twitch4J Modules - api(project(":common")) - api(project(":auth")) + api(project(":twitch4j-common")) + api(project(":twitch4j-auth")) +} + +tasks.javadoc { + options { + title = "Twitch4J (v${version}) - Kraken Module API (deprecated)" + windowTitle = "Twitch4J (v${version}) - Kraken Module API" + } } publishing.publications.withType { - artifactId = "twitch4j-kraken" pom { name.set("Twitch4J API - Kraken Module") description.set("Kraken API dependency") diff --git a/rest-tmi/build.gradle.kts b/rest-tmi/build.gradle.kts index e56d2ef71..53e13a813 100644 --- a/rest-tmi/build.gradle.kts +++ b/rest-tmi/build.gradle.kts @@ -11,12 +11,18 @@ dependencies { api(group = "com.fasterxml.jackson.core", name = "jackson-databind") // Twitch4J Modules - api(project(":common")) - api(project(":auth")) + api(project(":twitch4j-common")) + api(project(":twitch4j-auth")) +} + +tasks.javadoc { + options { + title = "Twitch4J (v${version}) - Message Interface Module API" + windowTitle = "Twitch4J (v${version}) - Message Interface Module API" + } } publishing.publications.withType { - artifactId = "twitch4j-messaginginterface" pom { name.set("Twitch4J API - Message Interface Module") description.set("Twitch Message Interface API dependency") diff --git a/settings.gradle.kts b/settings.gradle.kts index ba4a344cc..fc8325625 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,15 +1,27 @@ -rootProject.name = "twitch4j" +rootProject.name = "Twitch4J" include( - "common", - "auth", - "chat", - "eventsub-common", - "rest-extensions", - "rest-helix", - "rest-kraken", - "rest-tmi", - "pubsub", - "graphql", - "twitch4j" + ":common", + ":auth", + ":chat", + ":eventsub-common", + ":rest-extensions", + ":rest-helix", + ":rest-kraken", + ":rest-tmi", + ":pubsub", + ":graphql", + ":twitch4j" ) + +project(":common").name = "twitch4j-common" +project(":auth").name = "twitch4j-auth" +project(":chat").name = "twitch4j-chat" +project(":eventsub-common").name = "twitch4j-eventsub-common" +project(":rest-extensions").name = "twitch4j-extensions" +project(":rest-helix").name = "twitch4j-helix" +project(":rest-kraken").name = "twitch4j-kraken" +project(":rest-tmi").name = "twitch4j-messaginginterface" +project(":pubsub").name = "twitch4j-pubsub" +project(":graphql").name = "twitch4j-graphql" +project(":twitch4j").name = "twitch4j" diff --git a/twitch4j/build.gradle.kts b/twitch4j/build.gradle.kts index 969e2c061..820adfb2d 100644 --- a/twitch4j/build.gradle.kts +++ b/twitch4j/build.gradle.kts @@ -10,10 +10,20 @@ dependencies { api(group = "com.github.ben-manes.caffeine", name = "caffeine") } +base { + archivesName.set("twitch4j") +} + +tasks.javadoc { + options { + title = "Twitch4J (v${version}) - Root Module API" + windowTitle = "Twitch4J (v${version}) - Root Module API" + } +} + publishing.publications.withType { - artifactId = "twitch4j" pom { - name.set("Twitch4J") + name.set("Twitch4J Root Module") description.set("Core dependency") } }