Submodules changed files not tracked in for an iOS multi-module project

  • what are you trying to achieve
    We have a large framework with a lot of independent features, so now we are trying to make each feature a separate submodule to make it easier to import the submodule only and not the entire framework

  • what have you tried so far to achieve this
    first I added the submodule to the sonar-project.properties file like

###########################
# Required configuration

sonar.host.url=${env.SonarQubeUrl}
sonar.login=${env.SonarQubeEntepriseToken}

# Project key will also be used for binary file
sonar.projectKey=vfgroup-oneplatform-iOS-MVA10-Framework

sonar.modules=DiscountRenewal,VFGMVA10Framework
# Path to source directories
# DiscountRenewal
DiscountRenewal.sonar.projectBaseDir=../DiscountRenewal
DiscountRenewal.sonar.swift.project=DiscountRenewal.xcodeproj
DiscountRenewal.sonar.swift.workspace=DiscountRenewal.xcworkspace
DiscountRenewal.sonar.sources=DiscountRenewal
DiscountRenewal.sonar.tests=DiscountRenewalTests
DiscountRenewal.sonar.swift.appScheme=DiscountRenewal

# framework
VFGMVA10Framework.sonar.sources=../VFGMVA10Framework
# Path to test directories (comment if no test)
VFGMVA10Framework.sonar.tests=../VFGMVA10FrameworkTests

VFGMVA10Framework.sonar.swift.project=VFGMVA10Framework.xcodeproj
VFGMVA10Framework.sonar.swift.workspace=VFGMVA10Framework.xcworkspace

# Scheme to build your application
VFGMVA10Framework.sonar.swift.appScheme=VFGMVA10Framework

VFGMVA10Framework.sonar.swift.simulator=platform=iOS Simulator,name=iPhone 8 Plus,OS=latest

##########################
# Optional configuration

# Exclude ObjectiveC
sonar.c.file.suffixes=-
sonar.cpp.file.suffixes=-
sonar.objc.file.suffixes=-

# Encoding of the source code
VFGMVA10Framework.sonar.sourceEncoding=UTF-8
DiscountRenewal.sonar.sourceEncoding=UTF-8

# Paths to exclude from coverage report (surefire, 3rd party libraries etc.)
VFGMVA10Framework.sonar.swift.excludedPathsFromCoverage=.*Tests.*
DiscountRenewal.sonar.swift.excludedPathsFromCoverage=.*Tests.*
sonar.swift.excludedPathsFromCoverage=.*Tests.*

VFGMVA10Framework.sonar.swift.tailor.config=--max-line-length=100 --max-file-length=500 --max-name-length=40 --min-name-length=4
DiscountRenewal.sonar.swift.tailor.config=--max-line-length=100 --max-file-length=500 --max-name-length=40 --min-name-length=4

but on the sonarqube it only sees the changes inside the main framework and not track the changed files in the submodule DiscountRenewal

I tried adding sonar.scm.exclusions.disabled=true but didn’t work
Also tried sonar.inclusions which is deprecated and also didn’t work

any idea what I need to do to make sonar track the changed files in the submodules

Hey there.

As requested in the template post, what version/edition of SonarQube are you using

the version is 9.9.0

Hm. As I understand it, we added support for detecting New Code in Git Submodules in v9.x

I suggest running sonar-scanner -X and providing the logs of the analysis for a further look.

all file in DiscountRenewal has the same warning