Package org.springframework.boot.gradle

Examples of org.springframework.boot.gradle.SpringBootPluginExtension


    Project project = getProject();

    String mainClass = null;

    // Try the SpringBoot extension setting
    SpringBootPluginExtension bootExtension = project.getExtensions().getByType(
        SpringBootPluginExtension.class);
    if (bootExtension.getMainClass() != null) {
      mainClass = bootExtension.getMainClass();
    }

    ApplicationPluginConvention application = (ApplicationPluginConvention) project
        .getConvention().getPlugins().get("application");
    // Try the Application extension setting
    if (mainClass == null && application.getMainClassName() != null) {
      mainClass = application.getMainClassName();
    }

    Task runTask = getProject().getTasks().getByName("run");
    if (mainClass == null && runTask.hasProperty("main")) {
      mainClass = (String) runTask.property("main");
    }

    if (mainClass == null) {
      // Search
      SourceSet mainSourceSet = SourceSets.findMainSourceSet(project);
      if (mainSourceSet != null) {
        project.getLogger().debug(
            "Looking for main in: "
                + mainSourceSet.getOutput().getClassesDir());
        try {
          mainClass = MainClassFinder.findSingleMainClass(mainSourceSet
              .getOutput().getClassesDir());
          project.getLogger().info("Computed main class: " + mainClass);
        }
        catch (IOException ex) {
          throw new IllegalStateException("Cannot find main class", ex);
        }
      }
    }

    project.getLogger().info("Found main: " + mainClass);

    if (bootExtension.getMainClass() == null) {
      bootExtension.setMainClass(mainClass);
    }
    if (application.getMainClassName() == null) {
      application.setMainClassName(mainClass);
    }
    if (!runTask.hasProperty("main")) {
View Full Code Here


    @Override
    public void execute(Jar jarTask) {
      if ("".equals(jarTask.getClassifier())) {
        String classifier = this.task.getClassifier();
        if (classifier == null) {
          SpringBootPluginExtension extension = this.project.getExtensions()
              .getByType(SpringBootPluginExtension.class);
          classifier = extension.getClassifier();
          this.task.setClassifier(classifier);
        }
        if (classifier != null) {
          setupInputOutputs(jarTask, classifier);
        }
View Full Code Here

*/
public class ExcludePluginFeatures implements PluginFeatures {

  @Override
  public void apply(Project project) {
    SpringBootPluginExtension extension = project.getExtensions().getByType(
        SpringBootPluginExtension.class);
    if (extension.isApplyExcludeRules()) {
      project.getConfigurations().all(new ApplyExcludeRules(project));
    }
  }
View Full Code Here

    }
  }

  private void setup(Project project) {
    project.getLogger().info("Configuring agent");
    SpringBootPluginExtension extension = project.getExtensions().getByType(
        SpringBootPluginExtension.class);
    this.noverify = extension.getNoverify();
    this.agent = getAgent(project, extension);
    if (this.agent == null) {
      this.agent = getSpringLoadedAgent();
      if (this.noverify == null) {
        this.noverify = true;
View Full Code Here

  }

  @TaskAction
  public void repackage() {
    Project project = getProject();
    SpringBootPluginExtension extension = project.getExtensions().getByType(
        SpringBootPluginExtension.class);
    ProjectLibraries libraries = getLibraries();
    project.getTasks().withType(Jar.class, new RepackageAction(extension, libraries));
  }
View Full Code Here

    project.getTasks().withType(Jar.class, new RepackageAction(extension, libraries));
  }

  public ProjectLibraries getLibraries() {
    Project project = getProject();
    SpringBootPluginExtension extension = project.getExtensions().getByType(
        SpringBootPluginExtension.class);
    ProjectLibraries libraries = new ProjectLibraries(project, extension);
    if (extension.getProvidedConfiguration() != null) {
      libraries.setProvidedConfigurationName(extension.getProvidedConfiguration());
    }
    if (this.customConfiguration != null) {
      libraries.setCustomConfigurationName(this.customConfiguration);
    }
    else if (extension.getCustomConfiguration() != null) {
      libraries.setCustomConfigurationName(extension.getCustomConfiguration());
    }
    return libraries;
  }
View Full Code Here

TOP

Related Classes of org.springframework.boot.gradle.SpringBootPluginExtension

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.