Package org.springframework.boot.cli.compiler

Examples of org.springframework.boot.cli.compiler.GroovyCompiler


      if (System.getProperty("grape.root") == null) {
        System.setProperty("grape.root", ".");
      }

      GroovyCompiler groovyCompiler = new GroovyCompiler(configuration);
      groovyCompiler.compile(sourceOptions.getSourcesArray());
      return ExitStatus.OK;
    }
View Full Code Here


   * @param args
   */
  public TestRunner(TestRunnerConfiguration configuration, String[] sources,
      String[] args) {
    this.sources = sources.clone();
    this.compiler = new GroovyCompiler(configuration);
  }
View Full Code Here

  }

  @Override
  public List<File> resolve(List<String> artifactIdentifiers)
      throws CompilationFailedException, IOException {
    GroovyCompiler groovyCompiler = new GroovyCompiler(this.configuration);
    List<File> artifactFiles = new ArrayList<File>();
    if (!artifactIdentifiers.isEmpty()) {
      List<URL> initialUrls = getClassPathUrls(groovyCompiler);
      groovyCompiler.compile(createSources(artifactIdentifiers));
      List<URL> artifactUrls = getClassPathUrls(groovyCompiler);
      artifactUrls.removeAll(initialUrls);
      for (URL artifactUrl : artifactUrls) {
        artifactFiles.add(toFile(artifactUrl));
      }
View Full Code Here

      final SpringApplicationRunnerConfiguration configuration, String[] sources,
      String... args) {
    this.configuration = configuration;
    this.sources = sources.clone();
    this.args = args.clone();
    this.compiler = new GroovyCompiler(configuration);
    int level = configuration.getLogLevel().intValue();
    if (level <= Level.FINER.intValue()) {
      System.setProperty("groovy.grape.report.downloads", "true");
      System.setProperty("trace", "true");
    }
View Full Code Here

      File output = new File((String) nonOptionArguments.remove(0));
      Assert.isTrue(output.getName().toLowerCase().endsWith(".jar"), "The output '"
          + output + "' is not a JAR file.");
      deleteIfExists(output);

      GroovyCompiler compiler = createCompiler(options);

      List<URL> classpath = getClassPathUrls(compiler);
      List<MatchedResource> classpathEntries = findMatchingClasspathEntries(
          classpath, options);

      String[] sources = new SourceOptions(nonOptionArguments).getSourcesArray();
      Class<?>[] compiledClasses = compiler.compile(sources);

      List<URL> dependencies = getClassPathUrls(compiler);
      dependencies.removeAll(classpath);

      writeJar(output, compiledClasses, classpathEntries, dependencies);
View Full Code Here

    private GroovyCompiler createCompiler(OptionSet options) {
      List<RepositoryConfiguration> repositoryConfiguration = RepositoryConfigurationFactory
          .createDefaultRepositoryConfiguration();
      GroovyCompilerConfiguration configuration = new OptionSetGroovyCompilerConfiguration(
          options, this, repositoryConfiguration);
      GroovyCompiler groovyCompiler = new GroovyCompiler(configuration);
      groovyCompiler.getAstTransformations().add(0, new GrabAnnotationTransform());
      return groovyCompiler;
    }
View Full Code Here

TOP

Related Classes of org.springframework.boot.cli.compiler.GroovyCompiler

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.