}
// add defines
if ( defines != null )
{
DefineSet ds = new DefineSet();
for ( Iterator i = defines.iterator(); i.hasNext(); )
{
DefineArgument define = new DefineArgument();
String[] pair = ( (String) i.next() ).split( "=", 2 );
define.setName( pair[0] );
define.setValue( pair.length > 1 ? pair[1] : null );
ds.addDefine( define );
}
compiler.addConfiguredDefineset( ds );
}
if ( defineSet != null )
{
String[] defList = defineSet.split( "," );
DefineSet defSet = new DefineSet();
for ( int i = 0; i < defList.length; i++ )
{
String[] pair = defList[i].trim().split( "=", 2 );
DefineArgument def = new DefineArgument();
def.setName( pair[0] );
def.setValue( pair.length > 1 ? pair[1] : null );
defSet.addDefine( def );
}
compiler.addConfiguredDefineset( defSet );
}
if ( !clearDefaultDefines )
{
DefineSet ds = new DefineSet();
String defaultDefines = NarProperties.getInstance(mojo.getMavenProject()).getProperty( getPrefix() + "defines" );
if ( defaultDefines != null )
{
ds.setDefine( new CUtil.StringArrayBuilder( defaultDefines ) );
}
compiler.addConfiguredDefineset( ds );
}
// add undefines
if ( undefines != null )
{
DefineSet us = new DefineSet();
for ( Iterator i = undefines.iterator(); i.hasNext(); )
{
DefineArgument undefine = new DefineArgument();
String[] pair = ( (String) i.next() ).split( "=", 2 );
undefine.setName( pair[0] );
undefine.setValue( pair.length > 1 ? pair[1] : null );
us.addUndefine( undefine );
}
compiler.addConfiguredDefineset( us );
}
if ( undefineSet != null )
{
String[] undefList = undefineSet.split( "," );
DefineSet undefSet = new DefineSet();
for ( int i = 0; i < undefList.length; i++ )
{
String[] pair = undefList[i].trim().split( "=", 2 );
DefineArgument undef = new DefineArgument();
undef.setName( pair[0] );
undef.setValue( pair.length > 1 ? pair[1] : null );
undefSet.addUndefine( undef );
}
compiler.addConfiguredDefineset( undefSet );
}
if ( !clearDefaultUndefines )
{
DefineSet us = new DefineSet();
String defaultUndefines = NarProperties.getInstance(mojo.getMavenProject()).getProperty( getPrefix() + "undefines" );
if ( defaultUndefines != null )
{
us.setUndefine( new CUtil.StringArrayBuilder( defaultUndefines ) );
}
compiler.addConfiguredDefineset( us );
}
// add include path