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

Switch to incap helper #114

Merged
merged 10 commits into from
Nov 19, 2018
Merged

Switch to incap helper #114

merged 10 commits into from
Nov 19, 2018

Conversation

ZacSweers
Copy link
Collaborator

No description provided.

Copy link

@tbroyer tbroyer left a comment

Choose a reason for hiding this comment

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

I approve the code changes. Verified them in the auto-value-moshi-tests project (make a small change to a source file, ./gradlew :auto-value-moshi-tests:compileJava --debug --no-build-cache –fwiw, I enable build cache globally– and look for Full recompilation and/or Recompiled classes in the output; note that I added net.ltgt.gradle.incap:incap:0.2 as an explicit annotationProcessor dependency to workaround google/auto#615 (comment)).

BTW, shouldn't you "shade" dependencies? I mean, at least auto-common.

@@ -1,15 +1,20 @@
apply plugin: 'net.ltgt.apt'
Copy link

Choose a reason for hiding this comment

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

You should revert that change, and use annotationProcessor.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

So when I use that, it fails on CI due to not finding generated classes - https://travis-ci.org/rharter/auto-value-moshi/builds/456470849?utm_source=github_status&utm_medium=notification

I tried this just in case, and sure enough it did seem to fix it. Any sense on why it only happens in CI?

Copy link

Choose a reason for hiding this comment

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

That was because auto-service wasn't in the processor path anymore at that commit.

At a minimum you could revert the annotationProcessorapt change, whether using net.ltgt.apt or not (it will setup options.annotationProcessorGeneratedSourcesDirectory, but this is useless here as those processors only generate resources; see the project's README to determine whether it's useful for you or not, in this specific case, it's not).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

apply plugin: 'java'
apply plugin: 'maven-publish'

sourceCompatibility = versions.java
targetCompatibility = versions.java

dependencies {
apt "net.ltgt.gradle.incap:incap-processor:0.2"
Copy link

Choose a reason for hiding this comment

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

Move to dependencies.gradle?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Will do

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@ZacSweers
Copy link
Collaborator Author

Thanks for the details on how to verify, I wish the docs had a bit more information on that :|

note that I added net.ltgt.gradle.incap:incap:0.2 as an explicit annotationProcessor dependency to workaround google/auto#615 (comment)).

As opposed to the current apt declaration?

BTW, shouldn't you "shade" dependencies? I mean, at least auto-common.

Yes, planning to look at that in a followup. Filed #115

@tbroyer
Copy link

tbroyer commented Nov 18, 2018

note that I added net.ltgt.gradle.incap:incap:0.2 as an explicit annotationProcessor dependency to workaround google/auto#615 (comment)).

As opposed to the current apt declaration?

That was in the auto-value-moshi-tests subproject. If you don't add it, you'll see:

Full recompilation is required because com.google.auto.value.processor.AutoValueProcessor is not incremental.

in the --debug logs.

@ZacSweers
Copy link
Collaborator Author

Nevermind, I can't read apparently and just understood your last comment

@ZacSweers ZacSweers merged commit 8f6253e into master Nov 19, 2018
@ZacSweers ZacSweers deleted the z/useincaphelper branch November 19, 2018 04:52
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.

2 participants