Search in sources :

Example 1 with PsPath

use of com.android.tools.idea.gradle.structure.model.PsPath in project android by JetBrains.

the class PsAndroidModuleAnalyzerTest method createIssueFrom.

@Test
public void createIssueFrom() {
    SyncIssue syncIssue = mock(SyncIssue.class);
    when(syncIssue.getMessage()).thenReturn("Conflict with dependency 'com.google.guava:guava'. Resolved versions for app (16.0) " + "and test app (16.0.1) differ. See http://g.co/androidstudio/app-test-app-conflict for " + "details.");
    when(syncIssue.getSeverity()).thenReturn(SEVERITY_ERROR);
    PsPath path = mock(PsPath.class);
    PsIssue issue = PsAndroidModuleAnalyzer.createIssueFrom(syncIssue, path, null);
    assertThat(issue.getText()).isEqualTo("Conflict with dependency 'com.google.guava:guava'. Resolved versions for app (16.0) " + "and test app (16.0.1) differ. See " + "<a href='http://g.co/androidstudio/app-test-app-conflict'>http://g.co/androidstudio/app-test-app-conflict</a> " + "for details.");
    assertThat(issue.getSeverity()).isEqualTo(ERROR);
}
Also used : PsPath(com.android.tools.idea.gradle.structure.model.PsPath) SyncIssue(com.android.builder.model.SyncIssue) PsIssue(com.android.tools.idea.gradle.structure.model.PsIssue) Test(org.junit.Test)

Example 2 with PsPath

use of com.android.tools.idea.gradle.structure.model.PsPath in project android by JetBrains.

the class IssuesRenderer method render.

@NotNull
public String render(@NotNull Collection<PsIssue> issues) {
    StringBuilder buffer = new StringBuilder();
    buffer.append("<html><body><ol>");
    for (PsIssue issue : issues) {
        buffer.append("<li>").append(issue.getPath().toText(HTML)).append(": ").append(issue.getText());
        PsPath quickFixPath = issue.getQuickFixPath();
        if (quickFixPath != null) {
            buffer.append(" ").append(quickFixPath.toText(HTML));
        }
        buffer.append("</li>");
    }
    buffer.append("</ul></body></html>");
    return buffer.toString();
}
Also used : PsPath(com.android.tools.idea.gradle.structure.model.PsPath) PsIssue(com.android.tools.idea.gradle.structure.model.PsIssue) NotNull(org.jetbrains.annotations.NotNull)

Example 3 with PsPath

use of com.android.tools.idea.gradle.structure.model.PsPath in project android by JetBrains.

the class SingleModuleIssuesRenderer method render.

@Override
@NotNull
public String render(@NotNull Collection<PsIssue> issues) {
    StringBuilder buffer = new StringBuilder();
    buffer.append("<html><body><ol>");
    for (PsIssue issue : issues) {
        buffer.append("<li>").append(issue.getText());
        PsPath quickFixPath = issue.getQuickFixPath();
        if (quickFixPath != null) {
            buffer.append(" ").append(quickFixPath.toText(HTML));
        }
        String description = issue.getDescription();
        if (isNotEmpty(description)) {
            buffer.append("<br/><br/>").append(description);
        }
        buffer.append("</li>");
    }
    buffer.append("</ol></body></html>");
    return buffer.toString();
}
Also used : PsPath(com.android.tools.idea.gradle.structure.model.PsPath) PsIssue(com.android.tools.idea.gradle.structure.model.PsIssue) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

PsIssue (com.android.tools.idea.gradle.structure.model.PsIssue)3 PsPath (com.android.tools.idea.gradle.structure.model.PsPath)3 NotNull (org.jetbrains.annotations.NotNull)2 SyncIssue (com.android.builder.model.SyncIssue)1 Test (org.junit.Test)1