Java源码示例:org.gradle.api.file.ProjectLayout

示例1
@Inject
public CMakeExtension(ProjectLayout projectLayout, ObjectFactory objectFactory) {
    binary = objectFactory.property(String.class);
    includeDirectory = objectFactory.directoryProperty();
    projectDirectory = objectFactory.directoryProperty();
    projectDirectory.set(projectLayout.getProjectDirectory());
    includeDirectory.set(projectDirectory.dir("include"));
}
 
示例2
@Inject
public CMakeExtension(ProjectLayout projectLayout, ObjectFactory objectFactory) {
    binary = objectFactory.property(String.class);
    includeDirectory = objectFactory.directoryProperty();
    projectDirectory = objectFactory.directoryProperty();
    projectDirectory.set(projectLayout.getProjectDirectory());
    includeDirectory.set(projectDirectory.dir("include"));
}
 
示例3
@Inject
public CMakeExtension(ProjectLayout projectLayout, ObjectFactory objectFactory) {
    binary = objectFactory.property(String.class);
    includeDirectory = objectFactory.directoryProperty();
    projectDirectory = objectFactory.directoryProperty();
    projectDirectory.set(projectLayout.getProjectDirectory());
    includeDirectory.set(projectDirectory.dir("include"));
}
 
示例4
@Inject
public CMakeExtension(ProjectLayout projectLayout, ObjectFactory objectFactory) {
    binary = objectFactory.property(String.class);
    includeDirectory = objectFactory.directoryProperty();
    projectDirectory = objectFactory.directoryProperty();
    projectDirectory.set(projectLayout.getProjectDirectory());
    includeDirectory.set(projectDirectory.dir("include"));
}
 
示例5
@Inject
public ContractVerifierExtension(ProjectLayout layout, ObjectFactory objects) {
	this.testFramework = objects.property(TestFramework.class).convention(TestFramework.JUNIT5);
	this.testMode = objects.property(TestMode.class).convention(TestMode.MOCKMVC);
	this.basePackageForTests = objects.property(String.class);
	this.baseClassForTests = objects.property(String.class);
	this.nameSuffixForTests = objects.property(String.class);
	this.ruleClassForTests = objects.property(String.class);
	this.excludedFiles = objects.listProperty(String.class).convention(new ArrayList<>());
	this.includedFiles = objects.listProperty(String.class).convention(new ArrayList<>());
	this.ignoredFiles = objects.listProperty(String.class).convention(new ArrayList<>());
	this.imports = objects.listProperty(String.class).convention(new ArrayList<>());
	this.staticImports = objects.listProperty(String.class).convention(new ArrayList<>());
	this.contractsDslDir = objects.directoryProperty().convention(layout.getProjectDirectory().dir("src/test/resources/contracts"));
	this.generatedTestSourcesDir = objects.directoryProperty().convention(layout.getBuildDirectory().dir("generated-test-sources/contracts"));
	this.generatedTestResourcesDir = objects.directoryProperty().convention(layout.getBuildDirectory().dir("generated-test-resources/contracts"));
	this.stubsOutputDir = objects.directoryProperty().convention(layout.getBuildDirectory().dir("stubs"));
	this.stubsSuffix = objects.property(String.class).convention("stubs");
	this.assertJsonSize = objects.property(Boolean.class).convention(false);
	this.failOnNoContracts = objects.property(Boolean.class).convention(true);
	this.failOnInProgress = objects.property(Boolean.class).convention(true);
	this.contractRepository = objects.newInstance(ContractRepository.class);
	this.publishStubsToScm = objects.newInstance(PublishStubsToScm.class);
	this.contractDependency = objects.newInstance(Dependency.class);
	this.contractsPath = objects.property(String.class);
	this.contractsMode = objects.property(StubRunnerProperties.StubsMode.class).convention(StubRunnerProperties.StubsMode.CLASSPATH);
	this.packageWithBaseClasses = objects.property(String.class);
	this.baseClassMappings = objects.newInstance(BaseClassMapping.class);
	this.excludeBuildFolders = objects.property(Boolean.class).convention(false);
	this.contractsSnapshotCheckSkip = objects.property(Boolean.class).convention(false);
	this.deleteStubsAfterTest = objects.property(Boolean.class).convention(true);
	this.convertToYaml = objects.property(Boolean.class).convention(false);
	this.contractsProperties = objects.mapProperty(String.class, String.class).convention(new HashMap<>());
	this.disableStubPublication = objects.property(Boolean.class).convention(false);
	this.sourceSet = objects.property(String.class);
	this.objects = objects;
}
 
示例6
@Inject
public GitPublishReset(ProjectLayout layout, ObjectFactory objectFactory) {
  this.grgit = objectFactory.property(Grgit.class);
  this.repoDirectory = getProject().getObjects().directoryProperty();
  this.repoUri = objectFactory.property(String.class);
  this.referenceRepoUri = objectFactory.property(String.class);
  this.branch = objectFactory.property(String.class);

  // always consider this task out of date
  this.getOutputs().upToDateWhen(t -> false);
}