本文整理了Java中org.gradle.api.Project.getBuildFile()
方法的一些代码示例,展示了Project.getBuildFile()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Project.getBuildFile()
方法的具体详情如下:
包路径:org.gradle.api.Project
类名称:Project
方法名:getBuildFile
暂无
代码示例来源:origin: uber/okbuck
/** generate {@code BUCKFile} */
public static void generate(
Project project, BuckFileManager buckFileManager, VisibilityExtension visibilityExtension) {
List<Rule> rules = createRules(project);
File moduleDir = project.getBuildFile().getParentFile();
File visibilityFile = new File(moduleDir, visibilityExtension.visibilityFileName);
boolean hasVisibilityFile = visibilityFile.isFile();
Multimap<String, String> extraLoadStatements = TreeMultimap.create();
if (hasVisibilityFile) {
rules.forEach(rule -> rule.fileConfiguredVisibility(true));
extraLoadStatements.put(
":" + visibilityExtension.visibilityFileName, visibilityExtension.visibilityFunction);
}
File buckFile = project.file(OkBuckGradlePlugin.BUCK);
buckFileManager.writeToBuckFile(rules, buckFile, extraLoadStatements);
}
代码示例来源:origin: uber/okbuck
.buckProjects
.stream()
.filter(p -> p.getBuildFile().exists())
.forEach(
bp -> {
代码示例来源:origin: gradle.plugin.com.google.cloud.tools/jib-gradle-plugin
/**
* Prints the locations of a project's build.gradle, settings.gradle, and gradle.properties.
*
* @param project the project
*/
private static void printGradleFiles(Project project) {
Path projectPath = project.getProjectDir().toPath();
// Print build.gradle
System.out.println(project.getBuildFile());
// Print settings.gradle
if (project.getGradle().getStartParameter().getSettingsFile() != null) {
System.out.println(project.getGradle().getStartParameter().getSettingsFile());
} else if (Files.exists(projectPath.resolve(Settings.DEFAULT_SETTINGS_FILE))) {
System.out.println(projectPath.resolve(Settings.DEFAULT_SETTINGS_FILE));
}
// Print gradle.properties
if (Files.exists(projectPath.resolve("gradle.properties"))) {
System.out.println(projectPath.resolve("gradle.properties"));
}
}
代码示例来源:origin: GoogleCloudPlatform/google-cloud-intellij
@Override
public Object buildAll(String modelName, Project project) {
boolean hasAppEngineGradlePlugin = project.getPlugins().hasPlugin(APP_GRADLE_PLUGIN_ID);
boolean hasWarPlugin = project.getPlugins().hasPlugin(GRADLE_WAR_PLUGIN_ID);
String webAppDir = null;
if (hasWarPlugin) {
webAppDir =
project.property(GRADLE_WEB_APP_DIR_PROPERTY_NAME) != null
? String.valueOf(project.property(GRADLE_WEB_APP_DIR_PROPERTY_NAME))
: null;
}
return new DefaultAppEngineGradleModel(
hasAppEngineGradlePlugin,
project.getBuildDir().getAbsolutePath(),
project.getBuildFile().getParent(),
webAppDir);
}
代码示例来源:origin: org.gradle/gradle-core
private LoadProjectsBuildOperationType.Result.Project convert(org.gradle.api.Project project) {
return new BuildStructureOperationProject(
project.getName(),
project.getPath(),
((ProjectInternal) project).getIdentityPath().toString(),
project.getProjectDir().getAbsolutePath(),
project.getBuildFile().getAbsolutePath(),
convert(project.getChildProjects().values()));
}
代码示例来源:origin: gradle.plugin.org.zeroturnaround/gradle-jrebel-plugin
File buildXmlFile = getProject().getBuildFile();
代码示例来源:origin: zeroturnaround/gradle-jrebel-plugin
File buildXmlFile = getProject().getBuildFile();
代码示例来源:origin: me.seeber.gradle/gradle-workspace-plugin
"Version '{}' of local project '{}' does not match version '{}' specified in build file '{}'",
projectDependency.getVersion(), projectDependency.getName(), dependency.getVersion(),
project.getRootProject().relativePath(project.getBuildFile()));
内容来源于网络,如有侵权,请联系作者删除!