org.gradle.api.Project.hasProperty()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(5.6k)|赞(0)|评价(0)|浏览(903)

本文整理了Java中org.gradle.api.Project.hasProperty()方法的一些代码示例,展示了Project.hasProperty()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Project.hasProperty()方法的具体详情如下:
包路径:org.gradle.api.Project
类名称:Project
方法名:hasProperty

Project.hasProperty介绍

暂无

代码示例

代码示例来源:origin: linkedin/rest.li

public static String findCompatLevel(Project project, String propertyName)
 {
  if (project.hasProperty(propertyName))
  {
   String compatLevel = project.property(propertyName).toString().toUpperCase();

   if (compatLevel.equals("OFF"))
   {
    return "IGNORE";
   }
   else
   {
    return compatLevel;
   }
  }
  else
  {
   if (propertyName.equals(SNAPSHOT_COMPAT_REQUIREMENT))
   {
    // backwards compatible by default.
    return "BACKWARDS";
   }
   else
   {
    // off by default
    return "OFF";
   }
  }
 }
}

代码示例来源:origin: apache/incubator-netbeans

NbProjectInfo model = new NbProjectInfoBuilder(prj).buildAll();
Map<String, Object> info = model.getInfo();
if (prj.hasProperty("nbSerializeCheck")) {
  List<String> serializeProblems = new LinkedList<>();

代码示例来源:origin: lenskit/lenskit

if (project.hasProperty(prjProp)) {
  Object val = project.findProperty(prjProp);
  String vstr = val != null ? val.toString() : null;

代码示例来源:origin: gradle.plugin.tui.sse.mde4cpp/MDE4CPPGeneratePlugin

/**
   * @param project Gradle project
   * @return true if parameter 'structureOnly' is configured, otherwise false
   */
  static boolean hasStructuredOnlyParameter(Project project)
  {
    return (project.hasProperty("StructureOnly") || project.hasProperty("SO"));
  }
}

代码示例来源:origin: diffplug/spotless

rootApplyTask.setDescription(APPLY_DESCRIPTION);
String filePatterns;
if (project.hasProperty(FILES_PROPERTY) && project.property(FILES_PROPERTY) instanceof String) {
  filePatterns = (String) project.property(FILES_PROPERTY);
} else {

代码示例来源:origin: spring-gradle-plugins/dependency-management-plugin

@Override
public String getProperty(String name) {
  if (this.project.hasProperty(name)) {
    Object property = this.project.property(name);
    if (property != null) {
      return property.toString();
    }
  }
  return null;
}

代码示例来源:origin: ibinti/bugvm

public String getIosSignIdentity() {
  return project.hasProperty("bugvm.iosSignIdentity")
      ? project.getProperties().get("bugvm.iosSignIdentity").toString()
      : iosSignIdentity;
}

代码示例来源:origin: ibinti/bugvm

public String getIosProvisioningProfile() {
  return project.hasProperty("bugvm.iosProvisioningProfile")
      ? project.getProperties().get("bugvm.iosProvisioningProfile").toString()
      : iosProvisioningProfile;
}

代码示例来源:origin: ibinti/bugvm

public String getIosSimulatorSdk() {
  return project.hasProperty("bugvm.iosSimulatorSdk")
      ? project.getProperties().get("bugvm.iosSimulatorSdk").toString()
      : iosSimulatorSdk;
}

代码示例来源:origin: ibinti/bugvm

public boolean isIosSkipSigning() {
  return project.hasProperty("bugvm.iosSkipSigning")
      ? Boolean.parseBoolean(project.getProperties().get("bugvm.iosSkipSigning").toString())
      : iosSkipSigning;
}

代码示例来源:origin: ibinti/bugvm

public int getDebugPort() {
  return project.hasProperty("bugvm.debugPort")
      ? Integer.parseInt(project.getProperties().get("bugvm.debugPort").toString())
      : debugPort;
}

代码示例来源:origin: ibinti/bugvm

public boolean isSkipLaunch() {
  return project.hasProperty("bugvm.skipLaunch")
      ? Boolean.parseBoolean(project.getProperties().get("bugvm.skipLaunch").toString())
      : skipLaunch;
}

代码示例来源:origin: ibinti/bugvm

public boolean isDebug() {
  return project.hasProperty("bugvm.debug")
      ? Boolean.parseBoolean(project.getProperties().get("bugvm.debug").toString())
      : debug;
}

代码示例来源:origin: ibinti/bugvm

public String getArchs() {
  if (project.hasProperty("bugvm.archs")) {
    return project.getProperties().get("bugvm.archs").toString();
  }
  return archs;
}

代码示例来源:origin: ibinti/bugvm

public String getCacheDir() {
    return project.hasProperty("bugvm.cacheDir") ? project.getProperties().get("bugvm.cacheDir").toString() : null;
  }
}

代码示例来源:origin: gradle.plugin.com.github.pivotalservices/ya-cf-app-gradle-plugin

public Optional<List<String>> getListPropertyFromProject(String propertyName) {
  if (this.project.hasProperty(propertyName)) {
    return Optional.of(Strings.split((String) this.project.property(propertyName)));
  }
  return Optional.empty();
}

代码示例来源:origin: gradle.plugin.br.com.sabium/gradle-bump

@Override
  public void apply(final Project project) {
    String versao = StringUtils.EMPTY;
    if (project.hasProperty("version")) {
      versao = System.getProperty("version");
    }
    Bump.setConfigurations(new GitVersion(project.getRootProject().getProjectDir().getAbsolutePath()), versao);
    project.getTasks().create("bump", Bump.class);
  }
}

代码示例来源:origin: MinecraftForge/ForgeGradle

LiteModJson(Project project, String minecraftVersion, String revision)
{
  this.project = project;
  this.mcversion = this.minecraftVersion = minecraftVersion;
  this.revision = revision;
  this.name = project.getName();
  this.displayName = project.hasProperty("displayName") ? project.property("displayName").toString() : project.getDescription();
  this.version = project.getVersion().toString();
}

代码示例来源:origin: com.android.tools.build/gradle-core

@Nullable
private static Boolean getOptionalBoolean(
    @NonNull Project project,
    @NonNull String propertyName) {
  if (project.hasProperty(propertyName)) {
    return getBoolean(project, propertyName);
  } else {
    return null;
  }
}

代码示例来源:origin: gradle.plugin.org.avaje.boot/boot-gradle-plugin

private String getMainClassNameProperty() {
  if (getProject().hasProperty("mainClassName")) {
    return (String) getProject().property("mainClassName");
  }
  ExtraPropertiesExtension extraProperties = (ExtraPropertiesExtension) getProject()
      .getExtensions().getByName("ext");
  if (extraProperties.has("mainClassName")) {
    return (String) extraProperties.get("mainClassName");
  }
  return null;
}

相关文章