Skip to content

Commit

Permalink
Merge branch 'main' into infra/kotest
Browse files Browse the repository at this point in the history
  • Loading branch information
petertrr authored Nov 30, 2022
2 parents efea10c + 09feb36 commit 973a2b1
Show file tree
Hide file tree
Showing 14 changed files with 53 additions and 33 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2021 Andrey Kuleshov
Copyright (c) 2022 SaveOurTool

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 2 additions & 2 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ dependencies {
// workaround https://github.com/gradle/gradle/issues/15383
implementation(files(project.libs.javaClass.superclass.protectionDomain.codeSource.location))
implementation(libs.diktat.gradle.plugin)
implementation("io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.21.0")
implementation("io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.22.0")
implementation(libs.kotlin.gradle.plugin)
implementation(libs.kotlin.plugin.serialization)
implementation("io.github.gradle-nexus:publish-plugin:1.1.0")
implementation("org.ajoberstar.reckon:reckon-gradle:0.16.1")
implementation("com.squareup:kotlinpoet:1.12.0")
implementation("com.google.code.gson:gson:2.9.1")
implementation("com.google.code.gson:gson:2.10")
}
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ kotlin {
dependsOn(commonNonJsTest)
dependencies {
implementation(kotlin("test-junit5"))
implementation("org.junit.jupiter:junit-jupiter-engine:5.9.0")
implementation("org.junit.jupiter:junit-jupiter-engine:5.9.1")
}
}
val nativeMain by creating {
Expand Down
3 changes: 3 additions & 0 deletions examples/kotlin-diktat/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/ktlint
/save-reports/save.out.json
/save.exe
14 changes: 8 additions & 6 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
[versions]
kotlin = "1.7.10"
kotlin = "1.7.21"
okio = "3.2.0"
serialization = "1.4.0"
diktat = "1.2.3"
serialization = "1.4.1"
diktat = "1.2.4.1"
kotlinx-cli = "0.3.5"
kotlinx-datetime = "0.4.0"
kotlinx-coroutines = "1.6.3-native-mt"
junit = "5.9.0"
ktoml = "0.2.13"
junit = "5.9.1"
ktoml = "0.3.0"
multiplatform-diff = "0.4.0"
kotlinpoet = "1.12.0"
kotest = "5.3.0"
sarif4k = "0.3.0"

[plugins]
kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
Expand All @@ -34,4 +35,5 @@ ktoml-file = { module = "com.akuleshov7:ktoml-file", version.ref = "ktoml" }
multiplatform-diff = { module = "io.github.petertrr:kotlin-multiplatform-diff", version.ref = "multiplatform-diff" }
square-kotlinpoet = { module = "com.squareup:kotlinpoet", version.ref = "kotlinpoet" }
diktat-gradle-plugin = { module = "org.cqfn.diktat:diktat-gradle-plugin", version.ref = "diktat" }
kotest-assertions-core = { module = "io.kotest:kotest-assertions-core", version.ref = "kotest" }
sarif4k = { module = "io.github.detekt.sarif4k:sarif4k", version.ref = "sarif4k" }
kotest-assertions-core = { module = "io.kotest:kotest-assertions-core", version.ref = "kotest" }
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
5 changes: 3 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionSha256Sum=f6b8596b10cce501591e92f229816aa4046424f3b24d771751b06779d58c8ec4
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
distributionSha256Sum=7ba68c54029790ab444b39d7e293d3236b2632631fb5f2e012bb28b4ff669e4b
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
12 changes: 8 additions & 4 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
Expand All @@ -80,10 +80,10 @@ do
esac
done

APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

APP_NAME="Gradle"
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
Expand Down Expand Up @@ -143,12 +143,16 @@ fi
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down
1 change: 1 addition & 0 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ if "%OS%"=="Windows_NT" setlocal

set DIRNAME=%~dp0
if "%DIRNAME%"=="" set DIRNAME=.
@rem This is normally unused
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

Expand Down
12 changes: 11 additions & 1 deletion renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
"*"
],
"excludePackagePatterns": [
"^org\\.jetbrains\\.kotlin[.:]"
"^org\\.jetbrains\\.kotlin[.:]",
"^org\\.cqfn\\.diktat\\:diktat-gradle-plugin"
],
"matchUpdateTypes": [
"minor",
Expand All @@ -24,6 +25,15 @@
"groupName": "all non-major dependencies (except core Kotlin)",
"groupSlug": "all-minor-patch"
},
{
"managers": ["gradle"],
"matchPackagePatterns": [
"^org\\.cqfn\\.diktat\\:diktat-gradle-plugin"
],
"allowedVersions": "!/1\\.2\\.4\\.2/",
"groupName": "all non-major dependencies (except core Kotlin)",
"groupSlug": "all-minor-patch"
},
{
"managers": ["gradle"],
"matchPackagePatterns": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import com.saveourtool.save.plugins.fix.FixPlugin
import com.saveourtool.save.reporter.Report
import com.saveourtool.save.reporter.json.JsonReporter

import okio.FileNotFoundException
import okio.FileSystem
import okio.Path
import okio.Path.Companion.toPath
Expand Down Expand Up @@ -96,7 +97,17 @@ class GeneralTest {
val saveBinName = if (isCurrentOsWindows()) "save.exe" else "save"
val destination = workingDir.toPath() / saveBinName
// Copy latest version of save into examples
fs.copy(actualSaveBinary, destination)
try {
fs.copy(actualSaveBinary, destination)
} catch (fnfe: FileNotFoundException) {
/*
* Ignore a potential FNFE on Windows (the destination .exe file may
* get locked by an external process).
*/
if (!isCurrentOsWindows()) {
throw fnfe
}
}
assertTrue(fs.exists(destination))

// Check for existence of diktat and ktlint
Expand Down
2 changes: 1 addition & 1 deletion save-core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import java.nio.file.StandardCopyOption

plugins {
id("com.saveourtool.save.buildutils.kotlin-library")
id("de.undercouch.download")
id("de.undercouch.download") version "5.3.0"
}

kotlin {
Expand Down
4 changes: 2 additions & 2 deletions save-plugins/warn-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ kotlin {
val commonMain by getting {
dependencies {
implementation(projects.saveCommon)
implementation(libs.kotlinx.serialization.core)
implementation("io.github.detekt.sarif4k:sarif4k:0.1.0-SNAPSHOT")
implementation(libs.kotlinx.serialization.json)
implementation(libs.sarif4k)
}
}
}
Expand Down
12 changes: 0 additions & 12 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,6 @@ include("save-common-test")
dependencyResolutionManagement {
repositories {
mavenCentral()
maven {
url = uri("https://maven.pkg.github.com/saveourtool/sarif4k")
val gprUser: String? by settings
val gprKey: String? by settings
credentials {
username = gprUser
password = gprKey
}
content {
includeGroup("io.github.detekt.sarif4k")
}
}
}
}
enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")

0 comments on commit 973a2b1

Please sign in to comment.