本文整理了Java中org.gradle.api.internal.plugins.DslObject.
方法的一些代码示例,展示了DslObject.
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。DslObject.
方法的具体详情如下:
包路径:org.gradle.api.internal.plugins.DslObject
类名称:DslObject
方法名:
暂无
代码示例来源:origin: diffplug/spotless
GroovySourceSet groovySourceSet = new DslObject(sourceSet).getConvention().getPlugin(GroovySourceSet.class);
if (excludeJava) {
union = union.plus(groovySourceSet.getAllGroovy());
代码示例来源:origin: org.sonarsource.scanner.gradle/sonarqube-gradle-plugin
private static void configureJdkSourceAndTarget(Project project, Map
JavaPluginConvention javaPluginCOnvention= new DslObject(project).getConvention().getPlugin(JavaPluginConvention.class);
properties.put(SONAR_JAVA_SOURCE_PROP, javaPluginConvention.getSourceCompatibility());
properties.put(SONAR_JAVA_TARGET_PROP, javaPluginConvention.getTargetCompatibility());
}
代码示例来源:origin: SonarSource/sonar-scanner-gradle
private static void configureJdkSourceAndTarget(Project project, Map
JavaPluginConvention javaPluginCOnvention= new DslObject(project).getConvention().getPlugin(JavaPluginConvention.class);
properties.put(SONAR_JAVA_SOURCE_PROP, javaPluginConvention.getSourceCompatibility());
properties.put(SONAR_JAVA_TARGET_PROP, javaPluginConvention.getTargetCompatibility());
}
代码示例来源:origin: io.github.gradle-clojure/gradle-clojure-plugin
Provider
return getSourceSet().map(sourceSet -> {
ClojureSourceSet clojure = (ClojureSourceSet) new DslObject(sourceSet).getConvention().getPlugins().get("clojure");
return clojure.getClojure().getSourceDirectories();
});
}
代码示例来源:origin: io.github.gradle-clojure/gradle-clojure-plugin
Provider
return getSourceSet().map(sourceSet -> {
ClojureScriptSourceSet clojure = (ClojureScriptSourceSet) new DslObject(sourceSet).getConvention().getPlugins().get("clojurescript");
return clojure.getClojureScript().getSourceDirectories();
});
}
代码示例来源:origin: gradle-clojure/gradle-clojure
Provider
return getSourceSet().map(sourceSet -> {
ClojureScriptSourceSet clojure = (ClojureScriptSourceSet) new DslObject(sourceSet).getConvention().getPlugins().get("clojurescript");
return clojure.getClojureScript().getSourceDirectories();
});
}
代码示例来源:origin: gradle-clojure/gradle-clojure
Provider
return getSourceSet().map(sourceSet -> {
ClojureSourceSet clojure = (ClojureSourceSet) new DslObject(sourceSet).getConvention().getPlugins().get("clojure");
return clojure.getClojure().getSourceDirectories();
});
}
代码示例来源:origin: org.sonarsource.scanner.gradle/sonarqube-gradle-plugin
private static boolean configureSourceDirsAndJavaClasspath(Project project, Map
JavaPluginConvention javaPluginCOnvention= new DslObject(project).getConvention().getPlugin(JavaPluginConvention.class);
SourceSet main = javaPluginConvention.getSourceSets().getAt("main");
List
properties.put(SONAR_SOURCES_PROP, sourceDirectories);
SourceSet test = javaPluginConvention.getSourceSets().getAt("test");
List
properties.put(SONAR_TESTS_PROP, testDirectories);
Collection
Collection
setMainClasspathProps(properties, addForGroovy, mainClassDirs, mainLibraries);
Collection
Collection
setTestClasspathProps(properties, testClassDirs, testLibraries);
return sourceDirectories != null || testDirectories != null;
}
代码示例来源:origin: SonarSource/sonar-scanner-gradle
private static boolean configureSourceDirsAndJavaClasspath(Project project, Map
JavaPluginConvention javaPluginCOnvention= new DslObject(project).getConvention().getPlugin(JavaPluginConvention.class);
SourceSet main = javaPluginConvention.getSourceSets().getAt("main");
List
properties.put(SONAR_SOURCES_PROP, sourceDirectories);
SourceSet test = javaPluginConvention.getSourceSets().getAt("test");
List
properties.put(SONAR_TESTS_PROP, testDirectories);
Collection
Collection
setMainClasspathProps(properties, addForGroovy, mainClassDirs, mainLibraries);
Collection
Collection
setTestClasspathProps(properties, testClassDirs, testLibraries);
return sourceDirectories != null || testDirectories != null;
}
代码示例来源:origin: MinecraftForge/ForgeGradle
@Override public void execute(Project project)
{
if (project.getPlugins().hasPlugin("scala"))
{
ScalaSourceSet langSet = (ScalaSourceSet) new DslObject(main).getConvention().getPlugins().get("scala");
sourceJar.from(langSet.getAllScala());
}
if (project.getPlugins().hasPlugin("kotlin"))
{
KotlinSourceSet langSet = (KotlinSourceSet) new DslObject(main).getConvention().getPlugins().get("kotlin");
sourceJar.from(langSet.getKotlin());
}
}
});
代码示例来源:origin: io.github.gradle-clojure/gradle-clojure-plugin
@Override
public void apply(Project project) {
project.getPlugins().apply(ClojureBasePlugin.class);
project.getPlugins().apply(ClojureCommonPlugin.class);
ClojureExtension extension = project.getExtensions().getByType(ClojureExtension.class);
configureBuilds(project, extension);
JavaPluginConvention javaCOnvention= project.getConvention().getPlugin(JavaPluginConvention.class);
ClojureCommonPlugin.configureDevSource(javaConvention, sourceSet -> {
ClojureSourceSet src = (ClojureSourceSet) new DslObject(sourceSet).getConvention().getPlugins().get("clojure");
return src.getClojure();
});
}
代码示例来源:origin: gradle-clojure/gradle-clojure
@Override
public void apply(Project project) {
project.getPlugins().apply(ClojureBasePlugin.class);
project.getPlugins().apply(ClojureCommonPlugin.class);
ClojureExtension extension = project.getExtensions().getByType(ClojureExtension.class);
configureBuilds(project, extension);
JavaPluginConvention javaCOnvention= project.getConvention().getPlugin(JavaPluginConvention.class);
ClojureCommonPlugin.configureDevSource(javaConvention, sourceSet -> {
ClojureSourceSet src = (ClojureSourceSet) new DslObject(sourceSet).getConvention().getPlugins().get("clojure");
return src.getClojure();
});
}
代码示例来源:origin: gradle.plugin.com.liferay/gradle-plugins-app-docker
private DockerPushImage _addTaskPushAppDockerImage(
final DockerBuildImage buildAppDockerImageTask,
final AppDockerExtension appDockerExtension) {
DockerPushImage dockerPushImage = GradleUtil.addTask(
buildAppDockerImageTask.getProject(),
PUSH_APP_DOCKER_IMAGE_TASK_NAME, DockerPushImage.class);
dockerPushImage.setDependsOn(
Collections.singleton(buildAppDockerImageTask));
dockerPushImage.setDescription(
"Pushes the Docker image of the app to the registry.");
dockerPushImage.setGroup(BasePlugin.UPLOAD_GROUP);
DslObject dslObject = new DslObject(dockerPushImage);
ConventionMapping cOnventionMapping= dslObject.getConventionMapping();
conventionMapping.map(
"imageName",
new Callable
@Override
public String call() throws Exception {
return _getImageRepository(appDockerExtension);
}
});
return dockerPushImage;
}
代码示例来源:origin: io.freefair.gradle/jsass-plugin
public SassCompile() {
include("**/*.scss");
include("**/*.sass");
ExtraPropertiesExtension extraProperties = new DslObject(this).getExtensions().getExtraProperties();
for (OutputStyle value : OutputStyle.values()) {
extraProperties.set(value.name(), value);
}
}
代码示例来源:origin: io.github.gradle-clojure/gradle-clojure-plugin
@Override
public void apply(Project project) {
project.getPlugins().apply(ClojureScriptBasePlugin.class);
project.getPlugins().apply(ClojureCommonPlugin.class);
ClojureScriptExtension extension = project.getExtensions().getByType(ClojureScriptExtension.class);
configureBuilds(project, extension);
configurePiggieback(project);
configureFigwheel(project);
JavaPluginConvention javaCOnvention= project.getConvention().getPlugin(JavaPluginConvention.class);
ClojureCommonPlugin.configureDevSource(javaConvention, sourceSet -> {
ClojureScriptSourceSet src = (ClojureScriptSourceSet) new DslObject(sourceSet).getConvention().getPlugins().get("clojurescript");
return src.getClojureScript();
});
}
代码示例来源:origin: gradle-clojure/gradle-clojure
@Override
public void apply(Project project) {
project.getPlugins().apply(ClojureScriptBasePlugin.class);
project.getPlugins().apply(ClojureCommonPlugin.class);
ClojureScriptExtension extension = project.getExtensions().getByType(ClojureScriptExtension.class);
configureBuilds(project, extension);
configurePiggieback(project);
configureFigwheel(project);
JavaPluginConvention javaCOnvention= project.getConvention().getPlugin(JavaPluginConvention.class);
ClojureCommonPlugin.configureDevSource(javaConvention, sourceSet -> {
ClojureScriptSourceSet src = (ClojureScriptSourceSet) new DslObject(sourceSet).getConvention().getPlugins().get("clojurescript");
return src.getClojureScript();
});
}
代码示例来源:origin: gradle.plugin.org.gosu-lang.gosu/gradle-gosu-plugin
private void configureSourceSetDefaults(final JavaBasePlugin javaBasePlugin) {
_project.getConvention().getPlugin(JavaPluginConvention.class).getSourceSets().all( sourceSet -> {
DefaultGosuSourceSet gosuSourceSet = new DefaultGosuSourceSet(((DefaultSourceSet) sourceSet).getDisplayName(), _fileResolver);
new DslObject(sourceSet).getConvention().getPlugins().put("gosu", gosuSourceSet);
gosuSourceSet.getGosu().srcDir("src/" + sourceSet.getName() + "/gosu");
sourceSet.getResources().getFilter().exclude( element -> {
return gosuSourceSet.getGosu().contains(element.getFile());
});
sourceSet.getAllSource().source(gosuSourceSet.getGosu());
configureGosuCompile(javaBasePlugin, sourceSet, gosuSourceSet);
});
}
代码示例来源:origin: io.github.gradle-clojure/gradle-clojure-plugin
private void configureSourceSetDefaults(Project project, ClojureExtension extension) {
project.getConvention().getPlugin(JavaPluginConvention.class).getSourceSets().all(sourceSet -> {
ClojureSourceSet clojureSourceSet = new DefaultClojureSourceSet("clojure", sourceDirectorySetFactory);
new DslObject(sourceSet).getConvention().getPlugins().put("clojure", clojureSourceSet);
clojureSourceSet.getClojure().srcDir(String.format("src/%s/clojure", sourceSet.getName()));
// in case the clojure source overlaps with the resources source
sourceSet.getResources().getFilter().exclude(element -> clojureSourceSet.getClojure().contains(element.getFile()));
sourceSet.getAllSource().source(clojureSourceSet.getClojure());
ClojureBuild build = extension.getBuilds().create(sourceSet.getName());
build.getSourceSet().set(sourceSet);
((DefaultSourceSetOutput) sourceSet.getOutput()).addClassesDir(() -> build.getOutputDir().get().getAsFile());
project.getTasks().getByName(sourceSet.getClassesTaskName()).dependsOn(build.getTaskName("compile"));
project.getTasks().getByName(sourceSet.getClassesTaskName()).dependsOn(build.getTaskName("check"));
sourceSet.getOutput().dir(project.provider(() -> {
if (build.isCompilerConfigured()) {
return clojureSourceSet.getClojure().getSourceDirectories();
} else {
return build.getOutputDir();
}
}));
});
}
代码示例来源:origin: io.github.gradle-clojure/gradle-clojure-plugin
private void configureSourceSetDefaults(Project project, ClojureScriptExtension extension) {
project.getConvention().getPlugin(JavaPluginConvention.class).getSourceSets().all((SourceSet sourceSet) -> {
ClojureScriptSourceSet clojurescriptSourceSet = new DefaultClojureScriptSourceSet("clojurescript", sourceDirectorySetFactory);
new DslObject(sourceSet).getConvention().getPlugins().put("clojurescript", clojurescriptSourceSet);
clojurescriptSourceSet.getClojureScript().srcDir(String.format("src/%s/clojurescript", sourceSet.getName()));
// in case the clojure source overlaps with the resources source
sourceSet.getResources().getFilter().exclude(element -> clojurescriptSourceSet.getClojureScript().contains(element.getFile()));
sourceSet.getAllSource().source(clojurescriptSourceSet.getClojureScript());
ClojureScriptBuild build = extension.getBuilds().create(sourceSet.getName());
build.getSourceSet().set(sourceSet);
sourceSet.getOutput().dir(build.getOutputDir());
project.getTasks().getByName(sourceSet.getClassesTaskName()).dependsOn(build.getTaskName("compile"));
sourceSet.getOutput().dir(project.provider(() -> {
if (build.isCompilerConfigured()) {
return clojurescriptSourceSet.getClojureScript().getSourceDirectories();
} else {
return build.getOutputDir();
}
}));
});
}
代码示例来源:origin: gradle-clojure/gradle-clojure
private void configureSourceSetDefaults(Project project, ClojureScriptExtension extension) {
project.getConvention().getPlugin(JavaPluginConvention.class).getSourceSets().all((SourceSet sourceSet) -> {
ClojureScriptSourceSet clojurescriptSourceSet = new DefaultClojureScriptSourceSet("clojurescript", objects);
new DslObject(sourceSet).getConvention().getPlugins().put("clojurescript", clojurescriptSourceSet);
clojurescriptSourceSet.getClojureScript().srcDir(String.format("src/%s/clojurescript", sourceSet.getName()));
// in case the clojure source overlaps with the resources source
sourceSet.getResources().getFilter().exclude(element -> clojurescriptSourceSet.getClojureScript().contains(element.getFile()));
sourceSet.getAllSource().source(clojurescriptSourceSet.getClojureScript());
ClojureScriptBuild build = extension.getBuilds().create(sourceSet.getName());
build.getSourceSet().set(sourceSet);
sourceSet.getOutput().dir(build.getOutputDir());
project.getTasks().getByName(sourceSet.getClassesTaskName()).dependsOn(build.getTaskName("compile"));
sourceSet.getOutput().dir(project.provider(() -> {
if (build.isCompilerConfigured()) {
return build.getOutputDir();
} else {
return clojurescriptSourceSet.getClojureScript().getSourceDirectories();
}
}));
});
}