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
Create a new subproject for annotations #107
Create a new subproject for annotations #107
Conversation
this revision has one problem: it package two annotation jar files into distZip.
exclude 'junit.jar' | ||
|
||
include '**/*.jar' | ||
} | ||
from([jar, spotbugsAnnotationsJar]) { | ||
from([jar]) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need to use a list anymore
File file = new File(cpStr); | ||
if (file.isDirectory()) { | ||
project.addAuxClasspathEntry(file.getCanonicalPath()); | ||
File annotationsLib = new File("../spotbugs-annotations/build/libs"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not comfortable hardwiring this into the code. Specially when it's a build dir, and therefore a run from IDE may fail if the annotations project was cleaned from CLI.
What was wrong with the old code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It couldn't find the jar file of spotbugs-annotation. So nullness check couldn't run as expected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's weird... having the project dependency, it should be in the classpath for both Gradle and Eclipse / IntelliJ runs.... we definitely need some way around this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess we can simply delete if (file.isDirectory())
, because gradle added jar file path to CLASSPATH.
System.out.println("CP:" + System.getProperty("java.class.path"));
->
~/spotbugs/findbugs/build/classes/test:
...
~/spotbugs/spotbugs-annotations/build/libs/spotbugs-annotations-3.1.0-SNAPSHOT.jar
...
transitive = false | ||
} | ||
includedLibs project(':spotbugs-annotations') | ||
includedLibs 'com.google.code.findbugs:jsr305:3.0.1' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you do this, you should probably remove jsr305.jar
from the libs folder, remove it from line 31 of this build script, and change the manifest accordingly.
@@ -213,11 +130,12 @@ distributions { | |||
|
|||
// TODO : These exclusions can be removed when we move dependencies from lib to dependency management | |||
exclude 'AppleJavaExtensions.jar' | |||
exclude 'hamcrest-all-1.3.jar' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
who is adding hamcrest as part of the compile configuration? AFAIK it's only used as a test dependency.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It comes from lib directory.
https://github.com/spotbugs/spotbugs/tree/47d9a90d697542d1cef48a7a0d4104d6b128817d/findbugs/lib
Refs: f038a08
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll delete it in #104.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, great!
@@ -1,7 +1,5 @@ | |||
apply from: "$rootDir/gradle/checkstyle.gradle" | |||
apply from: "$rootDir/gradle/javadoc.gradle" | |||
apply plugin: 'maven' | |||
apply plugin: 'signing' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't you need these plugins to be able to sign and publish to maven central the annotations artifacts?
if (file.isDirectory()) { | ||
project.addAuxClasspathEntry(file.getCanonicalPath()); | ||
} | ||
project.addAuxClasspathEntry(file.getCanonicalPath()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
have you tested this running from the IDE? Just curious, I clearly runs from Gradle... I don't remember if it was getting this way, or classpath
was null on that scenario
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It works in my Eclipse.
But I have another problem: test-harness
project introduced a cyclic dependency.
Gradle has no problem because it computes dependency based on tasks. However Eclipse computes it based on projects...
We should specify fixed version instead of project(':test-harness')
. I'll handle this after we release 3.1.0.
@@ -286,19 +204,6 @@ publishing { | |||
classifier 'javadoc' | |||
} | |||
} | |||
|
|||
annotations(MavenPublication) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we do need publishing config / maven + signing plugins in the new project to publish annotations artifacts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes we need. I'm working on another branch issue-30
.
This is looking really good |
I've commented to all review comments, please check and merge. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm
Similar with #106, but it also contains:
jsr305.jar
fromfindbugs/lib
, and usejsr305-3.0.1.jar
on Maven central instead.Note that currently the artifactId for annotation jar is
spotbugs-annotations
.