本文整理汇总了Java中org.gradle.api.internal.project.ProjectInternal类的典型用法代码示例。如果您正苦于以下问题:Java ProjectInternal类的具体用法?Java ProjectInternal怎么用?Java ProjectInternal使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ProjectInternal类属于org.gradle.api.internal.project包,在下文中一共展示了ProjectInternal类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: apply
import org.gradle.api.internal.project.ProjectInternal; //导入依赖的package包/类
public void apply(ProjectInternal project) {
project.getPluginManager().apply(BasePlugin.class);
project.getPluginManager().apply(ReportingBasePlugin.class);
project.getPluginManager().apply(LanguageBasePlugin.class);
project.getPluginManager().apply(BinaryBasePlugin.class);
JavaPluginConvention javaConvention = new JavaPluginConvention(project, instantiator);
project.getConvention().getPlugins().put("java", javaConvention);
configureCompileDefaults(project, javaConvention);
BridgedBinaries binaries = configureSourceSetDefaults(javaConvention);
modelRegistry.register(ModelRegistrations.bridgedInstance(ModelReference.of("bridgedBinaries", BridgedBinaries.class), binaries)
.descriptor("JavaBasePlugin.apply()")
.hidden(true)
.build());
configureJavaDoc(project, javaConvention);
configureTest(project, javaConvention);
configureBuildNeeded(project);
configureBuildDependents(project);
}
开发者ID:lxxlxx888,项目名称:Reer,代码行数:23,代码来源:JavaBasePlugin.java
示例2: apply
import org.gradle.api.internal.project.ProjectInternal; //导入依赖的package包/类
public void apply(final Project project) {
project.getPluginManager().apply(JavaBasePlugin.class);
final OsgiPluginConvention osgiConvention = new OsgiPluginConvention((ProjectInternal) project);
project.getConvention().getPlugins().put("osgi", osgiConvention);
project.getPlugins().withType(JavaPlugin.class, new Action<JavaPlugin>() {
@Override
public void execute(JavaPlugin javaPlugin) {
OsgiManifest osgiManifest = osgiConvention.osgiManifest();
osgiManifest.setClassesDir(project.getConvention().getPlugin(JavaPluginConvention.class).getSourceSets().getByName("main").getOutput().getClassesDir());
osgiManifest.setClasspath(project.getConfigurations().getByName("runtime"));
Jar jarTask = (Jar) project.getTasks().getByName("jar");
jarTask.setManifest(osgiManifest);
}
});
}
开发者ID:lxxlxx888,项目名称:Reer,代码行数:18,代码来源:OsgiPlugin.java
示例3: getTargetProject
import org.gradle.api.internal.project.ProjectInternal; //导入依赖的package包/类
private ProjectInternal getTargetProject(Object target) {
ProjectInternal project;
if (target == null) {
project = gradle.getDefaultProject();
} else if (target instanceof GradleProjectIdentity) {
GradleProjectIdentity projectIdentity = (GradleProjectIdentity) target;
GradleInternal build = findBuild(projectIdentity);
project = findProject(build, projectIdentity);
} else if (target instanceof GradleBuildIdentity) {
GradleBuildIdentity buildIdentity = (GradleBuildIdentity) target;
project = findBuild(buildIdentity).getDefaultProject();
} else {
throw new IllegalArgumentException("Don't know how to build models for " + target);
}
return project;
}
开发者ID:lxxlxx888,项目名称:Reer,代码行数:17,代码来源:DefaultBuildController.java
示例4: wrap
import org.gradle.api.internal.project.ProjectInternal; //导入依赖的package包/类
private ScriptTarget wrap(Object target, boolean isInitialPass) {
if (target instanceof ProjectInternal && topLevelScript) {
// Only use this for top level project scripts
return new ProjectScriptTarget((ProjectInternal) target);
}
if (target instanceof GradleInternal && topLevelScript) {
// Only use this for top level init scripts
return new InitScriptTarget((GradleInternal) target);
}
if (target instanceof SettingsInternal && topLevelScript) {
// Only use this for top level settings scripts
if (isInitialPass) {
return new InitialPassSettingScriptTarget((SettingsInternal) target);
} else {
return new SettingScriptTarget((SettingsInternal) target);
}
} else {
return new DefaultScriptTarget(target);
}
}
开发者ID:lxxlxx888,项目名称:Reer,代码行数:21,代码来源:DefaultScriptPluginFactory.java
示例5: apply
import org.gradle.api.internal.project.ProjectInternal; //导入依赖的package包/类
@Override
public void apply(final ProjectInternal project) {
final TaskContainerInternal tasks = project.getTasks();
// static classes are used for the actions to avoid implicitly dragging project/tasks into the model registry
String projectName = project.toString();
tasks.addPlaceholderAction(ProjectInternal.HELP_TASK, Help.class, new HelpAction());
tasks.addPlaceholderAction(ProjectInternal.PROJECTS_TASK, ProjectReportTask.class, new ProjectReportTaskAction(projectName));
tasks.addPlaceholderAction(ProjectInternal.TASKS_TASK, TaskReportTask.class, new TaskReportTaskAction(projectName, project.getChildProjects().isEmpty()));
tasks.addPlaceholderAction(PROPERTIES_TASK, PropertyReportTask.class, new PropertyReportTaskAction(projectName));
tasks.addPlaceholderAction(DEPENDENCY_INSIGHT_TASK, DependencyInsightReportTask.class, new DependencyInsightReportTaskAction(projectName));
tasks.addPlaceholderAction(DEPENDENCIES_TASK, DependencyReportTask.class, new DependencyReportTaskAction(projectName));
tasks.addPlaceholderAction(BuildEnvironmentReportTask.TASK_NAME, BuildEnvironmentReportTask.class, new BuildEnvironmentReportTaskAction(projectName));
tasks.addPlaceholderAction(COMPONENTS_TASK, ComponentReport.class, new ComponentReportAction(projectName));
tasks.addPlaceholderAction(MODEL_TASK, ModelReport.class, new ModelReportAction(projectName));
tasks.addPlaceholderAction(DEPENDENT_COMPONENTS_TASK, DependentComponentsReport.class, new DependentComponentsReportAction(projectName));
}
开发者ID:lxxlxx888,项目名称:Reer,代码行数:18,代码来源:HelpTasksPlugin.java
示例6: createChildProject
import org.gradle.api.internal.project.ProjectInternal; //导入依赖的package包/类
public Project createChildProject(String name, Project parent, File projectDir) {
ProjectInternal parentProject = (ProjectInternal) parent;
DefaultProject project = CLASS_GENERATOR.newInstance(
DefaultProject.class,
name,
parentProject,
(projectDir != null) ? projectDir.getAbsoluteFile() : new File(parentProject.getProjectDir(), name),
new StringScriptSource("test build file", null),
parentProject.getGradle(),
parentProject.getGradle().getServiceRegistryFactory(),
parentProject.getClassLoaderScope().createChild("project-" + name),
parentProject.getBaseClassLoaderScope()
);
parentProject.addChildProject(project);
parentProject.getProjectRegistry().addProject(project);
return project;
}
开发者ID:lxxlxx888,项目名称:Reer,代码行数:18,代码来源:ProjectBuilderImpl.java
示例7: createProject
import org.gradle.api.internal.project.ProjectInternal; //导入依赖的package包/类
public Project createProject(String name, File inputProjectDir, File gradleUserHomeDir) {
File projectDir = prepareProjectDir(inputProjectDir);
final File homeDir = new File(projectDir, "gradleHome");
StartParameter startParameter = new StartParameter();
File userHomeDir = gradleUserHomeDir == null ? new File(projectDir, "userHome") : FileUtils.canonicalize(gradleUserHomeDir);
startParameter.setGradleUserHomeDir(userHomeDir);
NativeServices.initialize(userHomeDir);
ServiceRegistry topLevelRegistry = new TestBuildScopeServices(getUserHomeServices(userHomeDir), startParameter, homeDir);
GradleInternal gradle = CLASS_GENERATOR.newInstance(DefaultGradle.class, null, startParameter, topLevelRegistry.get(ServiceRegistryFactory.class));
DefaultProjectDescriptor projectDescriptor = new DefaultProjectDescriptor(null, name, projectDir, new DefaultProjectDescriptorRegistry(),
topLevelRegistry.get(FileResolver.class));
ClassLoaderScope baseScope = gradle.getClassLoaderScope();
ClassLoaderScope rootProjectScope = baseScope.createChild("root-project");
ProjectInternal project = topLevelRegistry.get(IProjectFactory.class).createProject(projectDescriptor, null, gradle, rootProjectScope, baseScope);
gradle.setRootProject(project);
gradle.setDefaultProject(project);
return project;
}
开发者ID:lxxlxx888,项目名称:Reer,代码行数:26,代码来源:ProjectBuilderImpl.java
示例8: getSelection
import org.gradle.api.internal.project.ProjectInternal; //导入依赖的package包/类
private TaskSelection getSelection(String path, ProjectInternal project) {
ResolvedTaskPath taskPath = taskPathResolver.resolvePath(path, project);
ProjectInternal targetProject = taskPath.getProject();
if (taskPath.isQualified()) {
configurer.configure(targetProject);
} else {
configurer.configureHierarchy(targetProject);
}
TaskSelectionResult tasks = taskNameResolver.selectWithName(taskPath.getTaskName(), taskPath.getProject(), !taskPath.isQualified());
if (tasks != null) {
// An exact match
return new TaskSelection(taskPath.getProject().getPath(), path, tasks);
}
Map<String, TaskSelectionResult> tasksByName = taskNameResolver.selectAll(taskPath.getProject(), !taskPath.isQualified());
NameMatcher matcher = new NameMatcher();
String actualName = matcher.find(taskPath.getTaskName(), tasksByName.keySet());
if (actualName != null) {
return new TaskSelection(taskPath.getProject().getPath(), taskPath.getPrefix() + actualName, tasksByName.get(actualName));
}
throw new TaskSelectionException(matcher.formatErrorMessage("task", taskPath.getProject()));
}
开发者ID:lxxlxx888,项目名称:Reer,代码行数:25,代码来源:TaskSelector.java
示例9: visitFile
import org.gradle.api.internal.project.ProjectInternal; //导入依赖的package包/类
@Override
public void visitFile(final FileVisitDetails fileDetails) {
final File outputFileDir = new File(destinationDir, fileDetails.getRelativePath().getParent().getPathString());
// Copy the raw form
FileOperations fileOperations = (ProjectInternal) getProject();
fileOperations.copy(new Action<CopySpec>() {
@Override
public void execute(CopySpec copySpec) {
copySpec.from(fileDetails.getFile()).into(outputFileDir);
}
});
// Capture the relative file
relativeFiles.add(new RelativeFile(fileDetails.getFile(), fileDetails.getRelativePath()));
}
开发者ID:lxxlxx888,项目名称:Reer,代码行数:17,代码来源:JavaScriptMinify.java
示例10: getFilter
import org.gradle.api.internal.project.ProjectInternal; //导入依赖的package包/类
public Spec<Task> getFilter(String path) {
final ResolvedTaskPath taskPath = taskPathResolver.resolvePath(path, gradle.getDefaultProject());
if (!taskPath.isQualified()) {
ProjectInternal targetProject = taskPath.getProject();
configurer.configure(targetProject);
if (taskNameResolver.tryFindUnqualifiedTaskCheaply(taskPath.getTaskName(), taskPath.getProject())) {
// An exact match in the target project - can just filter tasks by path to avoid configuring sub-projects at this point
return new TaskPathSpec(targetProject, taskPath.getTaskName());
}
}
final Set<Task> selectedTasks = getSelection(path, gradle.getDefaultProject()).getTasks();
return new Spec<Task>() {
public boolean isSatisfiedBy(Task element) {
return !selectedTasks.contains(element);
}
};
}
开发者ID:lxxlxx888,项目名称:Reer,代码行数:19,代码来源:TaskSelector.java
示例11: findProject
import org.gradle.api.internal.project.ProjectInternal; //导入依赖的package包/类
public ProjectInternal findProject(String projectPath, ProjectInternal startFrom) {
if (projectPath.equals(Project.PATH_SEPARATOR)) {
return startFrom.getRootProject();
}
Project current = startFrom;
if (projectPath.startsWith(Project.PATH_SEPARATOR)) {
current = current.getRootProject();
projectPath = projectPath.substring(1);
}
for (String pattern : projectPath.split(Project.PATH_SEPARATOR)) {
Map<String, Project> children = current.getChildProjects();
NameMatcher matcher = new NameMatcher();
Project child = matcher.find(pattern, children);
if (child != null) {
current = child;
continue;
}
throw new ProjectLookupException(matcher.formatErrorMessage("project", current));
}
return (ProjectInternal) current;
}
开发者ID:lxxlxx888,项目名称:Reer,代码行数:25,代码来源:ProjectFinderByTaskPath.java
示例12: apply
import org.gradle.api.internal.project.ProjectInternal; //导入依赖的package包/类
@Override
public void apply(ProjectInternal project) {
addClean(project);
addCleanRule(project);
addAssemble(project);
addCheck(project);
addBuild(project);
addDeprecationWarningsAboutCustomLifecycleTasks(project);
}
开发者ID:lxxlxx888,项目名称:Reer,代码行数:10,代码来源:LifecycleBasePlugin.java
示例13: addClean
import org.gradle.api.internal.project.ProjectInternal; //导入依赖的package包/类
private void addClean(final ProjectInternal project) {
addPlaceholderAction(project, CLEAN_TASK_NAME, Delete.class, new Action<Delete>() {
@Override
public void execute(Delete clean) {
clean.setDescription("Deletes the build directory.");
clean.setGroup(BUILD_GROUP);
clean.delete(new Callable<File>() {
public File call() throws Exception {
return project.getBuildDir();
}
});
}
});
}
开发者ID:lxxlxx888,项目名称:Reer,代码行数:15,代码来源:LifecycleBasePlugin.java
示例14: addAssemble
import org.gradle.api.internal.project.ProjectInternal; //导入依赖的package包/类
private void addAssemble(ProjectInternal project) {
addPlaceholderAction(project, ASSEMBLE_TASK_NAME, DefaultTask.class, new Action<TaskInternal>() {
@Override
public void execute(TaskInternal assembleTask) {
assembleTask.setDescription("Assembles the outputs of this project.");
assembleTask.setGroup(BUILD_GROUP);
}
});
}
开发者ID:lxxlxx888,项目名称:Reer,代码行数:10,代码来源:LifecycleBasePlugin.java
示例15: addCheck
import org.gradle.api.internal.project.ProjectInternal; //导入依赖的package包/类
private void addCheck(ProjectInternal project) {
addPlaceholderAction(project, CHECK_TASK_NAME, DefaultTask.class, new Action<TaskInternal>() {
@Override
public void execute(TaskInternal checkTask) {
checkTask.setDescription("Runs all checks.");
checkTask.setGroup(VERIFICATION_GROUP);
}
});
}
开发者ID:lxxlxx888,项目名称:Reer,代码行数:10,代码来源:LifecycleBasePlugin.java
示例16: addBuild
import org.gradle.api.internal.project.ProjectInternal; //导入依赖的package包/类
private void addBuild(final ProjectInternal project) {
addPlaceholderAction(project, BUILD_TASK_NAME, DefaultTask.class, new Action<DefaultTask>() {
@Override
public void execute(DefaultTask buildTask) {
buildTask.setDescription("Assembles and tests this project.");
buildTask.setGroup(BUILD_GROUP);
buildTask.dependsOn(ASSEMBLE_TASK_NAME);
buildTask.dependsOn(CHECK_TASK_NAME);
}
});
}
开发者ID:lxxlxx888,项目名称:Reer,代码行数:12,代码来源:LifecycleBasePlugin.java
示例17: evaluate
import org.gradle.api.internal.project.ProjectInternal; //导入依赖的package包/类
public void evaluate(final ProjectInternal project, final ProjectStateInternal state) {
if (state.getExecuted() || state.getExecuting()) {
return;
}
String displayName = "project " + project.getIdentityPath().toString();
buildOperationExecutor.run(BuildOperationDetails.displayName("Configure " + displayName).name(StringUtils.capitalize(displayName)).build(), new Action<BuildOperationContext>() {
@Override
public void execute(BuildOperationContext buildOperationContext) {
doConfigure(project, state);
state.rethrowFailure();
}
});
}
开发者ID:lxxlxx888,项目名称:Reer,代码行数:15,代码来源:LifecycleProjectEvaluator.java
示例18: apply
import org.gradle.api.internal.project.ProjectInternal; //导入依赖的package包/类
@Override
public final void apply(ProjectInternal project) {
this.project = project;
beforeApply();
project.getPluginManager().apply(ReportingBasePlugin.class);
createConfigurations();
extension = createExtension();
configureExtensionRule();
configureTaskRule();
configureSourceSetRule();
configureCheckTask();
}
开发者ID:lxxlxx888,项目名称:Reer,代码行数:14,代码来源:AbstractCodeQualityPlugin.java
示例19: apply
import org.gradle.api.internal.project.ProjectInternal; //导入依赖的package包/类
public void apply(final ProjectInternal project) {
this.project = project;
project.getPluginManager().apply(BasePlugin.class);
MavenFactory mavenFactory = project.getServices().get(MavenFactory.class);
final MavenPluginConvention pluginConvention = addConventionObject(project, mavenFactory);
final DefaultDeployerFactory deployerFactory = new DefaultDeployerFactory(
mavenFactory,
loggingManagerFactory,
fileResolver,
pluginConvention,
project.getConfigurations(),
pluginConvention.getConf2ScopeMappings(),
mavenSettingsProvider,
mavenRepositoryLocator);
configureUploadTasks(deployerFactory);
configureUploadArchivesTask();
PluginContainer plugins = project.getPlugins();
plugins.withType(JavaPlugin.class, new Action<JavaPlugin>() {
public void execute(JavaPlugin javaPlugin) {
configureJavaScopeMappings(project.getConfigurations(), pluginConvention.getConf2ScopeMappings());
configureInstall(project);
}
});
plugins.withType(WarPlugin.class, new Action<WarPlugin>() {
public void execute(WarPlugin warPlugin) {
configureWarScopeMappings(project.getConfigurations(), pluginConvention.getConf2ScopeMappings());
}
});
}
开发者ID:lxxlxx888,项目名称:Reer,代码行数:33,代码来源:MavenPlugin.java
示例20: getModel
import org.gradle.api.internal.project.ProjectInternal; //导入依赖的package包/类
public BuildResult<?> getModel(Object target, ModelIdentifier modelIdentifier) throws BuildExceptionVersion1, InternalUnsupportedModelException {
BuildCancellationToken cancellationToken = gradle.getServices().get(BuildCancellationToken.class);
if (cancellationToken.isCancellationRequested()) {
throw new BuildCancelledException(String.format("Could not build '%s' model. Build cancelled.", modelIdentifier.getName()));
}
ProjectInternal project = getTargetProject(target);
ToolingModelBuilder builder = getToolingModelBuilder(project, modelIdentifier);
Object model = builder.buildAll(modelIdentifier.getName(), project);
return new ProviderBuildResult<Object>(model);
}
开发者ID:lxxlxx888,项目名称:Reer,代码行数:11,代码来源:DefaultBuildController.java
注:本文中的org.gradle.api.internal.project.ProjectInternal类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论