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
Minor java improvements #3761
Minor java improvements #3761
Conversation
Before I dig around the code, please summarize the improvements (with an eye towards being able to review the PR)? |
This PR aggregates 3 of the changes we've made to improve java handling:
|
#3761 has a partial fix for this |
@davidhart82 - can you add some tests to cover these changes? |
@bdbaddog I've scrubbed fix number 3; it might need more work. But I've added tests for the other 2 fixes. |
Is there a replacement coming? |
SCons/Scanner/Java.py
Outdated
for lib in classpath: | ||
if SCons.Util.is_String(lib) and "*" in lib: | ||
result += env.Glob(lib) | ||
elif os.path.isdir(str(lib)): |
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 need to find all of the in-memory and on-disk nodes; is there a better way of doing 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.
SCons Glob should find both..
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.
The age old scons glob isn't recursive problem - need to find classes in the current directory and below.
@mwichmann I got fed up with it, and was going to bin it. But I had a change of heart, reduced scope a little, and now I think it works. |
|
||
Class path entries that are neither directories nor archives (.zip or JAR files) nor the asterisk (*) wildcard character are ignored. | ||
""" | ||
classpath = env.get('JAVACLASSPATH', []) |
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.
This might work for JAVABOOTCLASSPATH now
JAVACLASSPATH=[test.workpath()]) | ||
s = SCons.Scanner.Java.JavaScanner() | ||
deps = s(DummyNode('dummy'), env) | ||
expected = ['Test.class', 'com/Test.class'] |
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.
Check if this should pick up jars too
This one has set open for a while now - what do we need to do to get it over the line? I'd probably change the title a little bit - adding a scanner feels like a little more than just "minor improvements". I pulled the PR to here and rebased it to head and the added tests still pass fine. I'm no Java person so not much further help from me. A few nitpickery notes for updates:
|
@mwichmann I'd almost given up on it! We use this code everyday, so am happy to fix it up inline with your suggestions. Hopefully I'll get some time this week to do that. |
…anges to the current version
Contributor Checklist:
CHANGES.txt
(and read theREADME.rst
)Here are some minor Java improvements for discussion; I've yet to add tests and update the CHANGES.txt/relevant documentation, but would be happy to do so if there it is decided that these changes are worth integrating.