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

Incremental Java compile is disabled when an input source does not exist #8194

Closed
hungvietnguyen opened this issue Jan 9, 2019 · 4 comments

Comments

Projects
None yet
3 participants
@hungvietnguyen
Copy link

commented Jan 9, 2019

Your Environment

Gradle version: 5.1 (or more specifically 5.1-rc-3+, probably after this commit ca508b4)

Current Behavior

Starting with Gradle 5.1-rc-3, incremental Java compile is disabled when an input source does not exist. Below is an example --info log:

Cannot infer source root(s) for source `file 'project/app/src/debug/java'`. Supported types are `File` (directories only), `DirectoryTree` and `SourceDirectorySet`.
Cannot infer source root(s) for source `file 'project/app/build/generated/aidl_source_output_dir/debug/compileDebugAidl/out'`. Supported types are `File` (directories only), `DirectoryTree` and `SourceDirectorySet`.
Cannot infer source root(s) for source `file 'project/app/build/generated/renderscript_source_output_dir/debug/compileDebugRenderscript/out'`. Supported types are `File` (directories only), `DirectoryTree` and `SourceDirectorySet`.

Full recompilation is required because the source roots could not be inferred.

file or directory 'project/app/src/debug/java', not found
file or directory 'project/app/build/generated/aidl_source_output_dir/debug/compileDebugAidl/out', not found
file or directory 'project/app/build/generated/renderscript_source_output_dir/debug/compileDebugRenderscript/out', not found

Expected Behavior

Incremental Java compile should not be disabled when an input source does not exist.

Context

We ran into this issue when updating the Android Gradle plugin to use Gradle 5.1. We have worked around the issue by removing non-existent input sources from the Java compile task (at task execution time). However, this probably still needs to be fixed on the Gradle side.

@oehme

This comment has been minimized.

Copy link
Member

commented Jan 9, 2019

Might be worth doing for 5.1.1, what do you think @wolfs?

@oehme oehme added this to the 5.1.1 milestone Jan 9, 2019

wolfs added a commit that referenced this issue Jan 9, 2019

@wolfs

This comment has been minimized.

Copy link
Member

commented Jan 9, 2019

Fixed via #8195. This will be part of 5.1.1.

@wolfs

This comment has been minimized.

Copy link
Member

commented Jan 9, 2019

@hungvietnguyen Can you try out 5.1.1-20190109212058+0000, which contains the fix for this issue?

@hungvietnguyen

This comment has been minimized.

Copy link
Author

commented Jan 10, 2019

It's working, thanks!

fengcunhan pushed a commit to fengcunhan/tools-gradle that referenced this issue Apr 22, 2019

Revert "Gradle 5.1"
This reverts commit 8f5caba.

Reason for revert: gradle/gradle#8194 introduced in Gradle 5.1-rc-3 and fixed in 5.1.1

Change-Id: I0359f6bc837c351895131cf2bfb3cb359e74daa2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.