|
21 | 21 | import java.util.concurrent.atomic.AtomicReference; |
22 | 22 |
|
23 | 23 | public class DevToolsService { |
24 | | - private static final @NotNull Logger LOG = Logger.getInstance(DevToolsService.class); |
25 | | - |
26 | | - protected static class DevToolsServiceListener implements DaemonEvent.Listener { |
27 | | - } |
28 | | - |
29 | 24 | @NotNull private final Project project; |
30 | 25 |
|
31 | 26 | @Nullable private DevToolsServerTask devToolsServerTask; |
@@ -123,43 +118,4 @@ private boolean devToolsInstanceExists() { |
123 | 118 | final CompletableFuture<DevToolsInstance> devToolsFuture = devToolsFutureRef.get(); |
124 | 119 | return devToolsFuture != null && devToolsFuture.isDone() && !devToolsFuture.isCompletedExceptionally(); |
125 | 120 | } |
126 | | - |
127 | | - private CompletableFuture<Boolean> pubActivateDevTools(FlutterSdk sdk) { |
128 | | - final FlutterCommand command = sdk.flutterPub(null, "global", "activate", "devtools"); |
129 | | - |
130 | | - final CompletableFuture<Boolean> result = new CompletableFuture<>(); |
131 | | - |
132 | | - final Process process = command.start((ProcessOutput output) -> { |
133 | | - if (output.getExitCode() != 0) { |
134 | | - final String message = (output.getStdout() + "\n" + output.getStderr()).trim(); |
135 | | - FlutterConsoles.displayMessage(project, null, message, true); |
136 | | - } |
137 | | - }, null); |
138 | | - |
139 | | - try { |
140 | | - final int resultCode = process.waitFor(); |
141 | | - result.complete(resultCode == 0); |
142 | | - } |
143 | | - catch (RuntimeException | InterruptedException re) { |
144 | | - if (!result.isDone()) { |
145 | | - result.complete(false); |
146 | | - } |
147 | | - } |
148 | | - |
149 | | - return result; |
150 | | - } |
151 | | - |
152 | | - private void logExceptionAndComplete(String message) { |
153 | | - logExceptionAndComplete(new Exception(message)); |
154 | | - } |
155 | | - |
156 | | - private void logExceptionAndComplete(Exception exception) { |
157 | | - LOG.info(exception); |
158 | | - final CompletableFuture<DevToolsInstance> future = devToolsFutureRef.get(); |
159 | | - if (future != null) { |
160 | | - future.completeExceptionally(exception); |
161 | | - } |
162 | | - } |
163 | 121 | } |
164 | | - |
165 | | - |
0 commit comments