Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid escape characters in intellijreport.json #82

Closed
lars-reimann opened this issue Nov 29, 2021 · 2 comments
Closed

Invalid escape characters in intellijreport.json #82

lars-reimann opened this issue Nov 29, 2021 · 2 comments
Labels
Bug Bug issue type S: waiting for clarification Status: additional information required to proceed

Comments

@lars-reimann
Copy link

Kover version: 0.4.3
Coverage Engine: IntelliJ with default version
OS: Windows


Minimal build.gradle.kts:

plugins {
    id("org.jetbrains.kotlinx.kover") version "0.4.3"
}

repositories {
    mavenCentral()
}

kover {
    coverageEngine.set(kotlinx.kover.api.CoverageEngine.INTELLIJ)
    generateReportOnCheck.set(true)
}

When running ./gradlew check on Windows I get the following output:

> Task :[REDACTED]:koverHtmlReport FAILED
com.intellij.rt.coverage.report.ReporterArgs$ArgParseException: Incorrect arguments in file [REDACTED]\build\tmp\koverHtmlReport\intellijreport.json
        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: Illegal escape. at 17 [character 15 line 2]
        at org.json.JSONTokener.syntaxError(JSONTokener.java:507)
        at org.json.JSONTokener.nextString(JSONTokener.java:353)
        at org.json.JSONTokener.nextValue(JSONTokener.java:428)
        at org.json.JSONObject.<init>(JSONObject.java:252)
        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
[REDACTED]\build\tmp\koverHtmlReport\intellijreport.json

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]
}

FAILURE: Build failed with an exception.

This is the content of intellijreport.json:

{
  "html": "[REDACTED]\build\reports\kover\html",
  "modules": [
    { "reports": [ 
        
      ], 
      "output": [
        
      ],
      "sources": [
        
      ]
    }
  ]
}

I guess the \ in the html property should be replaced by \\.

Jacoco works with 0.4.3, though, which is already workable.

@lars-reimann lars-reimann changed the title Invalid escape characters in JSON Invalid escape characters in intellijreport.json Nov 29, 2021
@shanshin shanshin added the Bug Bug issue type label Nov 29, 2021
@shanshin
Copy link
Collaborator

@lars-reimann, please check in 0.4.4

@shanshin shanshin added the S: waiting for clarification Status: additional information required to proceed label Nov 29, 2021
@lars-reimann
Copy link
Author

0.4.4 works, thank you very much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Bug issue type S: waiting for clarification Status: additional information required to proceed
Projects
None yet
Development

No branches or pull requests

2 participants