Skip to content

Commit

Permalink
Fix docs for multiple projects
Browse files Browse the repository at this point in the history
  • Loading branch information
mani1232 committed Oct 24, 2024
1 parent c7a1f55 commit 9a10bdc
Show file tree
Hide file tree
Showing 6 changed files with 90 additions and 54 deletions.
7 changes: 1 addition & 6 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,14 @@ plugins {
alias(libs.plugins.kotlinMultiplatform) apply false
alias(libs.plugins.kotlinJvm) apply false
alias(libs.plugins.kotlinSerialization) apply false
alias(libs.plugins.dokka) apply true
alias(libs.plugins.dokka) apply false
}

allprojects {
group = "cc.worldmandia"
version = libraryVersion
}

dependencies {
dokka(project(":kpaypal-api:kpaypal-core"))
dokka(project(":kpaypal-api:kpaypal-webhook"))
}

private fun Project.git(vararg command: String): String {
val output = ByteArrayOutputStream()
exec {
Expand Down
45 changes: 45 additions & 0 deletions kpaypal-api/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import java.lang.System.getenv

plugins {
alias(libs.plugins.dokka)
}

dependencies {
dokka(project(":kpaypal-api:kpaypal-core"))
dokka(project(":kpaypal-api:kpaypal-webhook"))
}

subprojects {
apply(plugin = "org.jetbrains.dokka")
}

dokka {
moduleName.set("KPayPal")
dokkaSourceSets.all {
includes.from("docs/INFO.md")
sourceLink {
localDirectory.set(file("src/main/kotlin"))
remoteUrl("https://kpaypal.worldmandia.cc")
remoteLineSuffix.set("#L")
}
}
pluginsConfiguration.html {
footerMessage.set("(c) WorldMandia")
}
}

repositories {
maven {
name = "WorldMandia"
url = if (version.toString()
.endsWith("SNAPSHOT")
) uri("https://repo.worldmandia.cc/snapshots") else uri("https://repo.worldmandia.cc/releases")
credentials {
username = getenv("MAVEN_NAME")
password = getenv("MAVEN_SECRET")
}
authentication {
create<BasicAuthentication>("basic")
}
}
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
Module KPayPal-core

### 🚧 This library is under active development 🚧

Module KPayPal-webhook

### 🚧 This library is under active development 🚧
39 changes: 5 additions & 34 deletions kpaypal-api/kpaypal-core/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import java.lang.System.getenv

plugins {
alias(libs.plugins.kotlinMultiplatform)
alias(libs.plugins.kotlinSerialization)
alias(libs.plugins.dokka)
alias(libs.plugins.updateDeps)
`maven-publish`
}
Expand Down Expand Up @@ -47,24 +44,13 @@ kotlin {
}
}

dokka {
moduleName.set("KPayPal-Core")
}

publishing {
repositories {
maven {
name = "WorldMandia"
url = if (version.toString()
.endsWith("SNAPSHOT")
) uri("https://repo.worldmandia.cc/snapshots") else uri("https://repo.worldmandia.cc/releases")
credentials {
username = getenv("MAVEN_NAME")
password = getenv("MAVEN_SECRET")
}
authentication {
create<BasicAuthentication>("basic")
}
}
}
publications {
create<MavenPublication>("kpaypalApi") {
create<MavenPublication>("kpaypalCore") {
from(components["kotlin"])
pom {
name.set("KPayPal-core")
Expand Down Expand Up @@ -96,19 +82,4 @@ publishing {
}
}
}
}

dokka {
moduleName.set("KPayPal-core")
dokkaSourceSets.all {
includes.from("docs/INFO.md")
sourceLink {
localDirectory.set(file("src/main/kotlin"))
remoteUrl("https://kpaypal.worldmandia.cc")
remoteLineSuffix.set("#L")
}
}
pluginsConfiguration.html {
footerMessage.set("(c) WorldMandia")
}
}
3 changes: 0 additions & 3 deletions kpaypal-api/kpaypal-core/docs/INFO.md

This file was deleted.

46 changes: 35 additions & 11 deletions kpaypal-api/kpaypal-webhook/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
plugins {
alias(libs.plugins.kotlinMultiplatform)
alias(libs.plugins.kotlinSerialization)
alias(libs.plugins.dokka)
alias(libs.plugins.updateDeps)
`maven-publish`
}
Expand All @@ -23,16 +22,41 @@ kotlin {
}

dokka {
moduleName.set("KPayPal-webhook")
dokkaSourceSets.all {
includes.from("docs/INFO.md")
sourceLink {
localDirectory.set(file("src/main/kotlin"))
remoteUrl("https://kpaypal.worldmandia.cc")
remoteLineSuffix.set("#L")
moduleName.set("KPayPal-Webhook")
}

publishing {
publications {
create<MavenPublication>("kpaypalWebhook") {
from(components["kotlin"])
pom {
name.set("KPayPal-webhook")
description.set("Idiomatic Kotlin Wrapper for The PayPal API")
url.set("https://github.com/mani1232/KPayPal")

licenses {
license {
name.set("GNU License")
url.set("https://github.com/mani1232/KPayPal/blob/master/HEADER.txt")
}
}

developers {
developer {
id.set("mani1232")
name.set("mani1232")
email.set("[email protected]")
organization.set("WorldMandia")
organizationUrl.set("https://worldmandia.cc")
}
}

scm {
connection.set("scm:git:git://github.com/mani1232/KPayPal.git")
developerConnection.set("scm:git:ssh://github.com/KPayPal.git")
url.set("https://github.com/mani1232/KPayPal")
}
}
}
}
pluginsConfiguration.html {
footerMessage.set("(c) WorldMandia")
}
}

0 comments on commit 9a10bdc

Please sign in to comment.