• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

devonfw / IDEasy / 34961711466

15 Sep 2026 11:08AM UTC coverage: 74.158% (+0.03%) from 74.124%
34961711466

push

github

web-flow
#2366: support variables and expressions in repository properties (#2398)

Co-authored-by: Jörg Hohwiller <hohwille@users.noreply.github.com>

5681 of 8516 branches covered (66.71%)

Branch coverage included in aggregate %.

14725 of 19001 relevant lines covered (77.5%)

3.31 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

73.33
cli/src/main/java/com/devonfw/tools/ide/git/repository/RepositoryConfig.java
1
package com.devonfw.tools.ide.git.repository;
2

3
import java.util.List;
4
import java.util.Set;
5

6
import com.devonfw.tools.ide.context.IdeContext;
7
import com.devonfw.tools.ide.git.GitUrl;
8

9
/**
10
 * Represents the configuration of a repository to be used by the {@link RepositoryCommandlet}.
11
 *
12
 * @param id Identifier derived from the filename without extension.
13
 * @param path Path into which the project is cloned. This path is relative to the workspace.
14
 * @param workingSets The working sets associated with the repository (for Eclipse import).
15
 * @param workspaces Workspaces to use for checkout and import. Supports comma-separated values. Default is main.
16
 * @param gitUrl Git URL to use for cloning the project.
17
 * @param gitBranch Git branch to checkout. Git default branch is default.
18
 * @param buildPath The build path for the repository.
19
 * @param buildCmd The command to invoke to build the repository after clone or pull. If omitted no build is triggered.
20
 * @param imports list of IDEs where the repository will be imported to.
21
 * @param remotes list of additional git remotes to add to the repository after cloning.
22
 * @param active {@code true} to setup the repository during setup, {@code false} to skip.
23
 */
24
public record RepositoryConfig(
25
    String id,
26
    String path,
27
    String workingSets,
28
    List<String> workspaces,
29
    String gitUrl,
30
    String gitBranch,
31
    String buildPath,
32
    String buildCmd,
33
    Set<String> imports,
34
    List<RepositoryLink> links,
35
    List<RepositoryRemote> remotes,
36
    boolean active) {
37

38
  /** Wildcard to match all workspaces. */
39
  public static final String WORKSPACE_NAME_ALL = "*";
40

41
  public RepositoryConfig {
38 ✔
42
    if (workspaces == null || workspaces.isEmpty()) {
5 !
43
      throw new IllegalArgumentException("workspaces cannot be empty");
×
44
    }
45
  }
1 ✔
46

47
  /**
48
   * @return the {@link GitUrl} from {@link #gitUrl()} and {@link #gitBranch()}.
49
   */
50
  public GitUrl asGitUrl() {
51

52
    if (this.gitUrl == null) {
3 !
53
      return null;
×
54
    }
55
    return new GitUrl(this.gitUrl, this.gitBranch);
8 ✔
56
  }
57

58
  /**
59
   * @param properties the {@link RepositoryProperties} to parse. The caller loads them so it can inspect e.g. the
60
   *     {@link RepositoryProperties#isActive() active flag} before the remaining properties are read and thereby resolved.
61
   * @return the parsed {@link RepositoryConfig} or {@code null} if the properties are {@link RepositoryProperties#isInvalid() invalid}.
62
   */
63
  static RepositoryConfig loadProperties(RepositoryProperties properties) {
64

65
    String id = properties.getId();
3 ✔
66
    RepositoryConfig config = new RepositoryConfig(id, properties.getPath(), properties.getWorkingSets(), properties.getWorkspaces(), properties.getGitUrl(),
12 ✔
67
        properties.getGitBranch(), properties.getBuildPath(), properties.getBuildCmd(), properties.getImports(), properties.getLinks(), properties.getRemotes(),
12 ✔
68
        properties.isActive());
3 ✔
69
    if (properties.isInvalid()) {
3 ✔
70
      return null;
2 ✔
71
    }
72
    return config;
2 ✔
73
  }
74

75
  public boolean isVirtualSettingsRepository() {
76
    return IdeContext.SETTINGS_REPOSITORY_KEYWORD.equals(this.id)
9 !
77
        && (this.gitUrl == null || this.gitUrl.isBlank());
3 !
78
  }
79
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc