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

Modernization #174

Merged
merged 15 commits into from
Aug 21, 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
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.bat eol=crlf
*.sh eol=lf
71 changes: 34 additions & 37 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,41 +1,36 @@
import org.jetbrains.kotlin.gradle.dsl.KotlinJvmProjectExtension

plugins {
kotlin("jvm") apply false
id("com.gradle.plugin-publish") version "0.21.0" apply false
id("org.jetbrains.dokka") version "1.4.32"
id("com.gradle.plugin-publish") version "1.2.1" apply false
id("org.jetbrains.dokka")
id("org.asciidoctor.jvm.convert") version "3.2.0"
}


allprojects {
repositories {
mavenCentral()
}
}


subprojects {

plugins.withType<JavaGradlePluginPlugin> {
dependencies {
"compileOnly"(kotlin("stdlib-jdk8"))
}

with(the<GradlePluginDevelopmentExtension>()) {
isAutomatedPublishing = true
}
plugins.withType<JavaPlugin> {

with(the<JavaPluginExtension>()) {
configure<JavaPluginExtension> {
withSourcesJar()
withJavadocJar()

sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
}


plugins.withId("org.jetbrains.kotlin.jvm") {

configure<KotlinJvmProjectExtension> {

jvmToolchain(11)

compilerOptions {
freeCompilerArgs.add("-Xjvm-default=all")
}
}


configurations.all {
resolutionStrategy.eachDependency {
if (requested.group == "org.jetbrains.kotlin") {
Expand All @@ -45,19 +40,17 @@ subprojects {
}

dependencies {
"testImplementation"(kotlin("stdlib-jdk8"))
"compileOnly"(kotlin("stdlib"))

"testImplementation"(kotlin("stdlib"))
"testImplementation"(kotlin("reflect"))

"testImplementation"("com.willowtreeapps.assertk:assertk-jvm:0.23")
"testImplementation"("io.mockk:mockk:1.10.0")
"testImplementation"("org.spekframework.spek2:spek-dsl-jvm:2.0.9")
"testRuntimeOnly"("org.spekframework.spek2:spek-runner-junit5:2.0.9")
"testImplementation"(libs.assertk)
"testImplementation"(libs.mockk)
"testImplementation"(libs.spek.dsl)
"testRuntimeOnly"(libs.spek.runner)
}

tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
kotlinOptions.jvmTarget = "1.8"
kotlinOptions.freeCompilerArgs = listOf("-Xjvm-default=enable")
}

tasks.withType<Test> {
// always execute tests
Expand All @@ -83,8 +76,9 @@ subprojects {

plugins.withId("org.jetbrains.dokka") {

val dokkaVersion: String by extra
dependencies {
"dokkaJavadocPlugin"("org.jetbrains.dokka:kotlin-as-java-plugin:1.4.32")
"dokkaJavadocPlugin"("org.jetbrains.dokka:kotlin-as-java-plugin:$dokkaVersion")
}

tasks.withType<Jar>().matching { it.name == "javadocJar" || it.name == "publishPluginJavaDocsJar" }
Expand Down Expand Up @@ -127,16 +121,19 @@ subprojects {
}


plugins.withId("com.gradle.plugin-publish") {
plugins.withType<JavaGradlePluginPlugin>() {

val githubUrl = project.extra["github.url"] as String

with(the<com.gradle.publish.PluginBundleExtension>()) {
@Suppress("UnstableApiUsage")
with(the<GradlePluginDevelopmentExtension>()) {
website.set(githubUrl)
vcsUrl.set(githubUrl)
isAutomatedPublishing = true

website = githubUrl
vcsUrl = githubUrl
description = "A suite of Gradle plugins for building, publishing and managing Helm charts."
tags = listOf("helm")
plugins.all {
tags.add("helm")
}
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ version=1.7.0
test.maxParallelForks=4

github.url=https://github.com/unbroken-dome/gradle-helm-plugin

dokkaVersion=1.8.20
33 changes: 33 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
[versions]

jackson = "2.15.2"
okhttp = "4.10.0"
plugin-utils = "0.5.0"


# Test libraries

spek = "2.0.19"


[libraries]

jackson-databind = { module = "com.fasterxml.jackson.core:jackson-databind", version = "2.15.2" }
jackson-dataformat-yaml = { module = "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml", version = "2.15.2" }
json = { module = "org.json:json", version = "20230618" }
jsonpath = { module = "com.jayway.jsonpath:json-path", version = "2.8.0" }
okhttp-core = { module = "com.squareup.okhttp3:okhttp", version.ref = "okhttp" }
okhttp-tls = { module = "com.squareup.okhttp3:okhttp-tls", version.ref = "okhttp" }
plugin-utils = { module = "org.unbroken-dome.gradle-plugin-utils:gradle-plugin-utils", version.ref = "plugin-utils" }
snakeyaml = { module = "org.yaml:snakeyaml", version = "2.1" }



# Test libraries

assertk = { module = "com.willowtreeapps.assertk:assertk-jvm", version = "0.26.1" }
mockk = { module = "io.mockk:mockk", version = "1.13.7" }
okhttp-mockwebserver = { module = "com.squareup.okhttp3:mockwebserver", version.ref = "okhttp" }
plugin-testutils = { module = "org.unbroken-dome.gradle-plugin-utils:gradle-plugin-test-utils", version.ref = "plugin-utils" }
spek-dsl = { module = "org.spekframework.spek2:spek-dsl-jvm", version.ref = "spek" }
spek-runner = { module = "org.spekframework.spek2:spek-runner-junit5", version.ref = "spek" }
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 2 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-all.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading