Skip to content

Commit

Permalink
Fix docs generation and extract POM configs
Browse files Browse the repository at this point in the history
  • Loading branch information
gouline committed Sep 15, 2024
1 parent d882cb7 commit 89ddf43
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 75 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
- created

permissions:
contents: read
contents: write
pages: write
id-token: write

Expand Down Expand Up @@ -48,7 +48,7 @@ jobs:

- name: Publish to Sonatype
env:
ORG_GRADLE_PROJECT_publishVersion: ${{ github.event.release.tag_name }}
ORG_GRADLE_PROJECT_VERSION_NAME: ${{ github.event.release.tag_name }}
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_KEY }}
Expand Down
16 changes: 5 additions & 11 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import org.jetbrains.dokka.DokkaConfiguration
import org.jetbrains.dokka.gradle.DokkaMultiModuleTask
import org.jetbrains.dokka.gradle.DokkaTaskPartial

plugins {
alias(libs.plugins.dokka)
alias(libs.plugins.kotlin.jvm)
}

allprojects {
Expand All @@ -13,16 +12,11 @@ allprojects {
}

subprojects {
apply(plugin = "org.jetbrains.dokka")
apply(plugin = rootProject.libs.plugins.kotlin.jvm.get().pluginId)
apply(plugin = rootProject.libs.plugins.dokka.get().pluginId)

group = property("publishGroupId").toString()
version = property("publishVersion").toString()

tasks.withType<DokkaTaskPartial>().configureEach {
dokkaSourceSets.configureEach {
includes.from("README.md")
}
}
group = property("GROUP").toString()
version = property("VERSION_NAME").toString()
}

tasks.withType<DokkaMultiModuleTask>().configureEach {
Expand Down
33 changes: 17 additions & 16 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
org.gradle.parallel=true
org.gradle.caching=true

# Project
publishGroupId=net.gouline.kapsule
publishVersion=0.1-SNAPSHOT
publishName=Kapsule
publishDescription=Minimalist dependency injection library for Kotlin
publishUrl=https://github.com/gouline/kapsule
RELEASE_SIGNING_ENABLED=true
SONATYPE_HOST=DEFAULT
SONATYPE_AUTOMATIC_RELEASE=true

# Licence
publishLicenseName=MIT
publishLicenseUrl=https://opensource.org/licenses/MIT
GROUP=net.gouline.kapsule
VERSION_NAME=0.1-SNAPSHOT

# Developer
publishDeveloperId=gouline
publishDeveloperName=Mike Gouline
POM_NAME=Kapsule
POM_DESCRIPTION=Minimalist dependency injection library for Kotlin
POM_URL=https://github.com/gouline/kapsule

# SCM
publishScmConnection=scm:git:git://github.com/gouline/kapsule.git
publishScmDeveloperConnection="scm:git:ssh://github.com/gouline/kapsule.git"
publishScmUrl=https://github.com/gouline/kapsule
POM_LICENSE_NAME=MIT
POM_LICENSE_URL=https://opensource.org/licenses/MIT

POM_SCM_URL=https://github.com/gouline/kapsule
POM_SCM_CONNECTION=scm:git:git://github.com/gouline/kapsule.git
POM_SCM_DEV_CONNECTION=scm:git:ssh://github.com/gouline/kapsule.git

POM_DEVELOPER_ID=gouline
POM_DEVELOPER_NAME=Mike Gouline
35 changes: 0 additions & 35 deletions kapsule-core/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import com.vanniktech.maven.publish.JavadocJar
import com.vanniktech.maven.publish.KotlinJvm
import com.vanniktech.maven.publish.SonatypeHost

plugins {
alias(libs.plugins.kotlin.jvm)
`java-library`
alias(libs.plugins.maven.publish)
}
Expand All @@ -27,37 +25,4 @@ mavenPublishing {
sourcesJar = true,
)
)

publishToMavenCentral(SonatypeHost.DEFAULT)

signAllPublications()

coordinates(
artifactId = name,
groupId = group.toString(),
version = version.toString(),
)

pom {
name.set(property("publishName").toString())
description.set(property("publishDescription").toString())
url.set(property("publishUrl").toString())
licenses {
license {
name.set(property("publishLicenseName").toString())
url.set(property("publishLicenseUrl").toString())
}
}
developers {
developer {
id.set(property("publishDeveloperId").toString())
name.set(property("publishDeveloperName").toString())
}
}
scm {
connection.set(property("publishScmConnection").toString())
developerConnection.set(property("publishScmDeveloperConnection").toString())
url.set(property("publishScmUrl").toString())
}
}
}
11 changes: 0 additions & 11 deletions sample/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
plugins {
alias(libs.plugins.kotlin.jvm)
application
}

repositories {
mavenCentral()
}

dependencies {
implementation(project(":kapsule-core"))

Expand All @@ -19,12 +14,6 @@ application {
mainClass = "net.gouline.kapsule.demo.DemoKt"
}

java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}

tasks.named<Test>("test") {
useJUnitPlatform()
}

0 comments on commit 89ddf43

Please sign in to comment.