org.gradle.api.file.ProjectLayout Java Examples

The following examples show how to use org.gradle.api.file.ProjectLayout. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: CMakeExtension.java    From native-samples with Apache License 2.0 5 votes vote down vote up
@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"));
}
 
Example #2
Source File: CMakeExtension.java    From native-samples with Apache License 2.0 5 votes vote down vote up
@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"));
}
 
Example #3
Source File: CMakeExtension.java    From native-samples with Apache License 2.0 5 votes vote down vote up
@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"));
}
 
Example #4
Source File: CMakeExtension.java    From native-samples with Apache License 2.0 5 votes vote down vote up
@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"));
}
 
Example #5
Source File: ContractVerifierExtension.java    From spring-cloud-contract with Apache License 2.0 5 votes vote down vote up
@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;
}
 
Example #6
Source File: GitPublishReset.java    From gradle-git-publish with Apache License 2.0 5 votes vote down vote up
@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);
}