Skip to content

Commit

Permalink
fix(common-jvm): fix checkForModule util to match gradle child modu…
Browse files Browse the repository at this point in the history
…le names w/ arbitrary paths
  • Loading branch information
quinnj committed Dec 15, 2023
1 parent 37dc370 commit df97dbd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/common-jvm/src/lib/utils/gradle-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -380,12 +380,12 @@ export function hasGradleModule(cwd:string, moduleName: string){

function checkForModule(settings:string, moduleName:string){
const opts = {
fragments: [new RegExp(`rootProject\\.name\\s*=\\s*'`), new RegExp(`include\\s+':?${moduleName}'`)],
fragments: [new RegExp(`rootProject\\.name\\s*=\\s*'`), new RegExp(`include\\s+':?(?:[^:]*:)*${moduleName}'`)],
logicalOp: 'and' as 'and' | 'or'
};

const optsKts = {
fragments: [new RegExp(`rootProject\\.name\\s*=\\s*"`), new RegExp(`include\\(":?${moduleName}"\\)`)],
fragments: [new RegExp(`rootProject\\.name\\s*=\\s*"`), new RegExp(`include\\(":?(?:[^:]*:)*${moduleName}"\\)`)],
logicalOp: 'and' as 'and' | 'or'
};

Expand Down Expand Up @@ -473,4 +473,4 @@ function hasGradleWrapperWithPredicate(predicate: (file: string) => boolean) {
'gradlew.bat',
'gradlew.cmd',
].some(file => predicate(file)) ;;
}
}

0 comments on commit df97dbd

Please sign in to comment.