本文整理匯總了Java中org.gradle.api.Project.file方法的典型用法代碼示例。如果您正苦於以下問題:Java Project.file方法的具體用法?Java Project.file怎麽用?Java Project.file使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.gradle.api.Project
的用法示例。
在下文中一共展示了Project.file方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: readProperties
import org.gradle.api.Project; //導入方法依賴的package包/類
protected PgpSignatory readProperties(Project project, String prefix, String name, boolean required) {
ArrayList<Object> values = new ArrayList<Object>();
for (String property : PROPERTIES) {
String qualifiedProperty = (String)getQualifiedPropertyName(prefix, property);
if (project.hasProperty(qualifiedProperty)) {
values.add(
project.property(qualifiedProperty));
} else {
if (required) {
throw new InvalidUserDataException("property \'" + qualifiedProperty + "\' could not be found on project and is needed for signing");
} else {
return null;
}
}
}
String keyId = values.get(0).toString();
File keyRing = project.file(values.get(1).toString());
String password = values.get(2).toString();
return createSignatory(name, keyId, keyRing, password);
}
示例2: createAwbBundle
import org.gradle.api.Project; //導入方法依賴的package包/類
public AwbBundle createAwbBundle(LibVariantContext libVariantContext) throws IOException {
String variantName = libVariantContext.getVariantName();
AtlasDependencyTree libDependencyTree = AtlasBuildContext.libDependencyTrees.get(variantName);
//TODO 2.3
if (null == libDependencyTree) {
libDependencyTree = new AtlasDepTreeParser(libVariantContext.getProject(),
new ExtraModelInfo(libVariantContext.getProject()), null)
.parseDependencyTree(libVariantContext.getVariantDependency());
AtlasBuildContext.libDependencyTrees.put(variantName, libDependencyTree);
}
Project project = libVariantContext.getProject();
String groupName = (String)project.getGroup();
String name = "";
String version = (String)project.getVersion();
if (project.hasProperty("archivesBaseName")) {
name = (String)project.getProperties().get("archivesBaseName");
} else {
name = project.getName();
}
File explodedDir = project.file(
project.getBuildDir().getAbsolutePath() + "/" + FD_INTERMEDIATES + "/exploded-awb/" + computeArtifactPath(
groupName, name, version));
FileUtils.deleteDirectory(explodedDir);
MavenCoordinates mavenCoordinates = new MavenCoordinatesImpl(groupName, name, version, "awb", "");
ResolvedDependencyInfo resolvedDependencyInfo = new ResolvedDependencyInfo(groupName, name, version, "awb");
resolvedDependencyInfo.setVariantName(libVariantContext.getVariantName());
AwbBundle awbBundle = new AwbBundle(resolvedDependencyInfo, DependencyConvertUtils
.toAndroidLibrary(mavenCoordinates, libVariantContext.getBundleTask().getArchivePath(), explodedDir));
awbBundle.getSoLibraries().addAll(libDependencyTree.getMainBundle().getSoLibraries());
awbBundle.getAndroidLibraries().addAll(libDependencyTree.getMainBundle().getAndroidLibraries());
awbBundle.getJavaLibraries().addAll(libDependencyTree.getMainBundle().getJavaLibraries());
return awbBundle;
}
示例3: createAbsolutePath
import org.gradle.api.Project; //導入方法依賴的package包/類
/**
* Converts the given path relative to the gradle project to a
* absolute path and returns the absolute path.
*/
public static File createAbsolutePath(Object filePath, Project gradleProject){
File absolute = gradleProject.file(filePath);
return absolute;
}