Repository: Kotlin/kotlinx-kover

Issue #34: Move dependencies into maven central
Created: 2021-11-02T05:10:20Z
Since kover has something that relies on https://packages.jetbrains.team/maven/p/ij/intellij-dependencies I'm unable to use it because my company requires using an internal repository which mirrors maven central. Are there plans to make this happen?

Duplicate issue #77: Error: JSON errors when running Kover with the IntelliJ coverage engine
Created: 2021-11-26T14:00:05Z
Steps to reproduce (or use the attached project)

Create an empty Android Project in Android studio.
Add the following after the buildscript block in the root build.gradle

plugins {
    id 'org.jetbrains.kotlinx.kover' version '0.4.2'
}


Add the following in app/build.gradle:

kover {
    coverageEngine.set(kotlinx.kover.api.CoverageEngine.INTELLIJ)
    intellijEngineVersion.set('1.0.639') // The version has to be specified, because the default version (622) isn't on Maven Central https://github.com/Kotlin/kotlinx-kover/issues/76
}



Change the repositoriesMode to RepositoriesMode.PREFER_SETTINGS (because this change isn't in 0.4.2 yet)


Add a class and create a test


Clean the project


Run the gradle tasks koverVerify koverHtmlReport


You then see this error:
com.intellij.rt.coverage.report.ReporterArgs$ArgParseException: Incorrect arguments in file /Users/cristan/AndroidStudioProjects/TestKoverAndroidProject/app/build/tmp/koverHtmlReport/intellijreport.args
	at com.intellij.rt.coverage.report.ReporterArgs.from(ReporterArgs.java:66)
	at com.intellij.rt.coverage.report.Main.main(Main.java:29)
Caused by: org.json.JSONException: A JSONObject text must begin with '{' at 1 [character 2 line 1]
	at org.json.JSONTokener.syntaxError(JSONTokener.java:507)
	at org.json.JSONObject.<init>(JSONObject.java:222)
	at org.json.JSONObject.<init>(JSONObject.java:406)
	at com.intellij.rt.coverage.report.ReporterArgs.parse(ReporterArgs.java:72)
	at com.intellij.rt.coverage.report.ReporterArgs.from(ReporterArgs.java:62)
	... 1 more
/Users/cristan/AndroidStudioProjects/TestKoverAndroidProject/app/build/tmp/koverHtmlReport/intellijreport.args

Arguments must be passed in the following JSON format:
{
  "modules": [
    { "reports": [
        {"ic": "path to ic binary file", "smap": "path to source map file"}
      ] [OPTIONAL, absence means that all classes were not covered],
      "output": ["outputRoot1", "outputRoot2"],
      "sources": ["sourceRoot1", "sourceRoot2"]
    }
  ],
  "xml": "path to xml file" [OPTIONAL],
  "html": "path to html directory" [OPTIONAL]
Caused by: org.json.JSONException: A JSONObject text must begin with '{' at 1 [character 2 line 1]

}

Execution failed for task ':app:koverHtmlReport'.
> Process 'command '/Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java'' finished with non-zero exit value 1

The value of intellijreports.args:
/Users/cristan/AndroidStudioProjects/TestKoverAndroidProject/app/build/kover/testDebugUnitTest.ic
/Users/cristan/AndroidStudioProjects/TestKoverAndroidProject/app/build/kover/testDebugUnitTest.ic.smap
/Users/cristan/AndroidStudioProjects/TestKoverAndroidProject/app/build/kover/testReleaseUnitTest.ic
/Users/cristan/AndroidStudioProjects/TestKoverAndroidProject/app/build/kover/testReleaseUnitTest.ic.smap

/Users/cristan/AndroidStudioProjects/TestKoverAndroidProject/app/src/main/java

/Users/cristan/AndroidStudioProjects/TestKoverAndroidProject/app/build/tmp/kotlin-classes/release
/Users/cristan/AndroidStudioProjects/TestKoverAndroidProject/app/build/tmp/kotlin-classes/debug
/Users/cristan/AndroidStudioProjects/TestKoverAndroidProject/app/build/intermediates/javac/release/classes
/Users/cristan/AndroidStudioProjects/TestKoverAndroidProject/app/build/intermediates/javac/debug/classes


/Users/cristan/AndroidStudioProjects/TestKoverAndroidProject/app/build/reports/kover/html

As you can see, this is no JSON, so it indeed can't be parsed as such.

Closing comment (2021-11-26T15:28:37Z): Duplicate #34