Skip to content

Mixed ObjC and Swift Project - Can not add the same measure twice on org.sonar.api.resources.Project #50

@leddo

Description

@leddo

I am getting an error when trying to run a project through it that has both swift and objective-c files in it.

16:40:59 ERROR: Error during Sonar runner execution
16:40:59 org.sonar.runner.impl.RunnerException: Unable to execute Sonar
16:40:59 at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:91)
16:40:59 at org.sonar.runner.impl.BatchLauncher$1.run(BatchLauncher.java:75)
16:40:59 at java.security.AccessController.doPrivileged(Native Method)
16:40:59 at org.sonar.runner.impl.BatchLauncher.doExecute(BatchLauncher.java:69)
16:40:59 at org.sonar.runner.impl.BatchLauncher.execute(BatchLauncher.java:50)
16:40:59 at org.sonar.runner.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:102)
16:40:59 at org.sonar.runner.api.Runner.execute(Runner.java:100)
16:40:59 at org.sonar.runner.Main.executeTask(Main.java:70)
16:40:59 at org.sonar.runner.Main.execute(Main.java:59)
16:40:59 at org.sonar.runner.Main.main(Main.java:53)
16:40:59 Caused by: org.sonar.api.utils.SonarException: Can not add the same measure twice on org.sonar.api.resources.Project@278cbf5a[id=,key=com.blahblahblah:Mobile-iOS-blah,qualifier=TRK]: org.sonar.api.measures.Measure@7bd0e2e9[metricKey=tests,metric=Metric[id=,key=tests,description=Number of unit tests,type=INT,direction=-1,domain=Coverage,name=Unit tests,qualitative=false,userManaged=false,enabled=true,worstValue=,bestValue=,optimizedBestValue=false,hidden=false,deleteHistoricalData=false,decimalScale=],value=0.0,data=,description=,alertStatus=,alertText=,date=,variation1=,variation2=,variation3=,variation4=,variation5=,url=,personId=,persistenceMode=FULL,fromCore=false]

If I add sonar.language=objc to the sonar-project.properties file, then it all works (the app is predominantly ObjC. but with that removed (the comment in the default properties file says to remove it for a mixed app), then the error happens above.

Also, this project has no unit tests in it, so could that be contributing to the problem?

Any ideas ?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions