Package de.matrixweb.smaller.config

Examples of de.matrixweb.smaller.config.Environment


    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,
        Arrays.asList("a.test", "dir/b.test", "dir/dir/c.test"), configFile);
    util.unzip(tempOut, bytes);
View Full Code Here


    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

        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();
            final String[] included = scanIncludedFiles(base, env.getFiles()
                .getIncludes(), env.getFiles().getExcludes());

            for (final String include : included) {
              FileUtils.copyFile(new File(base, include), new File(temp,
                  include));
              includedFiles.add(include);
View Full Code Here

        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()) {
              base = new File(this.configFilePath.getParentFile(),
                  base.getPath());
            }
            final String[] included = scanIncludedFiles(base.getAbsolutePath(),
                env.getFiles().getIncludes(), env.getFiles().getExcludes());

            for (final String include : included) {
              final File from = new File(base, include);
              final File to = new File(temp, include);
              this.log.debug("... copy '" + from + "' to '" + to + "'");
View Full Code Here

          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]));
View Full Code Here

          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]));
View Full Code Here

        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()) {
              base = new File(this.configFilePath.getParentFile(),
                  base.getPath());
            }
            final String[] included = scanIncludedFiles(base.getAbsolutePath(),
                env.getFiles().getIncludes(), env.getFiles().getExcludes());

            for (final String include : included) {
              FileUtils.copyFile(new File(base, include), new File(temp,
                  include));
              includedFiles.add(include);
View Full Code Here

TOP

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

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.