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

devonfw / IDEasy / 20003978026

07 Dec 2025 12:09PM UTC coverage: 70.101% (+0.2%) from 69.903%
20003978026

push

github

web-flow
#39: refactoring to extract package-manager logic out of node/npm (#1638)

3892 of 6090 branches covered (63.91%)

Branch coverage included in aggregate %.

9955 of 13663 relevant lines covered (72.86%)

3.15 hits per line

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

78.26
cli/src/main/java/com/devonfw/tools/ide/tool/ide/IdeaBasedIdeToolCommandlet.java
1
package com.devonfw.tools.ide.tool.ide;
2

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

7
import com.devonfw.tools.ide.common.Tag;
8
import com.devonfw.tools.ide.context.IdeContext;
9
import com.devonfw.tools.ide.process.ProcessContext;
10
import com.devonfw.tools.ide.process.ProcessMode;
11
import com.devonfw.tools.ide.process.ProcessResult;
12
import com.devonfw.tools.ide.step.Step;
13
import com.devonfw.tools.ide.tool.plugin.ToolPluginDescriptor;
14

15
/**
16
 * {@link IdeToolCommandlet} for IDEA based commandlets like: {@link com.devonfw.tools.ide.tool.intellij.Intellij IntelliJ} and
17
 * {@link com.devonfw.tools.ide.tool.androidstudio.AndroidStudio Android Studio}.
18
 */
19
public class IdeaBasedIdeToolCommandlet extends IdeToolCommandlet {
20

21
  /**
22
   * The constructor.
23
   *
24
   * @param context the {@link IdeContext}.
25
   * @param tool the {@link #getName() tool name}.
26
   * @param tags the {@link #getTags() tags} classifying the tool. Should be created via {@link Set#of(Object) Set.of} method.
27
   */
28
  public IdeaBasedIdeToolCommandlet(IdeContext context, String tool, Set<Tag> tags) {
29
    super(context, tool, tags);
5✔
30
  }
1✔
31

32
  @Override
33
  public boolean installPlugin(ToolPluginDescriptor plugin, final Step step, ProcessContext pc) {
34

35
    // In case of plugins with a custom repo url
36
    boolean customRepo = plugin.url() != null;
6!
37
    List<String> args = new ArrayList<>();
4✔
38
    args.add("installPlugins");
4✔
39
    args.add(plugin.id().replace("+", " "));
8✔
40
    if (customRepo) {
2!
41
      args.add(plugin.url());
5✔
42
    }
43
    ProcessResult result = runTool(pc, ProcessMode.DEFAULT, args);
6✔
44
    if (result.isSuccessful()) {
3!
45
      this.context.success("Successfully installed plugin: {}", plugin.name());
11✔
46
      step.success();
2✔
47
      return true;
2✔
48
    } else {
49
      step.error("Failed to install plugin {} ({}): exit code was {}", plugin.name(), plugin.id(), result.getExitCode());
×
50
      return false;
×
51
    }
52
  }
53

54
  @Override
55
  public ProcessResult runTool(List<String> args) {
56
    args.add(this.context.getWorkspacePath().toString());
7✔
57
    return super.runTool(args);
4✔
58
  }
59
}
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