Skip to content
Merged
Changes from all commits
Commits
File filter

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 @@ -44,6 +44,7 @@
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
Expand All @@ -66,6 +67,8 @@ public class CSharpCompiler
private static final String ARGUMENTS_FILE_NAME = "csharp-arguments";

private static final String[] DEFAULT_INCLUDES = { "**/**" };

private Map<String, String> compilerArguments;

// ----------------------------------------------------------------------
//
Expand Down Expand Up @@ -142,6 +145,40 @@ public String[] createCommandLine( CompilerConfiguration config )
//
// ----------------------------------------------------------------------

private Map<String, String> getCompilerArguments( CompilerConfiguration config )
{
if (compilerArguments != null)
{
return compilerArguments;
}

compilerArguments = config.getCustomCompilerArgumentsAsMap();

Iterator<String> i = compilerArguments.keySet().iterator();

while ( i.hasNext() )
{
String orig = i.next();
String v = compilerArguments.get( orig );
if ( orig.contains( ":" ) && v == null )
{
String[] arr = orig.split( ":" );
i.remove();
String k = arr[0];
v = arr[1];
compilerArguments.put( k, v );
if ( config.isDebug() )
{
System.out.println( "transforming argument from " + orig + " to " + k + " = [" + v + "]" );
}
}
}

config.setCustomCompilerArgumentsAsMap( compilerArguments );

return compilerArguments;
}

private String findExecutable( CompilerConfiguration config )
{
String executable = config.getExecutable();
Expand Down Expand Up @@ -267,7 +304,7 @@ private String[] buildCompilerArguments( CompilerConfiguration config, String[]
// Main class
// ----------------------------------------------------------------------

Map<String, String> compilerArguments = config.getCustomCompilerArguments();
Map<String, String> compilerArguments = getCompilerArguments( config );

String mainClass = compilerArguments.get( "-main" );

Expand Down Expand Up @@ -399,7 +436,9 @@ private File findResourceDir( CompilerConfiguration config )
{
System.out.println( "Looking for resourcesDir" );
}
Map<String, String> compilerArguments = config.getCustomCompilerArguments();

Map<String, String> compilerArguments = getCompilerArguments( config );

String tempResourcesDirAsString = (String) compilerArguments.get( "-resourceDir" );
File filteredResourceDir = null;
if ( tempResourcesDirAsString != null )
Expand Down