Skip to content

Commit

Permalink
Upgrade to Gradle 7.2 (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
philipp94831 authored Feb 27, 2024
1 parent 9685e4a commit 7321c18
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 6 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins {
id("com.bakdata.sonar") version "1.1.17"
id("com.bakdata.sonatype") version "1.1.18"
id("org.hildan.github.changelog") version "1.13.1"
id("org.gradle.kotlin.kotlin-dsl") version "1.4.9" apply false
id("org.gradle.kotlin.kotlin-dsl") version "2.1.6" apply false
id("com.gradle.plugin-publish") version "1.2.1" apply false
}

Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9.4-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
6 changes: 3 additions & 3 deletions sonar/src/test/kotlin/com/bakdata/gradle/SonarPluginIT.kt
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ internal class SonarPluginIT {
}
dependencies {
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.3.0")
testCompile("org.junit.jupiter:junit-jupiter-api:5.3.0")
testImplementation("org.junit.jupiter:junit-jupiter-api:5.3.0")
}
tasks.withType<Test> {
useJUnitPlatform()
Expand Down Expand Up @@ -97,7 +97,7 @@ internal class SonarPluginIT {
}
dependencies {
"testRuntimeOnly"("org.junit.jupiter:junit-jupiter-engine:5.3.0")
"testCompile"("org.junit.jupiter:junit-jupiter-api:5.3.0")
"testImplementation"("org.junit.jupiter:junit-jupiter-api:5.3.0")
}
tasks.withType<Test> {
useJUnitPlatform()
Expand Down Expand Up @@ -132,4 +132,4 @@ internal class SonarPluginIT {
.haveExactly(1, taskWithPathAndOutcome(":sonarqube", TaskOutcome.SUCCESS))
}
}
}
}
5 changes: 5 additions & 0 deletions sonatype/src/main/kotlin/com/bakdata/gradle/SonatypePlugin.kt
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ class SonatypePlugin : Plugin<Project> {
username.set(getOverriddenSetting(SonatypeSettings::osshrUsername))
password.set(getOverriddenSetting(SonatypeSettings::osshrPassword))
getOverriddenSetting(SonatypeSettings::nexusUrl)?.let { nexusUrl.set(uri(it)) }
allowInsecureProtocol.set(getOverriddenSetting(SonatypeSettings::allowInsecureProtocol))
}
}
}
Expand Down Expand Up @@ -166,6 +167,10 @@ class SonatypePlugin : Plugin<Project> {
getOverriddenSetting(SonatypeSettings::connectTimeout)?.let {
nexus.connectTimeout.value(Duration.ofSeconds(it))
}

getOverriddenSetting(SonatypeSettings::allowInsecureProtocol)?.let {
nexus.repositories["nexus"].allowInsecureProtocol.value(it)
}
}
}
}
Expand Down
27 changes: 26 additions & 1 deletion sonatype/src/main/kotlin/com/bakdata/gradle/SonatypeSettings.kt
Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
/*
* The MIT License
*
* Copyright (c) 2024 bakdata GmbH
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/

package com.bakdata.gradle

import au.com.console.kassava.kotlinToString
Expand Down Expand Up @@ -29,10 +53,11 @@ open class SonatypeSettings(var project: Project) {
var developers: Action<in MavenPomDeveloperSpec>? = null
var connectTimeout: Long = 300
var clientTimeout: Long = 300
var allowInsecureProtocol: Boolean = false

fun developers(developerSpec: Action<in MavenPomDeveloperSpec>) {
this.developers = developerSpec
}

override fun toString() = kotlinToString(properties = SonatypeSettings::class.memberProperties.toTypedArray())
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ internal class SonatypePluginIT {
}
}
nexusUrl = "${wiremock.baseUrl()}"
allowInsecureProtocol = true
}
""".trimIndent())

Expand Down Expand Up @@ -170,6 +171,7 @@ internal class SonatypePluginIT {
}
}
nexusUrl = "${wiremock.baseUrl()}"
allowInsecureProtocol = true
}
subprojects {
Expand Down

0 comments on commit 7321c18

Please sign in to comment.