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

devonfw / IDEasy / 23003890195

12 Mar 2026 01:17PM UTC coverage: 70.474% (+0.1%) from 70.347%
23003890195

Pull #1739

github

web-flow
Merge a4cf3627a into a965db6c8
Pull Request #1739: #1735: implement repo link feature, #1736: fix link creation

4138 of 6464 branches covered (64.02%)

Branch coverage included in aggregate %.

10730 of 14633 relevant lines covered (73.33%)

3.09 hits per line

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

74.07
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;
2✔
77
    }
78
    return config;
2✔
79
  }
80

81
}
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