本文整理汇总了Java中org.gradle.plugins.ide.idea.IdeaPlugin类的典型用法代码示例。如果您正苦于以下问题:Java IdeaPlugin类的具体用法?Java IdeaPlugin怎么用?Java IdeaPlugin使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IdeaPlugin类属于org.gradle.plugins.ide.idea包,在下文中一共展示了IdeaPlugin类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: applyIdeaPlugin
import org.gradle.plugins.ide.idea.IdeaPlugin; //导入依赖的package包/类
private void applyIdeaPlugin(Project root) {
Set<Project> allProjects = root.getAllprojects();
for (Project p : allProjects) {
p.getPluginManager().apply(IdeaPlugin.class);
}
ideaPluginFor(root).performPostEvaluationActions();
}
示例2: findProjectsApplyingIdeaAndScalaPlugins
import org.gradle.plugins.ide.idea.IdeaPlugin; //导入依赖的package包/类
private Collection<Project> findProjectsApplyingIdeaAndScalaPlugins() {
return Collections2.filter(rootProject.getAllprojects(), new Predicate<Project>() {
@Override
public boolean apply(Project project) {
return project.getPlugins().hasPlugin(IdeaPlugin.class) && (project.getPlugins().hasPlugin(ScalaBasePlugin.class) || project.getPlugins().hasPlugin(ScalaLanguagePlugin.class));
}
});
}
示例3: applyIdeaPlugin
import org.gradle.plugins.ide.idea.IdeaPlugin; //导入依赖的package包/类
private void applyIdeaPlugin(Project root) {
Set<Project> allProjects = root.getAllprojects();
for (Project p : allProjects) {
p.getPlugins().apply(IdeaPlugin.class);
}
root.getPlugins().getPlugin(IdeaPlugin.class).makeSureModuleNamesAreUnique();
}
示例4: create
import org.gradle.plugins.ide.idea.IdeaPlugin; //导入依赖的package包/类
public ModuleDependency create(Project project, String scope) {
if (project.getPlugins().hasPlugin(IdeaPlugin.class)) {
return new ModuleDependency(((IdeaModel) project.getExtensions().getByName("idea")).getModule().getName(), scope);
} else {
return new ModuleDependency(project.getName(), scope);
}
}
示例5: ideaPluginFor
import org.gradle.plugins.ide.idea.IdeaPlugin; //导入依赖的package包/类
private IdeaPlugin ideaPluginFor(Project project) {
return project.getPlugins().getPlugin(IdeaPlugin.class);
}
示例6: hasIdeaPlugin
import org.gradle.plugins.ide.idea.IdeaPlugin; //导入依赖的package包/类
private static boolean hasIdeaPlugin(Project project) {
return project.getPlugins().hasPlugin(IdeaPlugin.class);
}
示例7: configureIntelliJ
import org.gradle.plugins.ide.idea.IdeaPlugin; //导入依赖的package包/类
private static void configureIntelliJ(final Project project) {
project.getPlugins().withType(IdeaPlugin.class).all(new Action<IdeaPlugin>() {
@Override
public void execute(IdeaPlugin ideaPlugin) {
SourceSet mainSourceSet = getMainSourceSet(project);
SourceSet testSourceSet = getTestSourceSet(project);
final File mainGeneratedOutputDir = getGeneratedOutputDir(project, mainSourceSet, JAVA_EXTENSION);
final File testGeneratedOutputDir = getGeneratedOutputDir(project, testSourceSet, JAVA_EXTENSION);
project.getTasks().withType(GenerateIdeaModule.class).all(new Action<GenerateIdeaModule>() {
@Override
public void execute(GenerateIdeaModule generateIdeaModule) {
generateIdeaModule.doFirst(new Action<Task>() {
@Override
public void execute(Task task) {
project.mkdir(mainGeneratedOutputDir);
project.mkdir(testGeneratedOutputDir);
}
});
}
});
IdeaModule module = ideaPlugin.getModel().getModule();
module.setSourceDirs(new SetBuilder<File>()
.addAll(module.getSourceDirs())
.add(getAvroSourceDir(project, mainSourceSet))
.build());
module.setTestSourceDirs(new SetBuilder<File>()
.addAll(module.getTestSourceDirs())
.add(getAvroSourceDir(project, testSourceSet))
.build());
// IntelliJ doesn't allow source directories beneath an excluded directory.
// Thus, we remove the build directory exclude and add all non-generated sub-directories as excludes.
SetBuilder<File> excludeDirs = new SetBuilder<>();
excludeDirs.addAll(module.getExcludeDirs()).remove(project.getBuildDir());
File buildDir = project.getBuildDir();
if (buildDir.isDirectory()) {
excludeDirs.addAll(project.getBuildDir().listFiles(new NonGeneratedDirectoryFileFilter()));
}
module.setExcludeDirs(excludeDirs.build());
}
});
}