Package com.github.maven_nar.cpptasks.compiler

Examples of com.github.maven_nar.cpptasks.compiler.CompilerConfiguration


        assertTrue(hasSame);
        hasSame = targetInfo.getSources()[0].equals(new File("boo.far"));
        assertEquals(hasSame, false);
    }
    public void testMustRebuild() {
        CompilerConfiguration config = new DummyConfiguration();
        TargetInfo targetInfo = new TargetInfo(config, new File[]{new File(
                "FoO.BaR")}, null, new File("foo.o"), false);
        assertEquals(false, targetInfo.getRebuild());
        targetInfo.mustRebuild();
        assertEquals(true, targetInfo.getRebuild());
View Full Code Here


                Vector targetsForConfig = (Vector) targetVectorEnum
                        .next();
                //
                //    get the configuration from the first entry
                //
                CompilerConfiguration config = (CompilerConfiguration) ((TargetInfo) targetsForConfig
                        .elementAt(0)).getConfiguration();
                if (config.isPrecompileGeneration()) {
                    targetVectors[index++] = targetsForConfig;
                }
            }
            targetVectorEnum = targetsByConfig.values().iterator();
            while (targetVectorEnum.hasNext()) {
                Vector targetsForConfig = (Vector) targetVectorEnum
                        .next();
                for (int i = 0; i < targetVectors.length; i++) {
                    if (targetVectors[i] == targetsForConfig) {
                        break;
                    }
                    if (targetVectors[i] == null) {
                        targetVectors[i] = targetsForConfig;
                        break;
                    }
                }
            }
            // BEGINFREEHEP
            Progress progress = new Progress(getObjdir(), rebuildCount);
            progress.start();
            // ENDFREEHEP
           
            for (int i = 0; i < targetVectors.length; i++) {
                //
                //    get the targets for this configuration
                //
                Vector targetsForConfig = targetVectors[i];
                //
                //    get the configuration from the first entry
                //
                CompilerConfiguration config = (CompilerConfiguration) ((TargetInfo) targetsForConfig
                        .elementAt(0)).getConfiguration();
                //
                //    prepare the list of source files
                //
               
View Full Code Here

  /**
   * Test that a target with no existing object file is
   *    returned by getTargetsToBuildByConfiguration.
   */
  public void testGetTargetsToBuildByConfiguration1() {
    CompilerConfiguration config1 = new CommandLineCompilerConfiguration(
        (GccCCompiler) GccCCompiler.getInstance(), "dummy",
        new File[0], new File[0], new File[0], "", new String[0],
        new ProcessorParam[0], true, new String[0]);
    TargetInfo target1 = new TargetInfo(config1, new File[] {new File(
        "src/foo.bar")}
View Full Code Here

   * Test that a target that is up to date is not returned by
   *           getTargetsToBuildByConfiguration.
   *
   */
  public void testGetTargetsToBuildByConfiguration2() {
    CompilerConfiguration config1 = new CommandLineCompilerConfiguration(
        (GccCCompiler) GccCCompiler.getInstance(), "dummy",
        new File[0], new File[0], new File[0], "", new String[0],
        new ProcessorParam[0], false, new String[0]);
    //
    //    target doesn't need to be rebuilt
View Full Code Here

            int dependencyDepth) {
        //    look at any files where the compositeLastModified
        //    is not known, but the includes are known
        //
        boolean mustRebuild = false;
        CompilerConfiguration compiler = (CompilerConfiguration) target
                .getConfiguration();
        String includePathIdentifier = compiler.getIncludePathIdentifier();
        File[] sources = target.getSources();
        DependencyInfo[] dependInfos = new DependencyInfo[sources.length];
        long outputLastModified = target.getOutput().lastModified();
        //
        //   try to solve problem using existing dependency info
View Full Code Here

            fail("Should throw exception for null compiler");
        } catch (NullPointerException ex) {
        }
    }
    public void testGetIdentifier() {
        CompilerConfiguration config = create();
        String id = config.getIdentifier();
        assertEquals("dummy", id);
    }
View Full Code Here

        CompilerConfiguration config = create();
        String id = config.getIdentifier();
        assertEquals("dummy", id);
    }
    public void testToString() {
        CompilerConfiguration config = create();
        String toString = config.toString();
        assertEquals("dummy", toString);
    }
View Full Code Here

    protected abstract CompilerConfiguration create();
    public String getObjectFileExtension() {
        return ".o";
    }
    public void testBid() {
        CompilerConfiguration compiler = create();
        int bid = compiler.bid("c:/foo\\bar\\hello.c");
        assertEquals(100, bid);
        bid = compiler.bid("c:/foo\\bar/hello.c");
        assertEquals(100, bid);
        bid = compiler.bid("c:/foo\\bar\\hello.h");
        assertEquals(1, bid);
        bid = compiler.bid("c:/foo\\bar/hello.h");
        assertEquals(1, bid);
        bid = compiler.bid("c:/foo\\bar/hello.pas");
        assertEquals(0, bid);
        bid = compiler.bid("c:/foo\\bar/hello.java");
        assertEquals(0, bid);
    }
View Full Code Here

        assertEquals(0, bid);
        bid = compiler.bid("c:/foo\\bar/hello.java");
        assertEquals(0, bid);
    }
    public void testGetOutputFileName1() {
        CompilerConfiguration compiler = create();
        String input = "c:/foo\\bar\\hello.c";
        //
        //  may cause IllegalStateException since
        //     setPlatformInfo has not been called
        try {
            String[] output = compiler.getOutputFileNames(input, null);
        } catch (java.lang.IllegalStateException ex) {
        }
    }
View Full Code Here

            String[] output = compiler.getOutputFileNames(input, null);
        } catch (java.lang.IllegalStateException ex) {
        }
    }
    public void testGetOutputFileName2() {
        CompilerConfiguration compiler = create();
        String[] output = compiler.getOutputFileNames("c:/foo\\bar\\hello.c", null);
        assertEquals("hello" + getObjectFileExtension(), output[0]);
        output = compiler.getOutputFileNames("c:/foo\\bar/hello.c", null);
        assertEquals("hello" + getObjectFileExtension(), output[0]);
        output = compiler.getOutputFileNames("hello.c", null);
        assertEquals("hello" + getObjectFileExtension(), output[0]);
        output = compiler.getOutputFileNames("c:/foo\\bar\\hello.h", null);
        assertEquals(0, output.length);
        output = compiler.getOutputFileNames("c:/foo\\bar/hello.h", null);
        assertEquals(0, output.length);
    }
View Full Code Here

TOP

Related Classes of com.github.maven_nar.cpptasks.compiler.CompilerConfiguration

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.