From 10242e9de75a297d13b7d52d12b385a2b864da70 Mon Sep 17 00:00:00 2001 From: AGustafson Date: Mon, 9 Dec 2024 10:52:23 +1100 Subject: [PATCH] Update .editorconfig to format *.gradle.kts files; reformat build.gradle.kts --- .editorconfig | 2 +- README.md | 1 + build.gradle.kts | 186 +++++++++++++++++++++++------------------------ 3 files changed, 95 insertions(+), 94 deletions(-) diff --git a/.editorconfig b/.editorconfig index 64a14b2..9e38987 100644 --- a/.editorconfig +++ b/.editorconfig @@ -275,7 +275,7 @@ ij_properties_keep_blank_lines = false ij_properties_key_value_delimiter = equals ij_properties_spaces_around_key_value_delimiter = false -[{*.gson,*.gradle,*.groovy,*.gant,*.gdsl,*.gy,*.gs}] +[{*.gson,*.gradle,*.gradle.kts,*.groovy,*.gant,*.gdsl,*.gy,*.gs}] indent_style = tab tab_width = 4 max_line_length = 140 diff --git a/README.md b/README.md index 2d7bf29..252537d 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,7 @@ with jqwik. Maven: ```xml + net.jqwik jqwik-mockito diff --git a/build.gradle.kts b/build.gradle.kts index c76f768..b91e20f 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,11 +1,11 @@ plugins { - id("java-library") - id("maven-publish") - id("signing") + id("java-library") + id("maven-publish") + id("signing") } fun isSnapshotRelease(versionString: String): Boolean { - return versionString.endsWith("SNAPSHOT") + return versionString.endsWith("SNAPSHOT") } val githubProjectName = "jqwik-team" @@ -25,119 +25,119 @@ version = jqwikMockitoVersion description = "Jqwik Mockito support module" repositories { - mavenCentral() - maven(url = "https://s01.oss.sonatype.org/content/repositories/snapshots") + mavenCentral() + maven(url = "https://s01.oss.sonatype.org/content/repositories/snapshots") } tasks.jar { - archiveBaseName.set(artifactId) - archiveVersion.set(jqwikMockitoVersion) - manifest { - attributes("Automatic-Module-Name" to "net.jqwik.mockito") - } + archiveBaseName.set(artifactId) + archiveVersion.set(jqwikMockitoVersion) + manifest { + attributes("Automatic-Module-Name" to "net.jqwik.mockito") + } } java { - withJavadocJar() - withSourcesJar() - toolchain { - languageVersion = JavaLanguageVersion.of(8) - } + withJavadocJar() + withSourcesJar() + toolchain { + languageVersion = JavaLanguageVersion.of(8) + } } tasks.compileTestJava { - options.compilerArgs.add("-parameters") - options.encoding = "UTF-8" + options.compilerArgs.add("-parameters") + options.encoding = "UTF-8" } tasks.test { - useJUnitPlatform { - includeEngines("jqwik") - } + useJUnitPlatform { + includeEngines("jqwik") + } } dependencies { - api("org.opentest4j:opentest4j:${opentest4jVersion}") - api("net.jqwik:jqwik:${jqwikVersion}") - compileOnly("org.mockito:mockito-core:${mockitoVersion}") - compileOnly("org.mockito:mockito-junit-jupiter:${mockitoVersion}") + api("org.opentest4j:opentest4j:${opentest4jVersion}") + api("net.jqwik:jqwik:${jqwikVersion}") + compileOnly("org.mockito:mockito-core:${mockitoVersion}") + compileOnly("org.mockito:mockito-junit-jupiter:${mockitoVersion}") - testCompileOnly("org.projectlombok:lombok:${lombokVersion}") - testAnnotationProcessor("org.projectlombok:lombok:${lombokVersion}") + testCompileOnly("org.projectlombok:lombok:${lombokVersion}") + testAnnotationProcessor("org.projectlombok:lombok:${lombokVersion}") - testImplementation("org.junit.jupiter:junit-jupiter:${junitJupiterVersion}") - testImplementation("org.assertj:assertj-core:${assertJVersion}") - testImplementation("org.mockito:mockito-junit-jupiter:${mockitoVersion}") + testImplementation("org.junit.jupiter:junit-jupiter:${junitJupiterVersion}") + testImplementation("org.assertj:assertj-core:${assertJVersion}") + testImplementation("org.mockito:mockito-junit-jupiter:${mockitoVersion}") } publishing { - repositories { - maven { - // hint: credentials are in ~/.gradle/gradle.properties - // Since June 2024 Sonatype seems to require a token for publishing - val repoUsername: String = project.findProperty("tokenUsername") as? String ?: "" - val repoPassword: String = project.findProperty("tokenPassword") as? String ?: "" - - credentials { - username = repoUsername - password = repoPassword - } - - val releasesRepoUrl = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/" - val snapshotsRepoUrl = "https://s01.oss.sonatype.org/content/repositories/snapshots/" - url = uri( - if (isSnapshotRelease) { - snapshotsRepoUrl - } else { - releasesRepoUrl - } - ) - } - } - publications { - create("jqwikMockito") { - groupId = moduleGroupId - artifactId = artifactId - from(components["java"]) - pom { - groupId = moduleGroupId - name = artifactId - description = "Jqwik Mockito support module" - url = "https://github.org/$githubProjectName/$artifactId" - licenses { - license { - name = "Eclipse Public License - v 2.0" - url = "http://www.eclipse.org/legal/epl-v20.html" - } - } - developers { - developer { - id = "agustafson-atl" - name = "Andrew Gustafson" - email = "agustafson@atlassian.com" - } - developer { - id = githubProjectName - name = "Johannes Link" - email = "business@johanneslink.net" - } - } - scm { - connection = "scm:git:git://github.com/$githubProjectName/$artifactId.git" - developerConnection = "scm:git:git://github.com/$githubProjectName/$artifactId.git" - url = "https://github.com/$githubProjectName/$artifactId" - } - } - } - } + repositories { + maven { + // hint: credentials are in ~/.gradle/gradle.properties + // Since June 2024 Sonatype seems to require a token for publishing + val repoUsername: String = project.findProperty("tokenUsername") as? String ?: "" + val repoPassword: String = project.findProperty("tokenPassword") as? String ?: "" + + credentials { + username = repoUsername + password = repoPassword + } + + val releasesRepoUrl = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/" + val snapshotsRepoUrl = "https://s01.oss.sonatype.org/content/repositories/snapshots/" + url = uri( + if (isSnapshotRelease) { + snapshotsRepoUrl + } else { + releasesRepoUrl + } + ) + } + } + publications { + create("jqwikMockito") { + groupId = moduleGroupId + artifactId = artifactId + from(components["java"]) + pom { + groupId = moduleGroupId + name = artifactId + description = "Jqwik Mockito support module" + url = "https://github.org/$githubProjectName/$artifactId" + licenses { + license { + name = "Eclipse Public License - v 2.0" + url = "http://www.eclipse.org/legal/epl-v20.html" + } + } + developers { + developer { + id = "agustafson-atl" + name = "Andrew Gustafson" + email = "agustafson@atlassian.com" + } + developer { + id = githubProjectName + name = "Johannes Link" + email = "business@johanneslink.net" + } + } + scm { + connection = "scm:git:git://github.com/$githubProjectName/$artifactId.git" + developerConnection = "scm:git:git://github.com/$githubProjectName/$artifactId.git" + url = "https://github.com/$githubProjectName/$artifactId" + } + } + } + } } signing { - if (!isSnapshotRelease) { - sign(publishing.publications["jqwikMockito"]) - } + if (!isSnapshotRelease) { + sign(publishing.publications["jqwikMockito"]) + } } tasks.wrapper { - gradleVersion = "8.11.1" // upgrade with: ./gradlew wrapper + gradleVersion = "8.11.1" // upgrade with: ./gradlew wrapper }