Examples of ExmlConfiguration


Examples of net.jangaroo.exml.config.ExmlConfiguration

    if (generatedTargetClassFile == null) {
      // only generate component class if it is not already present as source:
      File classFile = new File(ExmlUtils.createComponentClassName(CompilerUtils.removeExtension(sourceFile.getName())) + Jooc.AS_SUFFIX);
      if (!classFile.exists()) {
        try {
          ExmlConfiguration config = configClassRegistry.getConfig();
          generatedTargetClassFile = config.computeGeneratedComponentClassFile(sourceFile);
          if (mustGenerate(generatedTargetClassFile)) {
            ExmlModel exmlModel = new ExmlToModelParser(configClassRegistry).parse(sourceFile);
            return new ExmlComponentClassGenerator(config).generateClass(exmlModel, generatedTargetClassFile);
          }
        } catch (Exception e) {
View Full Code Here

Examples of net.jangaroo.exml.config.ExmlConfiguration

    if (!generatedResourcesDirectory.exists()) {
      getLog().info("generating resources into: " + generatedResourcesDirectory.getPath());
      getLog().debug("created " + generatedResourcesDirectory.mkdirs());
    }

    ExmlConfiguration exmlConfiguration = new ExmlConfiguration();
    exmlConfiguration.setConfigClassPackage(configClassPackage);
    exmlConfiguration.setClassPath(getActionScriptClassPath());
    exmlConfiguration.setOutputDirectory(gSourcesDirectory);
    exmlConfiguration.setResourceOutputDirectory(generatedResourcesDirectory);
    List<File> sourcePath = getSourcePath();
    try {
      exmlConfiguration.setSourcePath(sourcePath);
    } catch (IOException e) {
      throw new MojoExecutionException("could not determine source directory", e);
    }
    exmlConfiguration.setSourceFiles(getMavenPluginHelper().computeStaleSources(sourcePath, includes, excludes, gSourcesDirectory, Exmlc.EXML_SUFFIX, Jooc.AS_SUFFIX, staleMillis));
    if (StringUtils.isNotEmpty(validationMode)) {
      try {
        exmlConfiguration.setValidationMode(ValidationMode.valueOf(validationMode.toUpperCase()));
      } catch (IllegalArgumentException e) {
        throw new MojoFailureException("The specified EXML validation mode '" + validationMode + "' is unsupported. " +
                "Legal values are 'error', 'warn', and 'off'.");
      }
    }
    CompileLog compileLog = new MavenCompileLog();
    exmlConfiguration.setLog(compileLog);

    Exmlc exmlc;
    try {
      getLog().debug("Exmlc configuration: " + exmlConfiguration);
      exmlc = new Exmlc(exmlConfiguration);
View Full Code Here

Examples of net.jangaroo.exml.config.ExmlConfiguration

  protected void setUp(String configClassPackage, String sourcePathFileName, String classPathFileName) throws Exception {
    File sourcePathFile = new File(getClass().getResource(sourcePathFileName).toURI());
    File classPathFile = new File(getClass().getResource(classPathFileName).toURI());

    ExmlConfiguration config = new ExmlConfiguration();
    config.setSourcePath(Arrays.asList(sourcePathFile));
    config.setClassPath(Arrays.asList(classPathFile));
    config.setOutputDirectory(outputFolder.getRoot());
    config.setConfigClassPackage(configClassPackage);
    exmlc = new Exmlc(config);
  }
View Full Code Here

Examples of net.jangaroo.exml.config.ExmlConfiguration

    return result;
  }
 
  public static int run(String[] argv) {
    ExmlcCommandLineParser parser = new ExmlcCommandLineParser();
    ExmlConfiguration exmlConfiguration;
    try {
      exmlConfiguration = parser.parse(argv);
    } catch (CommandLineParseException e) {
      System.err.println(e.getMessage()); // NOSONAR this is a commandline tool
      return e.getExitCode();
View Full Code Here

Examples of net.jangaroo.exml.config.ExmlConfiguration

  @SuppressWarnings("ThrowableResultOfMethodCallIgnored")
  @Test
  public void testValidateExmlFile() throws Exception {
    setUp("testNamespace.config");
    ExmlConfiguration exmlConfiguration = getExmlc().getConfig();
    File testExmlFile = getFile("/exmlparser/TestValidation.exml");
    exmlConfiguration.setSourceFiles(Collections.singletonList(testExmlFile));
    exmlConfiguration.setResourceOutputDirectory(getFile("/"));

    exmlConfiguration.setValidationMode(ValidationMode.ERROR);
    final Map<FilePosition, String> validationErrors = new LinkedHashMap<FilePosition, String>();
    exmlConfiguration.setLog(new CompileLog() {
      @Override
      public void error(FilePosition position, String msg) {
        System.out.printf("%s(%d): %s%n", position.getFileName(), position.getLine(), msg);
        validationErrors.put(position, msg);
      }
View Full Code Here

Examples of net.jangaroo.exml.config.ExmlConfiguration

    }
    return config;
  }

  public ExmlConfiguration parse(String[] args) throws CommandLineParseException {
    ExmlConfiguration config = new ExmlConfiguration();

    CmdLineParser parser = new CmdLineParser(config);
    try {
      // parse the arguments.
      parser.parseArgument(args);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.