本文整理匯總了Java中org.gradle.api.Project.getBuildDir方法的典型用法代碼示例。如果您正苦於以下問題:Java Project.getBuildDir方法的具體用法?Java Project.getBuildDir怎麽用?Java Project.getBuildDir使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.gradle.api.Project
的用法示例。
在下文中一共展示了Project.getBuildDir方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: execute
import org.gradle.api.Project; //導入方法依賴的package包/類
public void execute(final FileCollection source, File destDir, boolean use, boolean noTimestamp, boolean noVersionStamp,
String windowTitle, String docTitle, String header, String footer, String overview, boolean includePrivate,
final Set<Groovydoc.Link> links, final Iterable<File> groovyClasspath, Iterable<File> classpath, Project project) {
final File tmpDir = new File(project.getBuildDir(), "tmp/groovydoc");
FileOperations fileOperations = (ProjectInternal) project;
fileOperations.delete(tmpDir);
fileOperations.copy(new Action<CopySpec>() {
public void execute(CopySpec copySpec) {
copySpec.from(source).into(tmpDir);
}
});
List<File> combinedClasspath = ImmutableList.<File>builder()
.addAll(classpath)
.addAll(groovyClasspath)
.build();
VersionNumber version = VersionNumber.parse(getGroovyVersion(combinedClasspath));
final Map<String, Object> args = Maps.newLinkedHashMap();
args.put("sourcepath", tmpDir.toString());
args.put("destdir", destDir);
args.put("use", use);
if (isAtLeast(version, "2.4.6")) {
args.put("noTimestamp", noTimestamp);
args.put("noVersionStamp", noVersionStamp);
}
args.put("private", includePrivate);
putIfNotNull(args, "windowtitle", windowTitle);
putIfNotNull(args, "doctitle", docTitle);
putIfNotNull(args, "header", header);
putIfNotNull(args, "footer", footer);
if (overview != null) {
args.put("overview", overview);
}
invokeGroovydoc(links, combinedClasspath, args);
}
示例2: configureTaskPropertiesValidation
import org.gradle.api.Project; //導入方法依賴的package包/類
private void configureTaskPropertiesValidation(Project project) {
ValidateTaskProperties validator = project.getTasks().create(VALIDATE_TASK_PROPERTIES_TASK_NAME, ValidateTaskProperties.class);
File reportsDir = new File(project.getBuildDir(), "reports");
File validatorReportsDir = new File(reportsDir, "task-properties");
validator.setOutputFile(new File(validatorReportsDir, "report.txt"));
SourceSet mainSourceSet = project.getConvention().getPlugin(JavaPluginConvention.class).getSourceSets().getByName(SourceSet.MAIN_SOURCE_SET_NAME);
validator.setClasspath(mainSourceSet.getCompileClasspath());
validator.setClassesDir(mainSourceSet.getOutput().getClassesDir());
validator.dependsOn(mainSourceSet.getOutput());
project.getTasks().getByName(JavaBasePlugin.CHECK_TASK_NAME).dependsOn(validator);
}
示例3: getNpmOutputDir
import org.gradle.api.Project; //導入方法依賴的package包/類
private File getNpmOutputDir(Project project) {
TSGeneratorConfig config = project.getExtensions().getByType(TSGeneratorConfig.class);
File typescriptGenDir = config.getNpm().getOutputDir();
if (typescriptGenDir == null) {
return new File(project.getBuildDir(), "npm");
}
return typescriptGenDir;
}
示例4: setupPackageTasks
import org.gradle.api.Project; //導入方法依賴的package包/類
void setupPackageTasks(Project project, Task generateTask) {
final File buildDir = new File(project.getBuildDir(), "npm_compile");
final File distDir = getNpmOutputDir(project);
project.getTasks().create(PublishTypescriptStubsTask.NAME, PublishTypescriptStubsTask.class);
TSGeneratorConfig config = project.getExtensions().getByType(TSGeneratorConfig.class);
Copy copySources = project.getTasks().create("processTypescript", Copy.class);
copySources.from(config.getGenDir());
copySources.into(buildDir);
copySources.dependsOn(generateTask);
// copy .npmrc file from root to working directory if available
final File npmrcFile = new File(project.getProjectDir(), ".npmrc");
if (npmrcFile.exists()) {
copySources.getInputs().file(npmrcFile);
copySources.doFirst(new Action<Task>() {
@Override
public void execute(Task task) {
File targetFile = new File(buildDir, ".npmrc");
buildDir.mkdirs();
TypescriptUtils.copyFile(npmrcFile, targetFile);
}
});
}
CompileTypescriptStubsTask compileTypescriptTask = project.getTasks().create(CompileTypescriptStubsTask.NAME,
CompileTypescriptStubsTask.class);
try {
NpmInstallTask npmInstall = (NpmInstallTask) project.getTasks().getByName("npmInstall");
npmInstall.setWorkingDir(buildDir);
npmInstall.dependsOn(copySources);
npmInstall.getInputs().file(new File(buildDir, "package.json"));
npmInstall.getOutputs().dir(new File(buildDir, "node_modules"));
compileTypescriptTask.dependsOn(npmInstall);
}
catch (UnknownTaskException e) {
LOGGER.warn("task not found, ok in testing", e);
}
ConfigurableFileTree fileTree = project.fileTree(buildDir);
fileTree.include("package.json");
fileTree.include(".npmrc");
fileTree.include("**/*.ts");
fileTree.exclude("**/*.d.ts");
compileTypescriptTask.getInputs().files(fileTree);
compileTypescriptTask.setWorkingDir(buildDir);
compileTypescriptTask.getOutputs().dir(buildDir);
ConfigurableFileTree assembleFileTree = project.fileTree(new File(buildDir, "src"));
assembleFileTree.include("**/*.ts");
assembleFileTree.include("**/*.js");
assembleFileTree.include("**/*.js.map");
Copy assembleSources = project.getTasks().create("assembleTypescript", Copy.class);
assembleSources.from(assembleFileTree);
assembleSources.from(new File(buildDir, "package.json"));
assembleSources.into(distDir);
assembleSources.dependsOn(compileTypescriptTask);
}