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

Ignore missing source roots for incremental compilation #8195

Merged
merged 2 commits into from Jan 9, 2019

Conversation

wolfs
Copy link
Member

@wolfs wolfs commented Jan 9, 2019

Fixes #8194.

@wolfs wolfs added this to the 5.1.1 milestone Jan 9, 2019
@wolfs wolfs self-assigned this Jan 9, 2019
@wolfs wolfs requested a review from lptr January 9, 2019 12:31
@@ -569,6 +569,25 @@ sourceSets {
output.contains("Full recompilation is required because the source roots could not be inferred.")
}

def "missing files are ignored of source roots"() {
Copy link
Member

Choose a reason for hiding this comment

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

of => as

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed.

@@ -569,6 +569,25 @@ sourceSets {
output.contains("Full recompilation is required because the source roots could not be inferred.")
}

def "missing files are ignored of source roots"() {
buildFile << "compileJava.source([file('extra-java'), file('other'), fileTree('missing-tree'), file('missing-file')])"
Copy link
Member

Choose a reason for hiding this comment

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

Let's break this into multiple lines.

Also, what is the difference between other and missing-file? Seems to be both missing. For simplicity's sake we could also put the sources under src/main/java so we could remove extra-java as well.

Copy link
Member Author

Choose a reason for hiding this comment

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

I now only add missing-tree and missing-file.


then:
outputs.recompiledClasses("A", "B")
!output.contains("Full recompilation is required because the source roots could not be inferred.")
Copy link
Member

Choose a reason for hiding this comment

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

It's not an isolated problem, but I feel such tests are way too brittle. Can we at least get this string from a constant in the production code maybe?

Copy link
Member Author

Choose a reason for hiding this comment

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

I can remove this line, given that a full recompilation would always meant the C is compiled as well.

@wolfs
Copy link
Member Author

wolfs commented Jan 9, 2019

@lptr PTAL!

@wolfs wolfs merged commit 5d8a0dd into release Jan 9, 2019
@wolfs wolfs deleted the wolfs/missing-source-root-inc-compile branch January 9, 2019 14:22
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

Successfully merging this pull request may close these issues.

None yet

2 participants