Package org.moxie

Examples of org.moxie.BuildConfig


      }
     
      // parse the config files and Moxie settings
      build = new Build(configFile, basedir);
     
      BuildConfig buildConfig = build.getConfig();
      buildConfig.setVerbose(isVerbose());
     
      // set any external properties into the project
      for (Map.Entry<String, String> entry : buildConfig.getExternalProperties().entrySet()) {
        getConsole().debug("setting external property {0} = {1}", entry.getKey(), entry.getValue());
        getProject().setProperty(entry.getKey(), entry.getValue());
      }
     
      build.getPom().setAntProperties(antProperties);     

      // add a reference to the full build object
      getProject().addReference(Key.build.referenceId(), build);     

      // output the build info
      build.describe();
     
      build.setup();
     
      if (isVerbose()) {
        getConsole().separator();
        getConsole().log(getProject().getProperty("ant.version"));
        getConsole().log("Moxie Build Toolkit version " + Toolkit.getVersion() + " compiled on " + Toolkit.getBuildDate());
      }

      Pom pom = build.getPom();
     
      // push all pom properties into project
      Map<String,String> properties = pom.getProperties();
      for (Map.Entry<String, String> entry : properties.entrySet()) {
        getProject().setProperty(entry.getKey(), entry.getValue());
      }

      if (isVerbose()) {
        getConsole().separator();
        getConsole().log("project properties");
      }
     
      setProjectProperty(Key.name, pom.name);
      setProjectProperty(Key.description, pom.description);
      setProjectProperty(Key.groupId, pom.groupId);
      setProjectProperty(Key.artifactId, pom.artifactId);
      setProjectProperty(Key.version, pom.version);
      setProjectProperty(Key.organization, pom.organization);
      setProjectProperty(Key.organizationUrl, pom.organizationUrl);
      setProjectProperty(Key.issuesUrl, pom.issuesUrl);
      setProjectProperty(Key.forumUrl, pom.forumUrl);
      setProjectProperty(Key.socialNetworkUrl, pom.socialNetworkUrl);
      setProjectProperty(Key.blogUrl, pom.blogUrl);
      setProjectProperty(Key.ciUrl, pom.ciUrl);
      setProjectProperty(Key.mavenUrl, pom.mavenUrl);
      setProjectProperty(Key.url, pom.url);
      if (pom.scm != null) {
        setProjectProperty(Key.scmUrl, pom.scm.url);
      }
      setProjectProperty(Key.mainclass, buildConfig.getProjectConfig().getMainclass());
      setProjectProperty(Key.releaseVersion, buildConfig.getPom().releaseVersion);
      setProjectProperty(Key.releaseDate, build.getReleaseDateString());
      setProjectProperty(Key.buildDate, build.getBuildDateString());
      setProjectProperty(Key.buildTimestamp, build.getBuildTimestamp());

      setReference(Key.buildDate, build.getBuildDate());
      setReference(Key.releaseDate, build.getReleaseDate());

      setProjectProperty(Key.outputDirectory, buildConfig.getOutputDirectory(null).toString());
      setProjectProperty(Key.compileOutputDirectory, buildConfig.getOutputDirectory(Scope.compile).toString());
      setProjectProperty(Key.testOutputDirectory, buildConfig.getOutputDirectory(Scope.test).toString());

      setProjectProperty(Key.targetDirectory, buildConfig.getTargetDirectory().toString());
      setProjectProperty(Key.reportTargetDirectory, buildConfig.getReportsTargetDirectory().toString());
      setProjectProperty(Key.javadocTargetDirectory, buildConfig.getJavadocTargetDirectory().toString());
     
      setProjectProperty(Key.siteSourceDirectory, buildConfig.getSiteSourceDirectory().toString());
      setProjectProperty(Key.siteTargetDirectory, buildConfig.getSiteTargetDirectory().toString());

      if (isVerbose()) {
        getConsole().separator();
        getConsole().log("project path properties");
      }
View Full Code Here


    /*
     * Prepare all variables and state.
     */
   
    Build build = getBuild();
    BuildConfig config = build.getConfig();
   
    // generate unit test info into build/tests
    unitTestOutputDirectory = new File(config.getOutputDirectory(null), "tests");
    FileUtils.delete(unitTestOutputDirectory);
    unitTestOutputDirectory.mkdirs();

    // generate unit test info into target/tests
    testReports = new File(config.getReportsTargetDirectory(), "tests");
    FileUtils.delete(testReports);
    testReports.mkdirs();
   
    // instrument classes for code coverages into build/instrumented-classes
    instrumentedBuild = new File(config.getOutputDirectory(null), "instrumented-classes");
    FileUtils.delete(instrumentedBuild);
    instrumentedBuild.mkdirs();

    // generate code coverage report into target/coverage
    coverageReports = new File(config.getReportsTargetDirectory(), "coverage");
    FileUtils.delete(coverageReports);
    coverageReports.mkdirs();

    // delete Corbertura metadata
    coberturaData = new File(config.getOutputDirectory(null), "cobertura.ser");
    coberturaData.delete();

    // delete EMMA metadata
    emmaData = new File(config.getOutputDirectory(null), "metadata.emma");
    emmaData.delete();

    // delete JaCoCo metadata
    jacocoData = new File(config.getOutputDirectory(null), "jacoco.exec");
    jacocoData.delete();

    classesDirectory = config.getOutputDirectory(Scope.compile);
    testClassesDirectory = config.getOutputDirectory(Scope.test);

    // define the test class fileset
    unitTests = new FileSet();
    unitTests.setProject(getProject());
    unitTests.setDir(testClassesDirectory);

    MaxmlMap attributes = config.getTaskAttributes(getTaskName());
    failureProperty = attributes.getString("failureProperty", "unit.test.failed");
    failOnError = attributes.getBoolean("failOnError", false);
    unitTests.createInclude().setName(attributes.getString("include", "**/*Test.class"));

    // classpath for tests
View Full Code Here

      FileUtils.delete(folder);
    }
    folder.mkdirs();
    System.setProperty("mx.root", folder.getAbsolutePath());
    System.out.println("mx.root=" + folder.getAbsolutePath());
    BuildConfig config = new BuildConfig(new File("test.moxie"), null);
    Solver solver = new Solver(new Console(), config);
    return solver;
  }
View Full Code Here

TOP

Related Classes of org.moxie.BuildConfig

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.