Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KON-46 Configure Dokka As Local Gradle Plugin #123

Merged
merged 8 commits into from
May 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ dependencies {
implementation(plugin(libs.plugins.spotless))
implementation(plugin(libs.plugins.testLogger))
implementation(plugin(libs.plugins.detekt))
implementation(plugin(libs.plugins.dokka))
}

kotlin {
Expand Down
1 change: 1 addition & 0 deletions buildSrc/src/main/kotlin/local.base.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ plugins {
id("local.spotless")
id("local.test")
id("local.javalibrary")
id("local.dokka")
}

repositories {
Expand Down
3 changes: 3 additions & 0 deletions buildSrc/src/main/kotlin/local.dokka.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
plugins {
id("org.jetbrains.dokka")
}
2 changes: 0 additions & 2 deletions buildSrc/src/main/kotlin/local.publish.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,6 @@ publishing {
setCredentialsFromGradleProperties()
}
}

println("Repository Url $url")
}
}
}
Expand Down
11 changes: 2 additions & 9 deletions buildSrc/src/main/kotlin/util/Properties.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,8 @@ import java.io.FileInputStream
import java.io.InputStreamReader
import java.util.*

fun Project.getLocalPropertyOrGradleProperty(propertyName: String): String? {
val property = gradleLocalProperty(propertyName) ?: getProjectProperty(propertyName)

if (property == null) {
logger.warn("Property $propertyName not found.")
}

return property
}
fun Project.getLocalPropertyOrGradleProperty(propertyName: String) =
gradleLocalProperty(propertyName) ?: getProjectProperty(propertyName)

private fun Project.getProjectProperty(propertyName: String): String? = properties[propertyName] as String?

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
org.gradle.jvmargs=-Xms512M -Xmx4g -Dkotlin.daemon.jvm.options="-Xmx1g"
org.gradle.jvmargs=-Xms512M -Xmx12g -Dkotlin.daemon.jvm.options="-Xmx1g"
konsist.version=0.7.8
1 change: 1 addition & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ kotlin-compiler = { module = "org.jetbrains.kotlin:kotlin-compiler", version.ref
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlinVersion" }
kotlin-plugin-spring = { id = "org.jetbrains.kotlin.plugin.spring", version.ref = "kotlinVersion" }
kotlin-plugin-jpa = { id = "org.jetbrains.kotlin.plugin.jpa", version.ref = "kotlinVersion" }
dokka = "org.jetbrains.dokka:1.8.10"
spotless = "com.diffplug.spotless:6.18.0"
testLogger = "com.adarshr.test-logger:3.2.0"
detekt = "io.gitlab.arturbosch.detekt:1.22.0"
1 change: 0 additions & 1 deletion lib/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
id("local.base")
id("local.publish")
id("org.jetbrains.dokka") version "1.8.10"
}

dependencies {
Expand Down

This file was deleted.

4 changes: 4 additions & 0 deletions misc/DeveloperReadme.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@
artefact will be transferred to [maven central](https://central.sonatype.com/artifact/com.lemonappdev/konsist)
repository after some time.

## Generate KDocs

- `./gradlew dokkaHtml` - generate KDocs in `./lib/build/dokka/html/index.html`

## Layers

Below is a diagram of the layers of the `konsist` library:
Expand Down