Package net.sf.antcontrib.cpptasks.types

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


    {  
    if (!type.equals("framework") && (dir == null))
        {
      throw new MojoFailureException("NAR: Please specify <Directory> as part of <Lib> for library \"" + name + "\"");
    }
    LibrarySet libSet = new LibrarySet();
    libSet.setProject(antProject);
    libSet.setLibs(new CUtil.StringArrayBuilder(name));
    LibraryTypeEnum libType = new LibraryTypeEnum();
    libType.setValue(type);
    libSet.setType(libType);
    libSet.setDir(dir);
    linker.addLibset(libSet);
  }
View Full Code Here


                    File dir =
                        getLayout().getLibDirectory( unpackDirectory, dependency.getArtifactId(),
                                                     dependency.getVersion(), aol.toString(), binding );
          getLog().debug("Looking for Library Directory: " + dir);
          if (dir.exists()) {
            LibrarySet libSet = new LibrarySet();
            libSet.setProject(antProject);

            // FIXME, no way to override
            String libs = dependency.getNarInfo().getLibs(getAOL());
            if ((libs != null) && !libs.equals("")) {
              getLog().debug("Using LIBS = " + libs);
              libSet.setLibs(new CUtil.StringArrayBuilder(libs));
              libSet.setDir(dir);
              task.addLibset(libSet);
            }
          } else {
            getLog()
                .debug(
View Full Code Here

                                                     dependency.getVersion(), aol.toString(), binding );

                    getLog().debug("Looking for Library Directory: " + dir);
                    if ( dir.exists() )
                    {
                        LibrarySet libSet = new LibrarySet();
                        libSet.setProject(antProject);

                        // FIXME, no way to override
                        String libs = dependency.getNarInfo().getLibs(getAOL());
                        if ( ( libs != null ) && !libs.equals( "" ) )
                        {
                            getLog().debug("Using LIBS = " + libs);
                            libSet.setLibs(new CUtil.StringArrayBuilder(libs));
                            libSet.setDir(dir);
                            task.addLibset(libSet);
                        }
                    }
                    else
                    {
View Full Code Here

        for ( int i = 0; i < lib.length; i++ )
        {

            String[] libInfo = lib[i].trim().split( ":", 3 );

            LibrarySet librarySet = new LibrarySet();

            if ( isSystem )
            {
                librarySet = new SystemLibrarySet();
            }

            librarySet.setProject( antProject );
            librarySet.setLibs( new CUtil.StringArrayBuilder( libInfo[0] ) );

            if ( libInfo.length > 1 )
            {

                LibraryTypeEnum libType = new LibraryTypeEnum();

                libType.setValue( libInfo[1] );
                librarySet.setType( libType );

                if ( !isSystem && ( libInfo.length > 2 ) )
                {
                    librarySet.setDir( new File( libInfo[2] ) );
                }
            }

            if ( !isSystem )
            {
View Full Code Here

        }

        // add library of this package
        if ( libDir.exists() )
        {
            LibrarySet libSet = new LibrarySet();
            libSet.setProject( antProject );
            libSet.setLibs( new CUtil.StringArrayBuilder( libName ) );
            LibraryTypeEnum libType = new LibraryTypeEnum();
            libType.setValue( test.getLink() );
            libSet.setType( libType );
            libSet.setDir( libDir );
            task.addLibset( libSet );
        }

        // add dependency libraries
        List depLibOrder = getDependencyLibOrder();
        List depLibs = getNarManager().getNarDependencies( "test" );

        // reorder the libraries that come from the nar dependencies
        // to comply with the order specified by the user
        if ( ( depLibOrder != null ) && !depLibOrder.isEmpty() )
        {

            List tmp = new LinkedList();

            for ( Iterator i = depLibOrder.iterator(); i.hasNext(); )
            {

                String depToOrderName = (String) i.next();

                for ( Iterator j = depLibs.iterator(); j.hasNext(); )
                {

                    NarArtifact dep = (NarArtifact) j.next();
                    String depName = dep.getGroupId() + ":" + dep.getArtifactId();

                    if ( depName.equals( depToOrderName ) )
                    {

                        tmp.add( dep );
                        j.remove();
                    }
                }
            }

            tmp.addAll( depLibs );
            depLibs = tmp;
        }

        for ( Iterator i = depLibs.iterator(); i.hasNext(); )
        {
            NarArtifact dependency = (NarArtifact) i.next();

            // FIXME no handling of "local"

            // FIXME, no way to override this at this stage
            String binding = dependency.getNarInfo().getBinding( getAOL(), Library.NONE );
            getLog().debug( "Using Binding: " + binding );
            AOL aol = getAOL();
            aol = dependency.getNarInfo().getAOL( getAOL() );
            getLog().debug( "Using Library AOL: " + aol.toString() );

            if ( !binding.equals( Library.JNI ) && !binding.equals( Library.NONE ) )
            {
                // check if it exists in the normal unpack directory
                File dir =
                    getLayout().getLibDirectory( getUnpackDirectory(), dependency.getArtifactId(),
                                                  dependency.getVersion(), aol.toString(), binding );
                getLog().debug( "Looking for Library Directory: " + dir );
                if ( !dir.exists() )
                {
                    getLog().debug( "Library Directory " + dir + " does NOT exist." );

                    // otherwise try the test unpack directory
                    dir = getLayout().getLibDirectory( getTestUnpackDirectory(), dependency.getArtifactId(),
                                                        dependency.getVersion(), aol.toString(), binding );
                    getLog().debug( "Looking for Library Directory: " + dir );
                }
                if ( dir.exists() )
                {
                    LibrarySet libSet = new LibrarySet();
                    libSet.setProject( antProject );

                    // FIXME, no way to override
                    String libs = dependency.getNarInfo().getLibs( getAOL() );
                    if ( ( libs != null ) && !libs.equals( "" ) )
                    {
                        getLog().debug( "Using LIBS = " + libs );
                        libSet.setLibs( new CUtil.StringArrayBuilder( libs ) );
                        libSet.setDir( dir );
                        task.addLibset( libSet );
                    }
                }
                else
                {
View Full Code Here

                        throw new MojoFailureException( "NAR: Please specify a <RuntimeDirectory> as part of <Java>" );
                    }
                }
                mojo.getLog().debug( "Using Java Runtime Directory: " + runtimeDirectory );

                LibrarySet libset = new LibrarySet();
                libset.setProject( mojo.getAntProject() );
                libset.setLibs( new CUtil.StringArrayBuilder( runtime ) );
                libset.setDir( new File( javaHome, runtimeDirectory ) );
                task.addLibset( libset );
            }
        }
    }
View Full Code Here

    }
    private void addActiveLibrarySet(Project project, Vector libsets,
            Vector srcSets) {
        Enumeration srcenum = srcSets.elements();
        while (srcenum.hasMoreElements()) {
            LibrarySet set = (LibrarySet) srcenum.nextElement();
            if (set.isActive(project)) {
                libsets.addElement(set);
            }
        }
    }
View Full Code Here

                extendsDef.visitSystemLibraries(linker, libraryVisitor);
            }
            if (sysLibrarySets.size() > 0) {
                File[] libpath = linker.getLibraryPath();
                for (int i = 0; i < sysLibrarySets.size(); i++) {
                    LibrarySet set = (LibrarySet) sysLibrarySets.elementAt(i);
                    if (set.isActive(p)) {
                        set.visitLibraries(p, linker, libpath,
                                libraryVisitor);
                    }
                }
            }
        }
View Full Code Here

            //   visit the user libraries
            //
            if (librarySets.size() > 0) {
                File[] libpath = linker.getLibraryPath();
                for (int i = 0; i < librarySets.size(); i++) {
                    LibrarySet set = (LibrarySet) librarySets.elementAt(i);
                    if (set.isActive(p)) {
                        set.visitLibraries(p, linker, libpath,
                                libraryVisitor);
                    }
                }
            }
        }
View Full Code Here

    public String[] addLibrarySets(CCTask task, LibrarySet[] libsets,
            Vector preargs, Vector midargs, Vector endargs) {
        super.addLibrarySets(task, libsets, preargs, midargs, endargs);
        StringBuffer buf = new StringBuffer("-l");
        for (int i = 0; i < libsets.length; i++) {
            LibrarySet set = libsets[i];
            File libdir = set.getDir(null);
            String[] libs = set.getLibs();
            if (libdir != null) {
                endargs.addElement("-L");
                endargs.addElement(libdir.getAbsolutePath());
            }
            for (int j = 0; j < libs.length; j++) {
View Full Code Here

TOP

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

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.