Skip to content

Commit

Permalink
Update .editorconfig to format *.gradle.kts files; reformat build.gra…
Browse files Browse the repository at this point in the history
…dle.kts
  • Loading branch information
agustafson-atl committed Dec 8, 2024
1 parent 666fecc commit 10242e9
Show file tree
Hide file tree
Showing 3 changed files with 95 additions and 94 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ with jqwik.
Maven:

```xml

<dependency>
<group>net.jqwik</group>
<artifactId>jqwik-mockito</artifactId>
Expand Down
186 changes: 93 additions & 93 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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<MavenPublication>("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 = "[email protected]"
}
developer {
id = githubProjectName
name = "Johannes Link"
email = "[email protected]"
}
}
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<MavenPublication>("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 = "[email protected]"
}
developer {
id = githubProjectName
name = "Johannes Link"
email = "[email protected]"
}
}
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
}

0 comments on commit 10242e9

Please sign in to comment.