plugins {
  id 'com.diffplug.blowdryer'
  id 'com.diffplug.spotless-changelog'
}
repositories {
  mavenCentral()
}
spotlessChangelog {
  tagPrefix 'jvm/'
  commitMessage 'Published jvm/{{version}}'
  tagMessage "{{changes}}"
  runAfterPush "gh release create jvm/{{version}} --title 'jvm v{{version}}' --notes-from-tag"
}
group = 干.proj('maven_group', 'the maven group, recommend com.diffplug')
apply from: rootProject.file('gradle/spotless.gradle')
apply from: 干.file('base/changelog.gradle')
apply from: 干.file('base/sonatype.gradle')

// ./gradlew :dokkatooGeneratePublicationHtml
//     https://github.com/Kotlin/dokka/issues/3131
// if IntelliJ is running, then you'll also get a localhost server link
def HAS_DOCS = [
  'selfie-lib',
  'selfie-runner-junit5',
  'selfie-runner-kotest'
]
subprojects {
  if (name in HAS_DOCS) {
    apply from: rootProject.file("gradle/dokka/dokkatoo.gradle")
  }
}
apply from: rootProject.file("gradle/dokka/dokkatoo.gradle")
dependencies {
  // aggregate both subproject-hello and subproject-world
  // the subprojects must also have Dokkatoo applied
  for (p in HAS_DOCS) {
    dokkatoo(project(":${p}"))
  }

  // This is required at the moment, see https://github.com/adamko-dev/dokkatoo/issues/14
  dokkatooPluginHtml(
      dokkatoo.versions.jetbrainsDokka.map { dokkaVersion ->
        "org.jetbrains.dokka:all-modules-page-plugin:$dokkaVersion"
      }
      )
}
