Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: handle libraries using build.gradle.kts files #2543

Merged
merged 2 commits into from
Nov 4, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix: handle libraries using build.gradle.kts files
  • Loading branch information
bang9 committed Nov 4, 2024
commit 7eb9ac9aebceeff58119645a7956c03c3ca588e0
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ describe('android::findLibraryName', () => {
});

it('returns the library name if declared with inside a build.gradle.kts file', () => {
expect(findLibraryName('/', '/valid/singlequotes')).toBe('justalibrary');
expect(findLibraryName('/', '/valid/gradlekts')).toBe('justalibrary');
});

it('returns the library name if defined inside codegenConfig', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ export function findLibraryName(root: string, sourceDir: string) {
return undefined;
}

const match = buildGradleContents.match(/libraryName = ["'](.+)["']/);
const match =
buildGradleContents.match(/libraryName = ["'](.+)["']/) ??
buildGradleContents.match(/libraryName\.set\(["'](.+)["']\)/);
thymikee marked this conversation as resolved.
Show resolved Hide resolved

if (match) {
return match[1];
Expand Down
Loading