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

review Add a new warning in verifySourceClasspath #1937

Merged
merged 3 commits into from
Apr 4, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/main/java/spoon/compiler/Environment.java
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,8 @@ void report(Processor<?> processor, Level level,
/**
* Sets the source class path of the Spoon model.
* After the class path is set, it can be retrieved by
* {@link #getSourceClasspath()}. Only .jar files or directories
* are accepted.
* {@link #getSourceClasspath()}. Only .jar files or directories with *.class files are accepted.
* The *.jar or *.java files contained in given directories are ignored.
*
* @throws InvalidClassPathException if a given classpath does not exists or
* does not have the right format (.jar file or directory)
Expand Down
1 change: 1 addition & 0 deletions src/main/java/spoon/support/StandardEnvironment.java
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,7 @@ private void verifySourceClasspath(String[] sourceClasspath) throws InvalidClass
if (javaFiles.size() > 0) {
logger.warn("You're trying to give source code in the classpath, this should be given to " + "addInputSource " + javaFiles);
}
logger.warn("You specified the directory " + classOrJarFolder.getPath() + " in source classpath, please note that only class files will be considered. Jars and subdirectories will be ignored.");
} else if (classOrJarFolder.getName().endsWith(".class")) {
throw new InvalidClassPathException(".class files are not accepted in source classpath.");
}
Expand Down