-
Notifications
You must be signed in to change notification settings - Fork 156
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #451 from gradle/asodja/android-studio-fix
Fix Android Studio syncs for Electric Eel Canary 10+
- Loading branch information
Showing
8 changed files
with
121 additions
and
133 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
75 changes: 0 additions & 75 deletions
75
.../main/java/org/gradle/profiler/studio/plugin/system/GradleProfilerGradleSyncListener.java
This file was deleted.
Oops, something went wrong.
22 changes: 22 additions & 0 deletions
22
...tudio-plugin/src/main/java/org/gradle/profiler/studio/plugin/system/GradleSyncResult.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package org.gradle.profiler.studio.plugin.system; | ||
|
||
import org.gradle.profiler.client.protocol.messages.StudioSyncRequestCompleted.StudioSyncRequestResult; | ||
|
||
public class GradleSyncResult { | ||
|
||
private final StudioSyncRequestResult status; | ||
private final String errorMessage; | ||
|
||
public GradleSyncResult(StudioSyncRequestResult status, String errorMessage) { | ||
this.status = status; | ||
this.errorMessage = errorMessage; | ||
} | ||
|
||
public StudioSyncRequestResult getResult() { | ||
return status; | ||
} | ||
|
||
public String getErrorMessage() { | ||
return errorMessage; | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
...o-plugin/src/main/java/org/gradle/profiler/studio/plugin/system/GradleSystemListener.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package org.gradle.profiler.studio.plugin.system; | ||
|
||
import com.intellij.openapi.externalSystem.model.task.ExternalSystemTaskId; | ||
import com.intellij.openapi.externalSystem.model.task.ExternalSystemTaskNotificationListenerAdapter; | ||
import org.jetbrains.annotations.NotNull; | ||
import org.jetbrains.plugins.gradle.util.GradleConstants; | ||
|
||
import javax.annotation.Nullable; | ||
import java.util.concurrent.atomic.AtomicReference; | ||
|
||
public class GradleSystemListener extends ExternalSystemTaskNotificationListenerAdapter { | ||
private final AtomicReference<Exception> exception = new AtomicReference<>(); | ||
|
||
@Override | ||
public void onStart(@NotNull ExternalSystemTaskId id, String workingDir) { | ||
if (GradleConstants.SYSTEM_ID.equals(id.getProjectSystemId())) { | ||
exception.set(null); | ||
} | ||
} | ||
|
||
@Override | ||
public void onFailure(@NotNull ExternalSystemTaskId id, @NotNull Exception e) { | ||
if (GradleConstants.SYSTEM_ID.equals(id.getProjectSystemId())) { | ||
exception.set(e); | ||
} | ||
} | ||
|
||
@Nullable | ||
public Exception getLastException() { | ||
return exception.get(); | ||
} | ||
} |