Skip to content

Commit

Permalink
Issue #147: Support module-path for ECJ
Browse files Browse the repository at this point in the history
Simply add the path from the CompilerConfiguration to the command-line
arguments.

Also fix the --processor-module-path argument.
  • Loading branch information
tomaswolf authored and slachiewicz committed Nov 21, 2021
1 parent 9dff918 commit 7f7b0f3
Showing 1 changed file with 13 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ public CompilerResult performCompile( CompilerConfiguration config )
{
args.add( "-parameters" );
}

if(config.isFailOnWarning())
{
args.add("-failOnWarning");
Expand Down Expand Up @@ -184,9 +184,9 @@ public CompilerResult performCompile( CompilerConfiguration config )
String[] annotationProcessors = config.getAnnotationProcessors();
List<String> processorPathEntries = config.getProcessorPathEntries();
List<String> processorModulePathEntries = config.getProcessorModulePathEntries();
if ( ( annotationProcessors != null && annotationProcessors.length > 0 )
|| ( processorPathEntries != null && processorPathEntries.size() > 0 )

if ( ( annotationProcessors != null && annotationProcessors.length > 0 )
|| ( processorPathEntries != null && processorPathEntries.size() > 0 )
|| ( processorModulePathEntries != null && processorModulePathEntries.size() > 0 ) )
{
if ( annotationProcessors != null && annotationProcessors.length > 0 )
Expand All @@ -209,10 +209,10 @@ public CompilerResult performCompile( CompilerConfiguration config )
args.add( "-processorpath" );
args.add( getPathString( processorPathEntries ) );
}

if ( processorModulePathEntries != null && processorModulePathEntries.size() > 0 )
{
args.add( "-processorpath" );
args.add( "--processor-module-path" );
args.add( getPathString( processorModulePathEntries ) );
}

Expand All @@ -229,6 +229,13 @@ public CompilerResult performCompile( CompilerConfiguration config )
args.add( "-classpath" );
args.add( getPathString( classpathEntries ) );

List<String> modulepathEntries = config.getModulepathEntries();
if ( modulepathEntries != null && !modulepathEntries.isEmpty() )
{
args.add( "--module-path" );
args.add( getPathString( modulepathEntries ) );
}

// Collect sources
List<String> allSources = new ArrayList<>();
for ( String source : config.getSourceLocations() )
Expand Down

0 comments on commit 7f7b0f3

Please sign in to comment.