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

devonfw / IDEasy / 26815574784

02 Jun 2026 11:03AM UTC coverage: 71.095% (+0.001%) from 71.094%
26815574784

Pull #1983

github

web-flow
Merge 491ef775d into 6080ee79b
Pull Request #1983: #1937 link content from settings into workspace(s)

4534 of 7064 branches covered (64.18%)

Branch coverage included in aggregate %.

11734 of 15818 relevant lines covered (74.18%)

3.14 hits per line

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

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

3
import java.nio.file.Path;
4
import java.util.List;
5
import java.util.Properties;
6
import java.util.Set;
7

8
import com.devonfw.tools.ide.context.IdeContext;
9
import com.devonfw.tools.ide.git.GitUrl;
10

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

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

41
  public RepositoryConfig {
35✔
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 filePath the {@link Path} to the {@link Properties} to load.
60
   * @param context the {@link IdeContext}.
61
   * @return the parsed {@link RepositoryConfig}.
62
   */
63
  public static RepositoryConfig loadProperties(Path filePath, IdeContext context) {
64

65
    RepositoryProperties properties = new RepositoryProperties(filePath, context);
6✔
66
    String filename = filePath.getFileName().toString();
4✔
67
    final String id;
68
    if (filename.endsWith(IdeContext.EXT_PROPERTIES)) {
4!
69
      id = filename.substring(0, filename.length() - IdeContext.EXT_PROPERTIES.length());
10✔
70
    } else {
71
      id = filename;
×
72
    }
73
    RepositoryConfig config = new RepositoryConfig(id, properties.getPath(), properties.getWorkingSets(), properties.getWorkspaces(), properties.getGitUrl(),
12✔
74
        properties.getGitBranch(), properties.getBuildPath(), properties.getBuildCmd(), properties.getImports(), properties.getLinks(), properties.isActive());
13✔
75
    if (properties.isInvalid()) {
3!
76
      return null;
×
77
    }
78
    return config;
2✔
79
  }
80

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

© 2026 Coveralls, Inc