Package net.sf.antcontrib.cpptasks.types

Examples of net.sf.antcontrib.cpptasks.types.DefineSet


        }

        // 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
View Full Code Here


    if (cpp != null) {
      task.addConfiguredCompiler(cpp);
    }
   
    // add VCPROJ_MOJO def (see UnitTestDriverImpl.cpp generated by Krusoe plugin)
    DefineSet defineSet = new DefineSet();
    DefineArgument defineArgument = new DefineArgument();
    defineArgument.setName("VCPROJ_MOJO");
    defineSet.addDefine(defineArgument);
    cpp.addConfiguredDefineset(defineSet);
   
   
    // add javah include path
    File jniDirectory = getJavah().getJniDirectory();
View Full Code Here

            return ((CompilerDef) getCheckedRef(CompilerDef.class,
                    "CompilerDef")).getActiveDefines();
        }
        Vector actives = new Vector();
        for (int i = 0; i < defineSets.size(); i++) {
            DefineSet currentSet = (DefineSet) defineSets.elementAt(i);
            UndefineArgument[] defines = currentSet.getDefines();
            for (int j = 0; j < defines.length; j++) {
                if (defines[j].isActive(p)) {
                    actives.addElement(defines[j]);
                }
            }
View Full Code Here

TOP

Related Classes of net.sf.antcontrib.cpptasks.types.DefineSet

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.