-
-
Save tbroyer/512941cd798e1ccba4b4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# I'd expect the following to fail, but it works because javac will implicitly load A.java from the A_as_resource.jar. | |
# That wouldn't happen if javac was called with a -sourcepath. | |
# Proof by example: copy the javac command from the output and add `-sourcepath :` | |
# | |
mkdir -p src/foo/bar | |
echo ' | |
[java] | |
src_roots = /src/ | |
' > .buckconfig | |
echo ' | |
package foo.bar; | |
abstract class A { | |
} | |
' > src/foo/bar/A.java; | |
echo ' | |
package foo.bar; | |
class B extends A { | |
} | |
' > src/foo/bar/B.java; | |
echo ' | |
java_library( | |
name = "A_as_resource", | |
resources = ["A.java"], | |
) | |
java_library( | |
name = "B_only", | |
srcs = ["B.java"], | |
deps = [ | |
":A_as_resource", | |
], | |
) | |
' > src/foo/bar/BUCK; | |
buck build -v 10 //src/foo/bar:B_only |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment