Skip to content

Commit

Permalink
Merge pull request #80 from koliveira15/bugfix/use-root-when-src-root…
Browse files Browse the repository at this point in the history
…-empty

Default sources to project root if sourceRoot doesnt exist
  • Loading branch information
koliveira15 committed Mar 18, 2024
2 parents 3c6e61c + ea7e8c4 commit 9284774
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 0 additions & 2 deletions packages/nx-sonarqube/src/executors/scan/executor.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ describe('Scan Executor', (): void => {
},
lib2: {
root: 'libs/lib2',
sourceRoot: 'libs/lib2/src',
targets: {
test: {
executor: '@nx/jest:jest',
Expand Down Expand Up @@ -175,7 +174,6 @@ describe('Scan Executor', (): void => {
type: 'lib',
data: {
root: 'libs/lib2',
sourceRoot: 'libs/lib2/src',
targets: {
test: {
executor: '',
Expand Down
6 changes: 5 additions & 1 deletion packages/nx-sonarqube/src/executors/scan/utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,11 @@ export async function determinePaths(
options.skipImplicitDeps ? project.type !== DependencyType.implicit : true
)
.forEach((dep) => {
sources.push(dep.sourceRoot);
if (dep.sourceRoot) {
sources.push(dep.sourceRoot);
} else {
sources.push(dep.projectRoot);
}

if (dep.testTarget) {
const testRunner: TestRunner = getTestRunner(dep);
Expand Down

0 comments on commit 9284774

Please sign in to comment.