Skip to content

Commit 8aab2fc

Browse files
committed
Fixed creation of Kover Agent arguments file
Previously parent directory hasn't been creating for an arguments file Fixes #716
1 parent b9f3f1c commit 8aab2fc

File tree

8 files changed

+22
-6
lines changed

8 files changed

+22
-6
lines changed

gradle/wrapper/gradle-wrapper.jar

130 Bytes
Binary file not shown.

gradle/wrapper/gradle-wrapper.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

gradlew

+4-2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
# See the License for the specific language governing permissions and
1616
# limitations under the License.
1717
#
18+
# SPDX-License-Identifier: Apache-2.0
19+
#
1820

1921
##############################################################################
2022
#
@@ -55,7 +57,7 @@
5557
# Darwin, MinGW, and NonStop.
5658
#
5759
# (3) This script is generated from the Groovy template
58-
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
60+
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
5961
# within the Gradle project.
6062
#
6163
# You can find Gradle at https://github.com/gradle/gradle/.
@@ -84,7 +86,7 @@ done
8486
# shellcheck disable=SC2034
8587
APP_BASE_NAME=${0##*/}
8688
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
87-
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
89+
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
8890

8991
# Use the maximum available, or set MAX_FD != -1 to use that value.
9092
MAX_FD=maximum

gradlew.bat

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
@rem See the License for the specific language governing permissions and
1414
@rem limitations under the License.
1515
@rem
16+
@rem SPDX-License-Identifier: Apache-2.0
17+
@rem
1618

1719
@if "%DEBUG%"=="" @echo off
1820
@rem ##########################################################################

kover-gradle-plugin/src/functionalTest/kotlin/kotlinx/kover/gradle/plugin/test/functional/cases/DefaultConfigTests.kt

+11
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,15 @@ internal class DefaultConfigTests {
1919
checkDefaultReports()
2020
}
2121
}
22+
23+
@GeneratedTest()
24+
fun BuildConfigurator.testCleanCheck() {
25+
addProjectWithKover {
26+
sourcesFrom("simple")
27+
}
28+
29+
run("clean", "check") {
30+
checkDefaultBinReport()
31+
}
32+
}
2233
}

kover-gradle-plugin/src/main/kotlin/kotlinx/kover/gradle/aggregation/project/KoverProjectGradlePlugin.kt

+2-1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import org.gradle.api.tasks.compile.JavaCompile
2626
import org.gradle.api.tasks.testing.Test
2727
import org.gradle.kotlin.dsl.create
2828
import org.gradle.kotlin.dsl.named
29+
import org.gradle.kotlin.dsl.register
2930
import org.gradle.kotlin.dsl.withType
3031
import java.io.File
3132

@@ -63,7 +64,7 @@ internal class KoverProjectGradlePlugin : Plugin<Project> {
6364
val artifactFile = layout.buildDirectory.file("kover/kover.artifact")
6465

6566
// we create task immediately because of mustRunAfter
66-
val generateArtifactTask = tasks.create<ArtifactGenerationTask>("koverGenerateArtifact")
67+
val generateArtifactTask = tasks.register<ArtifactGenerationTask>("koverGenerateArtifact").get()
6768
generateArtifactTask.outputFile.set(artifactFile)
6869

6970
// add tests

kover-gradle-plugin/src/main/kotlin/kotlinx/kover/gradle/aggregation/project/instrumentation/JvmTestTaskInstrumentation.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ private fun buildKoverJvmAgentArgs(
126126
}
127127

128128
private fun File.writeAgentArgs(binReportFile: File, includedClasses: Set<String>, excludedClasses: Set<String>) {
129-
binReportFile.parentFile.mkdirs()
129+
parentFile.mkdirs()
130130
val binReportPath = binReportFile.canonicalPath
131131

132132
printWriter().use { pw ->

kover-gradle-plugin/src/main/kotlin/kotlinx/kover/gradle/plugin/tools/kover/KoverOnlineInstrumentation.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ internal fun buildJvmAgentArgs(
2020
}
2121

2222
private fun File.writeAgentArgs(binReportFile: File, excludedClasses: Set<String>, includedClasses: Set<String>) {
23-
binReportFile.parentFile.mkdirs()
23+
parentFile.mkdirs()
2424
val binReportPath = binReportFile.canonicalPath
2525

2626
printWriter().use { pw ->

0 commit comments

Comments
 (0)