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

fix: --processor-module-path behaviour with absolut sourcepath #133

Closed
wants to merge 1 commit into from
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ public static String[] buildCompilerArguments( CompilerConfiguration config, Str
}
if ( config.getProcessorPathEntries() != null && !config.getProcessorPathEntries().isEmpty() ) {

if(!isPreJava9(config) && Arrays.asList(sourceFiles).contains("module-info.java")){
if(!isPreJava9(config) && containsModuleInfo(sourceFiles)){
args.add( "--processor-module-path" );

} else {
Expand Down Expand Up @@ -531,6 +531,19 @@ private static boolean isPreJava9( CompilerConfiguration config )
|| v.startsWith( "1.3" ) || v.startsWith( "1.2" ) || v.startsWith( "1.1" ) || v.startsWith( "1.0" );
}

/**
* Check if a list of paths contains a module-info.java file
* @param sourceFiles list of source files
* @return true if a module-info.java is contained
*/
private static boolean containsModuleInfo(String[] sourceFiles){
for (String sourceFile : sourceFiles) {
if (sourceFile.endsWith("module-info.java")) {
return true;
}
}
return false;
}

private static boolean suppressSource( CompilerConfiguration config )
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ public void testModulePathAnnotations() throws Exception

CompilerConfiguration compilerConfiguration = new CompilerConfiguration();

final String[] source = {"module-info.java"};
final String[] source = {"/src/main/one/module-info.java"};

// outputLocation
compilerConfiguration.setOutputLocation( "/output" );
Expand Down