Package de.matrixweb.smaller.config

Examples of de.matrixweb.smaller.config.ConfigFile


    new File(tempIn, "dir/dir/c.test").createNewFile();
    new File(tempIn, "in").createNewFile();

    final Processor processor = new Processor();
    processor.setSrc("in");
    final ConfigFile configFile = new ConfigFile();
    final Environment env = configFile.getEnvironments().get("first");
    env.setPipeline(new String[] { "processor" });
    env.getProcessors().put("processor", processor);
    env.setProcess("out");

    final byte[] bytes = util.zip(tempIn,
View Full Code Here


    }
  }

  private void registerServlets() {
    try {
      final ConfigFile configFile = ConfigFile.read(this.smallerConfigBundle.getResource(this.config));

      final Manifest manifest = Manifest.fromConfigFile(configFile);
      for (final String envName : configFile.getBuildServer().getEnvironments()) {
        final Environment env = configFile.getEnvironments().get(envName);
        final ProcessDescription processDescription = getProcessDescription(env, manifest);

        final ServiceHolder holder = new ServiceHolder();
        holder.vfs = new VFS();
        setupVfs(holder.vfs, env);
View Full Code Here

        log("Reading config-file: " + this.configFilePath);
        if (!this.configFilePath.exists()) {
          throw new RuntimeException(this.configFilePath.toString());
        }
        final ConfigFile configFile = ConfigFile.read(this.configFilePath);

        final List<String> includedFiles = new ArrayList<String>();
        for (final String envName : configFile.getBuildServer()
            .getEnvironments()) {
          final Environment env = configFile.getEnvironments().get(envName);
          for (final String dir : env.getFiles().getFolder()) {
            copyFirstInputFile(env, dir, temp);

            final String base = new File(this.configFilePath.getParentFile(),
                dir).getAbsolutePath();
View Full Code Here

      try {
        temp.delete();
        temp.mkdirs();

        this.log.info("Reading config-file: " + this.configFilePath);
        final ConfigFile configFile = ConfigFile.read(this.configFilePath);

        final List<String> includedFiles = new ArrayList<String>();
        for (final String envName : configFile.getBuildServer()
            .getEnvironments()) {
          this.log.info("Preparing environment " + envName);
          final Environment env = configFile.getEnvironments().get(envName);
          for (final String dir : env.getFiles().getFolder()) {
            copyFirstInputFile(env, dir, temp);

            File base = new File(dir);
            if (!base.isAbsolute()) {
View Full Code Here

              new File(PlexusTestCase.getBasedir(), "target/smaller-" + file
                  + ".yml"));
          final File testYml = new File(PlexusTestCase.getBasedir(),
              "target/smaller-" + file + ".yml");

          final ConfigFile configFile = ConfigFile.read(testYml);
          configFile.setEnvironments(new HashMap<String, Environment>());
          for (final ProcessDescription processDescription : manifest
              .getProcessDescriptions()) {
            final Environment env = new Environment();
            env.getFiles().setFolder(new String[] { source.getAbsolutePath() });
            final List<String> names = new ArrayList<String>();
            for (final Processor proc : processDescription.getProcessors()) {
              names.add(proc.getName());
            }
            env.setPipeline(names.toArray(new String[0]));
            env.setProcess(processDescription.getOutputFile());
            for (final Processor proc : processDescription.getProcessors()) {
              final de.matrixweb.smaller.config.Processor processor = new de.matrixweb.smaller.config.Processor();
              processor.setSrc(processDescription.getInputFile());
              processor.setOptions(new HashMap<String, Object>(proc
                  .getOptions()));
              env.getProcessors().put(proc.getName(), processor);
            }
            configFile.getEnvironments().put(UUID.randomUUID().toString(), env);
          }
          configFile.getBuildServer().setEnvironments(
              configFile.getEnvironments().keySet().toArray(new String[0]));
          FileUtils.write(testYml, configFile.dumpYaml());

          FileUtils.copyFile(new File(PlexusTestCase.getBasedir(),
              "src/test/resources/smaller-maven-mojo-config.xml"), new File(
              PlexusTestCase.getBasedir(), "target/smaller-maven-mojo-config-"
                  + file + ".xml"));
View Full Code Here

      prepareTestFiles(file, callback, new ExecuteTestCallback() {
        @Override
        public void execute(final Manifest manifest, final File source,
            final File target) throws Exception {

          final ConfigFile configFile = new ConfigFile();
          configFile.setEnvironments(new HashMap<String, Environment>());
          for (final ProcessDescription processDescription : manifest
              .getProcessDescriptions()) {
            final Environment env = new Environment();
            env.getFiles().setFolder(new String[] { source.getAbsolutePath() });
            final List<String> names = new ArrayList<String>();
            for (final Processor proc : processDescription.getProcessors()) {
              names.add(proc.getName());
            }
            env.setPipeline(names.toArray(new String[0]));
            env.setProcess(processDescription.getOutputFile());
            for (final Processor proc : processDescription.getProcessors()) {
              final de.matrixweb.smaller.config.Processor processor = new de.matrixweb.smaller.config.Processor();
              processor.setSrc(processDescription.getInputFile());
              processor.setOptions(new HashMap<String, Object>(proc
                  .getOptions()));
              env.getProcessors().put(proc.getName(), processor);
            }
            configFile.getEnvironments().put(UUID.randomUUID().toString(), env);
          }
          configFile.getBuildServer().setEnvironments(
              configFile.getEnvironments().keySet().toArray(new String[0]));
          configFile.getBuildServer().setOutputOnly(GlobalOptions.isOutOnly(manifest));
          final File testYml = new File("target/smaller-" + file + ".yml");
          FileUtils.write(testYml, configFile.dumpYaml());

          stask.setTarget(target);
          stask.setConfigFile(testYml);
          stask.execute();
        }
View Full Code Here

      try {
        temp.delete();
        temp.mkdirs();

        log("Reading config-file: " + this.configFilePath);
        final ConfigFile configFile = ConfigFile.read(this.configFilePath);

        final List<String> includedFiles = new ArrayList<String>();
        for (final String envName : configFile.getBuildServer()
            .getEnvironments()) {
          final Environment env = configFile.getEnvironments().get(envName);
          for (final String dir : env.getFiles().getFolder()) {
            copyFirstInputFile(env, dir, temp);

            File base = new File(dir);
            if (!base.isAbsolute()) {
View Full Code Here

TOP

Related Classes of de.matrixweb.smaller.config.ConfigFile

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.