2009-07-27 01:15:02 +02:00
|
|
|
# Basic test for Java dependency tracking
|
2011-02-27 02:34:18 +01:00
|
|
|
> 'eval System.setProperty("xsbt.inc.debug", "true")'
|
2009-07-27 01:15:02 +02:00
|
|
|
|
|
|
|
|
# A is a basic Java file with no dependencies. Just a basic check for Java compilation
|
|
|
|
|
$ copy-file changes/A.java src/main/java/a/A.java
|
2010-09-28 00:39:14 +02:00
|
|
|
> compile
|
2009-07-27 01:15:02 +02:00
|
|
|
|
|
|
|
|
# A2 is a basic Java file with no dependencies. This is added to verify
|
|
|
|
|
# that classes are properly mapped back to their source.
|
|
|
|
|
# (There are two files named A.java now, one in a/ and one in a/b)
|
|
|
|
|
$ copy-file changes/A2.java src/main/java/a/b/A.java
|
2010-09-28 00:39:14 +02:00
|
|
|
> compile
|
2009-07-27 01:15:02 +02:00
|
|
|
|
|
|
|
|
# This adds B, another basic Java file with no dependencies
|
|
|
|
|
$ copy-file changes/B1.java src/main/java/a/b/B.java
|
2010-09-28 00:39:14 +02:00
|
|
|
> compile
|
2009-07-27 01:15:02 +02:00
|
|
|
|
|
|
|
|
# Now, modify B so that it depends on a.A
|
|
|
|
|
# This ensures that dependencies on a source not included in the compilation
|
|
|
|
|
# (a/A.java has not changed) are tracked
|
|
|
|
|
$ copy-file changes/B2.java src/main/java/a/b/B.java
|
2010-09-28 00:39:14 +02:00
|
|
|
> compile
|
2009-07-27 01:15:02 +02:00
|
|
|
|
|
|
|
|
# Remove a.b.A and there should be no problem compiling, since B should
|
|
|
|
|
# have recorded a dependency on a.A and not a.b.A
|
|
|
|
|
$ delete src/main/java/a/b/A.java
|
2010-09-28 00:39:14 +02:00
|
|
|
> compile
|
2009-07-27 01:15:02 +02:00
|
|
|
|
|
|
|
|
# Remove a.A and B should be recompiled if the dependency on a.A was properly
|
|
|
|
|
# recorded. This should be a compile error, since we haven't updated B to not
|
|
|
|
|
# depend on A
|
|
|
|
|
$ delete src/main/java/a/A.java
|
2010-09-28 00:39:14 +02:00
|
|
|
-> compile
|
2009-07-27 01:15:02 +02:00
|
|
|
|
|
|
|
|
# Replace B with a new B that doesn't depend on a.A and so it should compile
|
|
|
|
|
# It shouldn't run though, because it doesn't have a main method
|
|
|
|
|
$ copy-file changes/B1.java src/main/java/a/b/B.java
|
2010-09-28 00:39:14 +02:00
|
|
|
> compile
|
2024-09-21 07:07:27 +02:00
|
|
|
-> runBlock
|
2009-07-27 01:15:02 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
# Replace B with a new B that has a main method and should therefore run
|
|
|
|
|
# if the main method was properly detected
|
|
|
|
|
$ copy-file changes/B3.java src/main/java/a/b/B.java
|
2024-09-21 07:07:27 +02:00
|
|
|
> runBlock
|