I am using XcodeCoverageConverter to convert XCResult to Cobertura XML as per the instruction provided in the README file.
It is working as expected when only one item was passed as value for --exclude-packages
.
However when I try to pass an array as follows,
xcc generate coverage.json TargetDirectory cobertura-xml --exclude-packages Tests AnotherPackageName --verbose
I get the following error,
Error: The value 'AnotherPackageName' is invalid for '<output-formats>'
Usage: xcc generate <json-file> <output-path> [<output-formats> ...] [--exclude-targets <exclude-targets> ...] [--exclude-packages <exclude-packages> ...] [--verbose]
Same thing I am trying from my Bash script, where I get the same error if I pass array for --exclude-packages
.
Sample 1
jsonPath="coverage.json"
coberturaTargetPath="Cobertura"
xcc generate $jsonPath \
$coberturaTargetPath cobertura-xml \
--exclude-packages Tests AnotherPackageName \
--verbose
Sample 2
jsonPath="coverage.json"
coberturaTargetPath="Cobertura"
excludePackages=(Tests AnotherPackageName)
xcc generate $jsonPath \
$coberturaTargetPath cobertura-xml \
--exclude-packages ${excludePackages[@]} \
--verbose
Sample 3
jsonPath="coverage.json"
coberturaTargetPath="Cobertura"
excludePackages=(Tests AnotherPackageName)
xcc generate $jsonPath \
$coberturaTargetPath cobertura-xml \
--exclude-packages=${excludePackages[@]} \
--verbose
Sample 4
jsonPath="coverage.json"
coberturaTargetPath="Cobertura"
outputFormats=(cobertura-xml)
excludePackages=(Tests AnotherPackageName)
xcc generate $jsonPath \
$coberturaTargetPath ${outputFormats[@]} \
--exclude-packages=${excludePackages[@]} \
--verbose
Sample 5
jsonPath="coverage.json"
coberturaTargetPath="Cobertura"
outputFormats=(cobertura-xml)
excludePackages=(Tests AnotherPackageName)
xcc generate $jsonPath \
$coberturaTargetPath ${outputFormats[@]} \
--exclude-packages="${excludePackages[@]} " \
--verbose
In all the above attempts, I am getting the same error. The items (excluding first item) which I pass for --exclude-packages is considered for output-formats. How to fix this?
Update:
xcc utility does support multiple arguments for --exclude-packages
. Reference