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

Deal somehow with non-existing afterSync (or similar) tasks #98

Open
vlsi opened this issue Jan 25, 2020 · 1 comment
Open

Deal somehow with non-existing afterSync (or similar) tasks #98

vlsi opened this issue Jan 25, 2020 · 1 comment

Comments

@vlsi
Copy link

vlsi commented Jan 25, 2020

Use case: afterSync tasks are registered dynamically. For instance, there's a folder named src/test/test-cases which contains subfolders like test-cases/case1, test-cases/case2.

Gradle script lists all the subfolders under test-cases and creates for each of the folders.
The tasks are registered via afterSync.
So far so good, however, if the testcase is removed, then IDEA can no longer import the project because stale <after_sync><task name="..."/> is present in workspace.xml.

Do you think gradle-idea-ext-plugin should reset the triggers (e.g. to remove stale ones) or should IDEA itself ignore non-exising tasks?

Frankly speaking, I'm inclined that g-i-e-p should remove all the triggers before adding new ones. That, however, raises a question: what if the user has added their own after sync via IDEA UI? I guess that is a less important use case.

An alternative option is to deal with FAILURE: Build failed with an exception. * What went wrong: Task 'nonExistingAfterSyncTask' not found in project... exception in IDEA. For instance, exclude the non-existing task and re-run aftersync tasks once again.

@yihtserns
Copy link

yihtserns commented Jun 13, 2024

Does anyone know a non-manual way that I can put inside my build script to workaround this issue?

I don't mind any hack, just want to avoid having to tell my teammates to "please manually remove the following Tasks via Gradle window > right click > Task Activation"...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants