Skip to content

Commit

Permalink
fix(gradle): when multiple gradle operations on the same file, only t…
Browse files Browse the repository at this point in the history
…he first one is working (#183)

Co-authored-by: Nicolas Gandon <nicolas.gandon@devmachine.fr>
  • Loading branch information
ngandon and Nicolas Gandon committed May 8, 2023
1 parent 6dbb884 commit c7e7be4
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions packages/configure/src/operations/android/gradle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@ import { logger } from "../../util/log";

export default async function execute(ctx: Context, op: Operation) {
const entries = (op as AndroidGradleOperation).value;

const gradleFiles = new Map()
for (let entry of entries) {
const gradleFile = await ctx.project.android?.getGradleFile(entry.file);
if(!gradleFiles.has(entry.file)) {
const file = await ctx.project.android?.getGradleFile(entry.file);
gradleFiles.set(entry.file, file)
}
const gradleFile = gradleFiles.get(entry.file)
if (!gradleFile) {
logger.warn(`Skipping ${op.id} - can't locate Gradle file ${entry.file}`);
continue;
Expand All @@ -26,4 +30,4 @@ export default async function execute(ctx: Context, op: Operation) {

export const OPS: OperationMeta = [
'android.gradle'
]
]

1 comment on commit c7e7be4

@vercel
Copy link

@vercel vercel bot commented on c7e7be4 May 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.