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

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

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

Project.getGroup介绍

暂无

代码示例

代码示例来源:origin: uber/okbuck

public String getMavenCoords() {
 String group = getProject().getGroup().toString();
 String id =
   getProject().getConvention().getPlugin(BasePluginConvention.class).getArchivesBaseName();
 String version = getProject().getVersion().toString();
 return String.join(":", group, id, version);
}

代码示例来源:origin: uber/okbuck

VersionlessDependency versionless =
  VersionlessDependency.builder()
    .setGroup((String) target.getProject().getGroup())
    .setName(target.getProject().getName())
    .build();

代码示例来源:origin: gradle.plugin.com.liferay/gradle-plugins-app-docker

@Override
public Object call() throws Exception {
  return _project.getGroup();
}

代码示例来源:origin: gradle.plugin.com.prezi.pride/gradle-pride-plugin

@Override
  public void execute(Project project) {
    if (project.getGroup() == null || String.valueOf(project.getGroup()).isEmpty()) {
      throw new IllegalStateException("Group is not specified for project in " + project.getProjectDir());
    }
  }
});

代码示例来源:origin: prezi/pride

@Override
  public void execute(Project project) {
    if (project.getGroup() == null || String.valueOf(project.getGroup()).isEmpty()) {
      throw new IllegalStateException("Group is not specified for project in " + project.getProjectDir());
    }
  }
});

代码示例来源:origin: gradle.plugin.com.enonic.xp/xp-gradle-plugin

private String composeDefaultName()
{
  if ( this.project.getGroup().equals( "" ) )
  {
    return this.project.getName();
  }
  return this.project.getGroup().toString() + "." + this.project.getName();
}

代码示例来源:origin: gradle.plugin.com.enonic.gradle/xp-gradle-plugin

private String composeDefaultName()
{
  if ( this.project.getGroup().equals( "" ) )
  {
    return this.project.getName();
  }
  return this.project.getGroup().toString() + "." + this.project.getName();
}

代码示例来源:origin: gradle.plugin.me.seeber.gradle/gradle-project-config

/**
 * Get the project group
 *
 * @return Project group
 */
public String getGroup() {
  return Validate.notNull(this.project.getGroup().toString());
}

代码示例来源:origin: me.seeber.gradle/gradle-project-config

/**
 * Get the project group
 *
 * @return Project group
 */
public String getGroup() {
  return Validate.notNull(this.project.getGroup().toString());
}

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

private Set<String> getAllLocalProjectNames(Project rootProject) {
  Set<String> names = new HashSet<String>();
  for (Project localProject: rootProject.getAllprojects()) {
    names.add(localProject.getGroup() + ":" + localProject.getName());
  }
  return names;
}

代码示例来源:origin: gradle.plugin.org.shipkit/shipkit

@Override
  public void run() {
    if (project.getGroup() == null) {
      LOG.info("  Gradle project does not have 'group' property configured yet." +
          "\n  Shipkit is setting the group to 'org.shipkit.bootstrap' so that it has a reasonable default." +
          "\n  It is recommended that you configure the 'group' to your choice.");
      project.setGroup("org.shipkit.bootstrap");
    }
  }
});

代码示例来源:origin: org.shipkit/shipkit

@Override
  public void run() {
    if (project.getGroup() == null) {
      LOG.info("  Gradle project does not have 'group' property configured yet." +
          "\n  Shipkit is setting the group to 'org.shipkit.bootstrap' so that it has a reasonable default." +
          "\n  It is recommended that you configure the 'group' to your choice.");
      project.setGroup("org.shipkit.bootstrap");
    }
  }
});

代码示例来源:origin: org.sonarsource.scanner.gradle/sonarqube-gradle-plugin

private String computeProjectKey() {
  Project rootProject = targetProject.getRootProject();
  String rootProjectName = rootProject.getName();
  String rootGroup = rootProject.getGroup().toString();
  String rootKey = rootGroup.isEmpty() ? rootProjectName : (rootGroup + ":" + rootProjectName);
  if (targetProject == rootProject) {
   return rootKey;
  }
  return rootKey + targetProject.getPath();
 }
}

代码示例来源:origin: SonarSource/sonar-scanner-gradle

private String computeProjectKey() {
  Project rootProject = targetProject.getRootProject();
  String rootProjectName = rootProject.getName();
  String rootGroup = rootProject.getGroup().toString();
  String rootKey = rootGroup.isEmpty() ? rootProjectName : (rootGroup + ":" + rootProjectName);
  if (targetProject == rootProject) {
   return rootKey;
  }
  return rootKey + targetProject.getPath();
 }
}

代码示例来源:origin: me.seeber.gradle/gradle-workspace-plugin

/**
 * Provide a string key for an artifact
 *
 * @param project Project the artifact belongs to
 * @param artifact Artifact Artifact to get info for
 * @return Module key
 */
protected String moduleKey(Project project, PublishArtifact artifact) {
  String key = Objects.requireNonNull(ARTIFACT_JOINER.join(project.getGroup(), artifact.getName(),
      artifact.getType(), artifact.getExtension(), Strings.emptyToNull(artifact.getClassifier())));
  return key;
}

代码示例来源:origin: org.shipkit/shipkit

private String getDependencyProperty(Project project) {
  VersionInfo info = project.getRootProject().getExtensions().getByType(VersionInfo.class);
  return String.format("-Pdependency=%s:%s:%s", project.getGroup().toString(), project.getName(), info.getPreviousVersion());
}

代码示例来源:origin: org.shipkit/shipkit

public DefaultArtifactUrlResolver getDefaultResolver(Project project, String artifactBaseName, String previousVersion) {
  if (project.getPlugins().hasPlugin(ShipkitBintrayPlugin.class)) {
    return new BintrayDefaultArtifactUrlResolver(project, artifactBaseName, previousVersion);
  } else if (project.getPlugins().hasPlugin(GradlePortalPublishPlugin.class)) {
    return new GradlePluginArtifactUrlResolver(project.getGroup().toString(), artifactBaseName, previousVersion);
  }
  return null;
}

代码示例来源:origin: mockito/shipkit

public DefaultArtifactUrlResolver getDefaultResolver(Project project, String artifactBaseName, String previousVersion) {
  if (project.getPlugins().hasPlugin(ShipkitBintrayPlugin.class)) {
    return new BintrayDefaultArtifactUrlResolver(project, artifactBaseName, previousVersion);
  } else if (project.getPlugins().hasPlugin(GradlePortalPublishPlugin.class)) {
    return new GradlePluginArtifactUrlResolver(project.getGroup().toString(), artifactBaseName, previousVersion);
  }
  return null;
}

代码示例来源:origin: gradle.plugin.com.jonaslasauskas.capsule/gradle-capsule-plugin

private void defaultAttributesUsingDetailsFrom(Project project) {
 Object projectGroup = project.getGroup();
 String projectName = project.getName();
 if (projectGroup != null) {
  capsuleManifest.defaultApplicationIdTo(projectGroup + "." + projectName);
 }
 
 Jar jarTask = (Jar) project.getTasks().getAt("jar");
 capsuleManifest.defaultApplicationClassTo((String) jarTask.getManifest().getAttributes().get("Main-Class"));
}

代码示例来源:origin: gradle.plugin.com.github.gradle-guides/gradle-site-plugin

private ProjectDescriptor deriveProjectDescription(Project project) {
  ProjectDescriptor projectDescriptor = new ProjectDescriptor(project.getName(), project.getGroup().toString(), project.getDescription(), project.getVersion().toString(), new EnvironmentDescriptor(project.getGradle().getGradleVersion()));
  addPluginDescription(project, projectDescriptor);
  addTasksDescription(project, projectDescriptor);
  addJavaDescription(project, projectDescriptor);
  return projectDescriptor;
}

相关文章