From 1f9c13e7214ceab0b2aacbc52edb5284987c6dde Mon Sep 17 00:00:00 2001 From: Mark Harrah Date: Fri, 17 Sep 2010 21:38:40 -0400 Subject: [PATCH] Rework external dependency tracking and multi-projects Reduce AnalysisCallback interface: remove discovery simplify dependency notification methods Use map of classpath entry to Analysis for locating source API for external dependencies Handle classpath changes by locating class on classpath and either locating Analysis/Source as above or comparing Stamp. This requires storing the class name of a binary dependency now. Make this process aware of full classpath, including boot classpath --- .../src/main/java/xsbti/AnalysisCallback.java | 28 ++----------------- 1 file changed, 3 insertions(+), 25 deletions(-) diff --git a/interface/src/main/java/xsbti/AnalysisCallback.java b/interface/src/main/java/xsbti/AnalysisCallback.java index 03c4798c9..d3eb2ab54 100644 --- a/interface/src/main/java/xsbti/AnalysisCallback.java +++ b/interface/src/main/java/xsbti/AnalysisCallback.java @@ -7,43 +7,21 @@ import java.io.File; public interface AnalysisCallback { - /** The names of classes that the analyzer should find subclasses of.*/ - public String[] superclassNames(); - /** The names of annotations that the analyzer should look for on methods and classes.*/ - public String[] annotationNames(); - /** Called when the the given superclass could not be found on the classpath by the compiler.*/ - public void superclassNotFound(String superclassName); /** Called before the source at the given location is processed. */ public void beginSource(File source); - /** Called when the a subclass of one of the classes given in superclassNames is - * discovered.*/ - public void foundSubclass(File source, String subclassName, String superclassName, boolean isModule); - /** Called when an annotation with name annotationName is found on a class or one of its methods.*/ - public void foundAnnotated(File source, String className, String annotationName, boolean isModule); /** Called to indicate that the source file source depends on the source file * dependsOn. Note that only source files included in the current compilation will * passed to this method. Dependencies on classes generated by sources not in the current compilation will * be passed as class dependencies to the classDependency method.*/ public void sourceDependency(File dependsOn, File source); - /** Called to indicate that the source file source depends on the jar - * jar.*/ - public void jarDependency(File jar, File source); - /** Called to indicate that the source file source depends on the class file - * clazz.*/ - public void classDependency(File clazz, File source); - /** Called to indicate that the source file sourcePath depends on the class file - * classFile that is a product of some source. This differs from classDependency - * because it is really a sourceDependency. The source corresponding to classFile - * was not incuded in the compilation so the plugin doesn't know what the source is though. It - * only knows that the class file came from the output directory.*/ - public void productDependency(File classFile, File sourcePath); + /** Called to indicate that the source file source depends on the top-level + * class named name from class or jar file binary. */ + public void binaryDependency(File binary, String name, File source); /** Called to indicate that the source file source produces a class file at * module.*/ public void generatedClass(File source, File module); /** Called after the source at the given location has been processed. */ public void endSource(File sourcePath); - /** Called when a module with a public 'main' method with the right signature is found.*/ - public void foundApplication(File source, String className); /** Called when the public API of a source file is extracted. */ public void api(File sourceFile, xsbti.api.Source source); } \ No newline at end of file