Package com.github.maven_nar.cpptasks.types

Examples of com.github.maven_nar.cpptasks.types.LibrarySet


        assertEquals(libdirSwitch.substring(libdirSwitch.length() - 3), "foo");
    }
    public void testAddLibrarySetLibSwitch() {
        AbstractLdLinker linker = getLinker();
        CCTask task = new CCTask();
        LibrarySet[] sets = new LibrarySet[]{new LibrarySet()};
        /* throws an Exception in setLibs otherwise */
        sets[0].setProject(new org.apache.tools.ant.Project());
        sets[0].setDir(new File("/foo"));
        sets[0].setLibs(new CUtil.StringArrayBuilder("bart,cart,dart"));
        Vector preargs = new Vector();
View Full Code Here


    }
    public void testAddLibrarySetLibFrameworkNonDarwin() {
        System.setProperty("os.name", "VAX/VMS");
        AbstractLdLinker linker = getLinker();
        CCTask task = new CCTask();
        LibrarySet[] sets = new LibrarySet[]{new LibrarySet()};
        /* throws an Exception in setLibs otherwise */
        sets[0].setProject(new org.apache.tools.ant.Project());
        sets[0].setDir(new File("/foo"));
        LibraryTypeEnum libType = new LibraryTypeEnum();
        libType.setValue("framework");
View Full Code Here

    }
    public void testAddLibrarySetLibFrameworkDarwin() {
        System.setProperty("os.name", "Mac OS X");
        AbstractLdLinker linker = getLinker();
        CCTask task = new CCTask();
        LibrarySet[] sets = new LibrarySet[]{new LibrarySet()};
        /* throws an Exception in setLibs otherwise */
        sets[0].setProject(new org.apache.tools.ant.Project());
        sets[0].setDir(new File("/foo"));
        LibraryTypeEnum libType = new LibraryTypeEnum();
        libType.setValue("framework");
View Full Code Here

    }
    public void testAddLibraryStatic() {
        AbstractLdLinker linker = getLinker();
        CCTask task = new CCTask();
        LibrarySet[] sets = new LibrarySet[]{
            new LibrarySet(),
        new LibrarySet(),
        new LibrarySet()};
        /* throws an Exception in setLibs otherwise */
        sets[0].setProject(new org.apache.tools.ant.Project());
        sets[0].setLibs(new CUtil.StringArrayBuilder("bart"));
        sets[1].setProject(new org.apache.tools.ant.Project());
        sets[1].setLibs(new CUtil.StringArrayBuilder("cart"));
View Full Code Here

// ENDFREEHEP
    }
    public void testLibReturnValue() {
        AbstractLdLinker linker = getLinker();
        CCTask task = new CCTask();
        LibrarySet[] sets = new LibrarySet[]{new LibrarySet()};
        /* throws an Exception in setLibs otherwise */
        sets[0].setProject(new org.apache.tools.ant.Project());
        sets[0].setDir(new File("/foo"));
        sets[0].setLibs(new CUtil.StringArrayBuilder("bart,cart,dart"));
        Vector preargs = new Vector();
View Full Code Here

            Vector preargs, Vector midargs, Vector endargs) {
        Vector libnames = new Vector();
        super.addLibrarySets(task, libsets, preargs, midargs, endargs);
        LibraryTypeEnum previousLibraryType = null;
        for (int i = 0; i < libsets.length; i++) {
            LibrarySet set = libsets[i];
            File libdir = set.getDir(null);
            String[] libs = set.getLibs();
            if (libdir != null) {
                    String relPath = libdir.getAbsolutePath();
                    //File outputFile = task.getOutfile();
                    File currentDir = new File(".");
                    if (currentDir != null && currentDir.getParentFile() != null) {
                        relPath = CUtil.getRelativePath(
                            currentDir.getParentFile().getAbsolutePath(), libdir);
                    }
                    if (set.getType() != null &&
                                    "framework".equals(set.getType().getValue()) &&
                                                isDarwin()) {
                            endargs.addElement("-F" + relPath);
                    } else {
                            endargs.addElement("-L" + relPath);
                    }
            }
            //
            //  if there has been a change of library type
            //
            if (set.getType() != previousLibraryType) {
                    if (set.getType() != null && "static".equals(set.getType().getValue())) {
// BEGINFREEHEP not on MacOS X
                      if (!isDarwin()) {
                            endargs.addElement(getStaticLibFlag());
                            previousLibraryType = set.getType();
                      }
//ENDFREEHEP                         
                    } else {
// FREEHEP not on MacOS X, recheck this!
                            if (set.getType() == null ||
                                            !"framework".equals(set.getType().getValue()) &&
                                                        !isDarwin()) {
                                    endargs.addElement(getDynamicLibFlag());
                                    previousLibraryType = set.getType();
                            }
                    }
            }
            StringBuffer buf = new StringBuffer("-l");
            if (set.getType() != null &&
                            "framework".equals(set.getType().getValue()) &&
                                        isDarwin()) {
                    buf.setLength(0);
// FREEHEP, added as endarg w/o trailing space to avoid quoting!
                    endargs.addElement("-framework");
            }
View Full Code Here

TOP

Related Classes of com.github.maven_nar.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.