• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java ApplicationPluginConvention类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.gradle.api.plugins.ApplicationPluginConvention的典型用法代码示例。如果您正苦于以下问题:Java ApplicationPluginConvention类的具体用法?Java ApplicationPluginConvention怎么用?Java ApplicationPluginConvention使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ApplicationPluginConvention类属于org.gradle.api.plugins包,在下文中一共展示了ApplicationPluginConvention类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getMainClassName

import org.gradle.api.plugins.ApplicationPluginConvention; //导入依赖的package包/类
@Input
@Optional
private String getMainClassName() {
    Project project = getProject();
    SwarmExtension swarmExtension = getSwarmExtension();
    String mainClassName = swarmExtension.getMainClassName();

    if (mainClassName == null && project.getConvention().getPlugins().containsKey("application")) {
        ApplicationPluginConvention app = (ApplicationPluginConvention) project.getConvention().getPlugins().get("application");
        mainClassName = app.getMainClassName();
    }

    if (mainClassName != null && !mainClassName.equals("")) {
        getLogger().warn(
                "\n------\n" +
                        "Custom main() usage is intended to be deprecated in a future release and is no longer supported, \n" +
                        "please refer to http://reference.wildfly-swarm.io for YAML configuration that replaces it." +
                        "\n------"
        );
    }

    return mainClassName;
}
 
开发者ID:wildfly-swarm,项目名称:wildfly-swarm,代码行数:24,代码来源:PackageTask.java


示例2: configureAppPlugin

import org.gradle.api.plugins.ApplicationPluginConvention; //导入依赖的package包/类
private void configureAppPlugin()
{
    final ApplicationPluginConvention convention = this.project.getConvention().findPlugin( ApplicationPluginConvention.class );
    convention.setMainClassName( "io.purplejs.boot.MainApp" );

    final JavaExec runTask = (JavaExec) this.project.getTasks().getByName( ApplicationPlugin.TASK_RUN_NAME );
    runTask.systemProperty( "io.purplejs.runMode", "dev" );

    final String devDirs = new File( this.project.getProjectDir(), "src/main/resources" ).getAbsolutePath();
    runTask.systemProperty( "io.purplejs.devSourceDirs", devDirs );
}
 
开发者ID:purplejs,项目名称:purplejs,代码行数:12,代码来源:BootPlugin.java


示例3: apply

import org.gradle.api.plugins.ApplicationPluginConvention; //导入依赖的package包/类
@Override
public void apply(Project project) {
  project.getPluginManager().apply(ApplicationPlugin.class);
  project.getPluginManager().apply(GitPropertiesPlugin.class);
  project
      .getExtensions()
      .create(ImmutableDeploymentExtension.NAME, DeploymentExtension.class, project);

  project.getNormalization().getRuntimeClasspath().ignore("git.properties");

  project.afterEvaluate(
      p -> {
        ImmutableDeploymentExtension config =
            project.getExtensions().getByType(DeploymentExtension.class);

        String archivesBaseName =
            project.getConvention().getPlugin(BasePluginConvention.class).getArchivesBaseName();
        project
            .getConvention()
            .getPlugin(ApplicationPluginConvention.class)
            .setApplicationName(archivesBaseName);

        GroovyObject docker = project.getExtensions().getByType(DockerExtension.class);
        DockerJavaApplication javaApplication =
            (DockerJavaApplication) docker.getProperty("javaApplication");
        javaApplication.setBaseImage("openjdk:8-jre");

        project.getTasks().getByName("build").dependsOn("dockerDistTar");

        for (ImmutableDeploymentConfiguration type : config.getTypes()) {
          String capitalized =
              Ascii.toUpperCase(type.getName().charAt(0)) + type.getName().substring(1);
          DeployConfigMapTask deployConfigMapTask =
              project
                  .getTasks()
                  .create("deployConfigMap" + capitalized, DeployConfigMapTask.class)
                  .setType(type.getName());
          project
              .getTasks()
              .create("deploy" + capitalized, DeployPodTask.class)
              .setType(type.getName())
              .dependsOn(deployConfigMapTask);
        }
      });
  project.getPluginManager().apply(DockerJavaApplicationPlugin.class);
}
 
开发者ID:curioswitch,项目名称:curiostack,代码行数:47,代码来源:CurioServerPlugin.java


示例4: findMainClass

import org.gradle.api.plugins.ApplicationPluginConvention; //导入依赖的package包/类
private String findMainClass() {
	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");

	if (mainClass == null && application != null) {
		// Try the Application extension setting
		mainClass = application.getMainClassName();
	}

	JavaExec runTask = findRunTask(project);
	if (mainClass == null && runTask != null) {
		mainClass = runTask.getMain();
	}

	if (mainClass == null) {
		Task bootRunTask = project.getTasks().findByName("bootRun");
		if (bootRunTask != null) {
			mainClass = (String) bootRunTask.property("main");
		}
	}

	if (mainClass == null) {
		// Search
		if (this.mainClassSourceSetOutput != null) {
			project.getLogger().debug("Looking for main in: "
					+ this.mainClassSourceSetOutput.getClassesDir());
			try {
				mainClass = MainClassFinder.findSingleMainClass(
						this.mainClassSourceSetOutput.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 != null && application.getMainClassName() == null) {
		application.setMainClassName(mainClass);
	}
	if (runTask != null && !runTask.hasProperty("main")) {
		runTask.setMain(mainClass);
	}

	return mainClass;
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:63,代码来源:FindMainClassTask.java


示例5: findMainClass

import org.gradle.api.plugins.ApplicationPluginConvention; //导入依赖的package包/类
private String findMainClass() {
	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");

	if (mainClass == null && application != null) {
		// Try the Application extension setting
		mainClass = application.getMainClassName();
	}

	Task runTask = project.getTasks().findByName("run");
	if (mainClass == null && runTask != null) {
		mainClass = (String) runTask.property("main");
	}

	if (mainClass == null) {
		Task bootRunTask = project.getTasks().findByName("bootRun");
		if (bootRunTask != null) {
			mainClass = (String) bootRunTask.property("main");
		}
	}

	if (mainClass == null) {
		// Search
		if (this.mainClassSourceSetOutput != null) {
			project.getLogger().debug("Looking for main in: "
					+ this.mainClassSourceSetOutput.getClassesDir());
			try {
				mainClass = MainClassFinder.findSingleMainClass(
						this.mainClassSourceSetOutput.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 != null && application.getMainClassName() == null) {
		application.setMainClassName(mainClass);
	}
	if (runTask != null && !runTask.hasProperty("main")) {
		runTask.setProperty("main", mainClass);
	}

	return mainClass;
}
 
开发者ID:Nephilim84,项目名称:contestparser,代码行数:63,代码来源:FindMainClassTask.java



注:本文中的org.gradle.api.plugins.ApplicationPluginConvention类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java TransitionTo类代码示例发布时间:2022-05-23
下一篇:
Java IndentTask类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap