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

devonfw / IDEasy / 14726569126

29 Apr 2025 08:16AM UTC coverage: 67.534% (+0.09%) from 67.448%
14726569126

push

github

web-flow
#1190: Added pycharm support (#1219)

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

3087 of 4976 branches covered (62.04%)

Branch coverage included in aggregate %.

7942 of 11355 relevant lines covered (69.94%)

3.06 hits per line

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

80.0
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.Arrays;
5
import java.util.List;
6
import java.util.Set;
7

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

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

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

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

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

56
  @Override
57
  public void runTool(String... args) {
58
    List<String> extendedArgs = new ArrayList<>(Arrays.asList(args));
6✔
59
    extendedArgs.add(this.context.getWorkspacePath().toString());
7✔
60
    super.runTool(extendedArgs.toArray(new String[0]));
7✔
61
  }
1✔
62
}
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