plexus-compiler icon indicating copy to clipboard operation
plexus-compiler copied to clipboard

Allow Argument Files

Open nipafx opened this issue 8 years ago • 1 comments

It is currently not possible to pass argument files to javac like so:

<plugin>
	<groupId>org.apache.maven.plugins</groupId>
	<artifactId>maven-compiler-plugin</artifactId>
	<configuration>
		<compilerArgs>
			<!-- NOPE! 😢 -->
			<arg>@somefile</arg>
		</compilerArgs>
	</configuration>
</plugin>

The reason is that JavacCompiler creates its own temporary argument file, including @somefile but recursive @s are not supported by javac. The obvious (only?) solution would be to give the compiler a separate option for argument files that are not included into the temporary one, e.g:

<plugin>
	<groupId>org.apache.maven.plugins</groupId>
	<artifactId>maven-compiler-plugin</artifactId>
	<configuration>
		<!-- strawman syntax! -->
		<compilerArgFiles>
			<argFile>@somefile</argFile>
		</compilerArgs>
	</configuration>
</plugin>

nipafx avatar Apr 14 '17 06:04 nipafx

If that's helpful I could give this a shot myself. For that I would need advice which syntax to use. I can see two variants:

  1. <configuration>
    	<compilerArgFiles>
    		<argFile>@foofile</argFile>
    		<argFile>@barfile</argFile>
    	</compilerArgs>
    </configuration>
    
  2. <configuration>
    	<compilerArgFiles>@foofile @barfile</compilerArgs>
    </configuration>
    

I assume the former is the way to go?

nipafx avatar Apr 14 '17 06:04 nipafx