Skip to content

Depend on our own custom checker framework fork for now. - #29

Merged
lazaroclapp merged 4 commits into
masterfrom
lazaro_use_forked_cf
Sep 28, 2017
Merged

lazaroclapp merged 4 commits into
masterfrom
lazaro_use_forked_cf

Conversation

@lazaroclapp

Copy link
Copy Markdown
Collaborator

This commit:

@lazaroclapp
lazaroclapp requested a review from kageiit September 26, 2017 01:30
Comment thread nullaway/build.gradle
compileOnly deps.apt.autoService

compile deps.build.errorProneCheckApi
shadow deps.build.errorProneCheckApi

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

For some reason, saying shadow here means "exclude this and its dependencies from the shadowJar"... yes, really...

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

weird...

Comment thread nullaway/build.gradle Outdated
}

shadowJar {
classifier = "cf"

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Our NullAway+CF jar will be called nullaway-version-cf.jar

For now, I am excluding most dependencies, only bundling CF-dataflow and CF-javacutil. But let me know if we want to make a true fat jar, with EP and javax and everything.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

No, this is right, we just want to bundle the CF classes

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

is the classifier here a maven classifier?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I am not sure, it gets added at the end of that jar filename, I am not sure were else it is used. I'd be fine with setting it to null and having both shadow be our default build and this being our default jar.

return CFGBuilder.build(
bodyPath, env, ast, false, false);
}
return CFGBuilder.build(bodyPath, env, ast, false, false);

@lazaroclapp lazaroclapp Sep 26, 2017 •

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

🎉

Comment thread build.gradle

repositories {
maven {
url "https://raw.githubusercontent.com/msridhar/checker-framework/repository/"

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Tested on VPN, no problems so far.

@lazaroclapp

Copy link
Copy Markdown
Collaborator Author

It seems :sample is not seeing the version of :nullaway with the shadowed CF classes. Simply making shadowJar.classifier = "" and having build.dependsOn shadowJar does not solve this issue, so I'll dig into it a bit more tomorrow. Unless either of you know what exactly apt project(":nullaway") pulls in.

@msridhar

Copy link
Copy Markdown
Collaborator

Re: the build failure, not sure what is going on. We need to say somehow that the sample project depends on the shadow jar output of the nullaway project; not sure how to do that.

@kageiit

kageiit commented Sep 27, 2017

Copy link
Copy Markdown
Contributor

Re: the build failure, not sure what is going on. We need to say somehow that the sample project depends on the shadow jar output of the nullaway project; not sure how to do that.

You can say

compile project(name: "nullaway", configuration: "shadow")

This commit:

- Adds https://github.com/msridhar/checker-framework
  (repository branch) as a maven repository for our build.gradle
- Forces the 2.1.14-nullaway checker framework dataflow jar
  (but uses upstream javacutil.jar for same version). Forcing
  needed, as 2.1.14-* < 2.1.14 for dependency resolution.
- Adds the shadow maven plug-in allowing us to create a semi-fat
  jar using `gradle shadowJar` which contains NullAway and the
  checker framework fork, but not, say, EP or javax.
- Removes our hack around a CF fix we backported into our fork:
  typetools/checker-framework#1516
@lazaroclapp

Copy link
Copy Markdown
Collaborator Author

This alone does not solve the problem:

apt project(path: ":nullaway", configuration: "shadow")

When we depend on another project, how do the clases of that project get loaded? Is it just that the project gets built and then the nullaway-0.1.5-SNAPSHOT.jar added to the classpath? Because if so, we need to substitute that with nullaway-0.1.5-SNAPSHOT-cf.jar.

However, I tried setting shadowJar.classifier = null, which removes the -cf part and makes nullaway-0.1.5-SNAPSHOT.jar our fat jar, but this does still not get us the right classes at runtime.

@lazaroclapp
lazaroclapp merged commit 7d6e253 into master Sep 28, 2017
@kageiit
kageiit deleted the lazaro_use_forked_cf branch September 28, 2017 23:00
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.

3 participants