本文整理汇总了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;未经允许,请勿转载。 |
请发表评论