本文整理了Java中org.gradle.api.Project.getPath()
方法的一些代码示例,展示了Project.getPath()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Project.getPath()
方法的具体详情如下:
包路径:org.gradle.api.Project
类名称:Project
方法名:getPath
暂无
代码示例来源:origin: uber/okbuck
private static String getCacheKey(Project project, String prefix) {
return prefix + project.getPath();
}
}
代码示例来源:origin: uber/okbuck
public Target(Project project, String name) {
this.project = project;
this.name = name;
identifier = project.getPath().replaceFirst(":", "");
path = identifier.replaceAll(":", File.separator);
rootProject = project.getRootProject();
}
代码示例来源:origin: uber/okbuck
getProject().getPath().replace(":", File.separator).substring(1) + File.separator;
代码示例来源:origin: org.gradle/gradle-core
public void add(Runnable configuration) {
if (fired) {
String message = "Cannot add deferred configuration for project " + project.getPath();
if (firedSentinel == null) {
throw new IllegalStateException(message);
} else {
throw new IllegalStateException(message, firedSentinel);
}
} else {
this.configuration.add(configuration);
}
}
代码示例来源:origin: gradle.plugin.org.shipkit/shipkit
public void execute(Project project) {
LOGGER.info("{} - executing deferred configuration using 'afterEvaluate'",
project.getPath().equals(":") ? "Root project" : project.getPath());
runnable.run();
}
});
代码示例来源:origin: org.shipkit/shipkit
public void execute(Project project) {
LOGGER.info("{} - executing deferred configuration using 'afterEvaluate'",
project.getPath().equals(":") ? "Root project" : project.getPath());
runnable.run();
}
});
代码示例来源:origin: org.gradle/gradle-core
@Override
public void beforeEvaluate(Project project) {
// --configuration-on-demand can sometimes cause projects to be configured after execution phase has started
// see ConfigurationOnDemandIntegrationTest
final String projectPath = project.getPath().equals(":") ? "root project" : project.getPath();
ProgressLogger currentTask = progressLoggerFactory
.newOperation(ProjectEvaluationLogger.class)
.start("Configuring ".concat(projectPath), projectPath);
currentProjects.put(project.getPath(), currentTask);
}
代码示例来源:origin: com.darylteo.gradle/gradle-watcher
private String[] generateTaskArguments(Project project, List<Object> tasks) {
List<String> result = new LinkedList<>();
for (Object task : tasks) {
if (task instanceof Task) {
result.add(((Task) task).getPath());
} else {
result.add(String.format("%s:%s", project.getPath(), task));
}
}
return result.toArray(new String[result.size()]);
}
代码示例来源:origin: org.gradle/gradle-core
@Override
public void afterEvaluate(Project project, ProjectState state) {
ProgressLogger logger = currentProjects.remove(project.getPath());
if (logger != null) {
logger.completed();
}
}
}
代码示例来源:origin: org.shipkit/shipkit
public static void requireRootProject(final Project project, final Class<?> clazz, final String explanation) {
if (project.getParent() != null) {
throw new GradleException("Plugin '" + clazz.getSimpleName() + "' is intended to be applied only root project.\n" +
(explanation != null ? explanation + "\n" : "" ) +
"Please apply this plugin to the root project instead of '" + project.getPath() + "'.");
}
}
}
代码示例来源:origin: mockito/shipkit
public static void requireRootProject(final Project project, final Class<?> clazz, final String explanation) {
if (project.getParent() != null) {
throw new GradleException("Plugin '" + clazz.getSimpleName() + "' is intended to be applied only root project.\n" +
(explanation != null ? explanation + "\n" : "" ) +
"Please apply this plugin to the root project instead of '" + project.getPath() + "'.");
}
}
}
代码示例来源:origin: org.gradle/gradle-core
@Override
public int compareTo(Project otherProject) {
int depthCompare = depthCompare(otherProject);
if (depthCompare == 0) {
return getPath().compareTo(otherProject.getPath());
} else {
return depthCompare;
}
}
代码示例来源:origin: me.seeber.gradle/gradle-workspace-plugin
/**
* @see java.lang.Object#hashCode()
*/
@Override
public int hashCode() {
int hash = 0;
hash = (31 * hash) + getProject().getPath().hashCode();
hash = (31 * hash) + getConfiguration().getName().hashCode();
return hash;
}
代码示例来源:origin: org.gradle/gradle-core
@Override
public void afterEvaluate(Project project, ProjectState state) {
if (project.getGradle() == rootGradle) {
logger.afterEvaluate(project.getPath());
}
}
代码示例来源:origin: org.gradle/gradle-core
@Override
public void beforeEvaluate(Project project) {
if (project.getGradle() == rootGradle) {
logger.beforeEvaluate(project.getPath());
}
}
代码示例来源: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: org.gradle/gradle-core
public void afterEvaluate(Project project, ProjectState state) {
long now = clock.getCurrentTime();
ProjectProfile projectProfile = buildProfile.getProjectProfile(project.getPath());
projectProfile.getConfigurationOperation().setFinish(now);
}
代码示例来源:origin: io.freefair.gradle/war-plugin
private void configureOverlay(WarOverlay overlay, Project otherProject) {
project.evaluationDependsOn(otherProject.getPath());
War otherWar = (War) otherProject.getTasks().getByName(WAR_TASK_NAME);
configureOverlay(overlay, otherWar);
if (overlay.isEnableCompilation()) {
project.getDependencies().add(COMPILE_CLASSPATH_CONFIGURATION_NAME, otherProject);
project.getDependencies().add(TEST_COMPILE_CLASSPATH_CONFIGURATION_NAME, otherProject);
}
}
代码示例来源:origin: org.gradle/gradle-core
public void beforeExecute(Task task) {
long now = clock.getCurrentTime();
Project project = task.getProject();
ProjectProfile projectProfile = buildProfile.getProjectProfile(project.getPath());
projectProfile.getTaskProfile(task.getPath()).setStart(now);
}
代码示例来源:origin: org.gradle/gradle-core
public void afterExecute(Task task, TaskState state) {
long now = clock.getCurrentTime();
Project project = task.getProject();
ProjectProfile projectProfile = buildProfile.getProjectProfile(project.getPath());
TaskExecution taskExecution = projectProfile.getTaskProfile(task.getPath());
taskExecution.setFinish(now);
taskExecution.completed(state);
}
内容来源于网络,如有侵权,请联系作者删除!