diff options
| author | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2022-10-06 15:34:19 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-10-06 15:34:19 +0200 |
| commit | 7ba3b953300c46b4e3afcde17cd3dd14b1af8406 (patch) | |
| tree | 950ba678869ec868c26ab3b95b57e4cabadb23c7 /buildSrc/src | |
| parent | c2047d09b27b0c05f5c203509dde524e17d3b729 (diff) | |
| parent | 47357afd16f928260db34d4dd3e686fb9ee7c5ff (diff) | |
merge: Update build and runtime dependencies (#107)
This pull request updates the build and runtime dependencies used by OpenDC to their latest
version compatible with the project.
## Implementation Notes :hammer_and_pick:
* Update simulator dependency versions
* Remove unused distribution conventions
* Update next version to 3.0
* Eliminate use of wildcard imports
* Switch to Spotless for formatting
Diffstat (limited to 'buildSrc/src')
| -rw-r--r-- | buildSrc/src/main/kotlin/java-conventions.gradle.kts | 1 | ||||
| -rw-r--r-- | buildSrc/src/main/kotlin/kotlin-conventions.gradle.kts | 2 | ||||
| -rw-r--r-- | buildSrc/src/main/kotlin/license.kt | 22 | ||||
| -rw-r--r-- | buildSrc/src/main/kotlin/quarkus-conventions.gradle.kts | 10 | ||||
| -rw-r--r-- | buildSrc/src/main/kotlin/spotless-conventions.gradle.kts (renamed from buildSrc/src/main/kotlin/distribution-conventions.gradle.kts) | 50 |
5 files changed, 53 insertions, 32 deletions
diff --git a/buildSrc/src/main/kotlin/java-conventions.gradle.kts b/buildSrc/src/main/kotlin/java-conventions.gradle.kts index d4cc667a..a639a9e1 100644 --- a/buildSrc/src/main/kotlin/java-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/java-conventions.gradle.kts @@ -22,6 +22,7 @@ plugins { `java-library` + id("spotless-conventions") } /* Project configuration */ diff --git a/buildSrc/src/main/kotlin/kotlin-conventions.gradle.kts b/buildSrc/src/main/kotlin/kotlin-conventions.gradle.kts index 6b9109f7..5ccc06a4 100644 --- a/buildSrc/src/main/kotlin/kotlin-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/kotlin-conventions.gradle.kts @@ -25,7 +25,7 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile plugins { id("java-conventions") kotlin("jvm") - id("org.jlleitschuh.gradle.ktlint") + id("spotless-conventions") } /* Project configuration */ diff --git a/buildSrc/src/main/kotlin/license.kt b/buildSrc/src/main/kotlin/license.kt new file mode 100644 index 00000000..4e90fd4e --- /dev/null +++ b/buildSrc/src/main/kotlin/license.kt @@ -0,0 +1,22 @@ +/* + * Copyright (c) $YEAR AtLarge Research + * + * 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. + */ + diff --git a/buildSrc/src/main/kotlin/quarkus-conventions.gradle.kts b/buildSrc/src/main/kotlin/quarkus-conventions.gradle.kts index 75c4a454..f1adb182 100644 --- a/buildSrc/src/main/kotlin/quarkus-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/quarkus-conventions.gradle.kts @@ -76,13 +76,3 @@ configurations.create("coverageDataElementsForQuarkus") { } } } - -/* Fix for Quarkus/ktlint-gradle incompatibilities */ -tasks.named("runKtlintCheckOverMainSourceSet") { - mustRunAfter(tasks.quarkusGenerateCode) - mustRunAfter(tasks.quarkusGenerateCodeDev) -} - -tasks.named("runKtlintCheckOverTestSourceSet") { - mustRunAfter(tasks.quarkusGenerateCodeTests) -} diff --git a/buildSrc/src/main/kotlin/distribution-conventions.gradle.kts b/buildSrc/src/main/kotlin/spotless-conventions.gradle.kts index ebbe46ee..11131cc8 100644 --- a/buildSrc/src/main/kotlin/distribution-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/spotless-conventions.gradle.kts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 AtLarge Research + * Copyright (c) 2022 AtLarge Research * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -20,32 +20,40 @@ * SOFTWARE. */ -import org.gradle.api.distribution.DistributionContainer - - plugins { - distribution + id("com.diffplug.spotless") } -tasks.named("assembleDist") { - val tasks = getTasksByName("assembleDist", true).filter { it.project != project } - dependsOn(tasks) -} +spotless { + pluginManager.withPlugin("java") { + java { + importOrder() + removeUnusedImports() + + palantirJavaFormat() + + trimTrailingWhitespace() + endWithNewline() -distributions { - main { - contents { - duplicatesStrategy = DuplicatesStrategy.EXCLUDE + licenseHeaderFile(rootProject.file("buildSrc/src/main/kotlin/license.kt")) + } + } - from("README.md") - from("LICENSE.txt") - from("docs") { into("docs") } + pluginManager.withPlugin("org.jetbrains.kotlin.jvm") { + kotlin { + ktlint() + .setUseExperimental(false) + trimTrailingWhitespace() + endWithNewline() - // Include distributions of the subprojects - getTasksByName("assembleDist", true) - .filter { it.project != project } - .map { it.project.the<DistributionContainer>() } - .forEach { dist -> dist.findByName("main")?.let { with(it.contents) } } + licenseHeaderFile(rootProject.file("buildSrc/src/main/kotlin/license.kt")) } } + + kotlinGradle { + ktlint() + + trimTrailingWhitespace() + endWithNewline() + } } |
