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

Create a new subproject for annotations #107

Merged
merged 8 commits into from Jan 26, 2017

Conversation

KengoTODA
Copy link
Member

Similar with #106, but it also contains:

  • Stop making jar file which contains jcip annotations and jsr305 annotations. We've switched to transitive dependency.
  • Delete jsr305.jar from findbugs/lib, and use jsr305-3.0.1.jar on Maven central instead.

Note that currently the artifactId for annotation jar is spotbugs-annotations.

@KengoTODA KengoTODA self-assigned this Jan 24, 2017
@coveralls
Copy link

Coverage Status

Coverage increased (+0.003%) to 56.573% when pulling 47d9a90 on KengoTODA:subproject-for-annotations into 7b693a2 on spotbugs:master.

exclude 'junit.jar'

include '**/*.jar'
}
from([jar, spotbugsAnnotationsJar]) {
from([jar]) {
Copy link
Member

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");
Copy link
Member

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?

Copy link
Member Author

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.

Copy link
Member

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

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 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'
Copy link
Member

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'
Copy link
Member

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.

Copy link
Member Author

@KengoTODA KengoTODA Jan 25, 2017

Choose a reason for hiding this comment

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

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'll delete it in #104.

Copy link
Member

Choose a reason for hiding this comment

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

Ok, great!

@coveralls
Copy link

Coverage Status

Coverage increased (+0.003%) to 56.573% when pulling 0b23ad2 on KengoTODA:subproject-for-annotations into 7b693a2 on spotbugs:master.

@@ -1,7 +1,5 @@
apply from: "$rootDir/gradle/checkstyle.gradle"
apply from: "$rootDir/gradle/javadoc.gradle"
apply plugin: 'maven'
apply plugin: 'signing'
Copy link
Member

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?

@coveralls
Copy link

Coverage Status

Coverage increased (+0.1%) to 56.712% when pulling f07026a on KengoTODA:subproject-for-annotations into 7b693a2 on spotbugs:master.

if (file.isDirectory()) {
project.addAuxClasspathEntry(file.getCanonicalPath());
}
project.addAuxClasspathEntry(file.getCanonicalPath());
Copy link
Member

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

Copy link
Member Author

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) {
Copy link
Member

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.

Copy link
Member Author

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.

https://github.com/KengoTODA/spotbugs/commits/issue-30

@jsotuyod
Copy link
Member

This is looking really good

@KengoTODA
Copy link
Member Author

I've commented to all review comments, please check and merge.

Copy link
Contributor

@henrik242 henrik242 left a comment

Choose a reason for hiding this comment

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

Lgtm

@henrik242 henrik242 merged commit 4c6c6c5 into spotbugs:master Jan 26, 2017
@KengoTODA KengoTODA deleted the subproject-for-annotations branch January 26, 2017 08:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants