當前位置: 首頁>>代碼示例>>Java>>正文


Java Project.hasProperty方法代碼示例

本文整理匯總了Java中org.gradle.api.Project.hasProperty方法的典型用法代碼示例。如果您正苦於以下問題:Java Project.hasProperty方法的具體用法?Java Project.hasProperty怎麽用?Java Project.hasProperty使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.gradle.api.Project的用法示例。


在下文中一共展示了Project.hasProperty方法的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);
}
 
開發者ID:lxxlxx888,項目名稱:Reer,代碼行數:22,代碼來源:PgpSignatoryFactory.java

示例2: isLocalJarEnabled

import org.gradle.api.Project; //導入方法依賴的package包/類
private boolean isLocalJarEnabled(Project project) {
    boolean localJarEnabled = AtlasBuildContext.sBuilderAdapter.localJarEnabled;
    if (project.hasProperty("localJarEnabled")) {
        localJarEnabled = "true".equals(project.property("localJarEnabled"));
    }
    return localJarEnabled;
}
 
開發者ID:alibaba,項目名稱:atlas,代碼行數:8,代碼來源:AddLocalJarTask.java

示例3: 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;

    }
 
開發者ID:alibaba,項目名稱:atlas,代碼行數:47,代碼來源:AwbGenerator.java


注:本文中的org.gradle.api.Project.hasProperty方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。