use of com.android.tools.idea.gradle.project.sync.hyperlink.OpenUrlHyperlink in project android by JetBrains.
the class EncodingValidationStrategy method fixAndReportFoundIssues.
@Override
void fixAndReportFoundIssues() {
if (myMismatchingEncoding != null) {
Project project = getProject();
// Fix encoding mismatch.
myEncodings.setDefaultCharsetName(myMismatchingEncoding);
// Report encoding mismatch.
String line = String.format("The project encoding (%1$s) has been reset to the encoding specified in the Gradle build files (%2$s).", myEncodings.getDefaultCharset().displayName(), myMismatchingEncoding);
String[] text = { line, "Mismatching encodings can lead to serious bugs." };
SyncMessage message = new SyncMessage(SyncMessage.DEFAULT_GROUP, INFO, text);
message.add(new OpenUrlHyperlink("http://tools.android.com/knownissues/encoding", "More Info..."));
SyncMessages.getInstance(project).report(message);
}
}
use of com.android.tools.idea.gradle.project.sync.hyperlink.OpenUrlHyperlink in project android by JetBrains.
the class AndroidGradlePluginVersionReader method getQuickFixes.
@Override
@NotNull
public List<NotificationHyperlink> getQuickFixes(@NotNull Module module, @Nullable VersionRange expectedVersion, @Nullable PositionInFile location) {
AndroidPluginInfo pluginInfo = AndroidPluginInfo.find(module.getProject());
if (isSupportedGeneration(pluginInfo)) {
String version = pluginInfo.getPluginGeneration().getLatestKnownVersion();
List<NotificationHyperlink> quickFixes = new ArrayList<>();
quickFixes.add(new FixAndroidGradlePluginVersionHyperlink(GradleVersion.parse(version), GradleVersion.parse(GRADLE_LATEST_VERSION)));
quickFixes.add(new OpenUrlHyperlink("https://developer.android.com/studio/releases/gradle-plugin.html#updating-gradle", "Open Documentation"));
return quickFixes;
}
return emptyList();
}
use of com.android.tools.idea.gradle.project.sync.hyperlink.OpenUrlHyperlink in project android by JetBrains.
the class JavaHeapSpaceErrorHandler method getQuickFixHyperlinks.
@Override
@NotNull
protected List<NotificationHyperlink> getQuickFixHyperlinks(@NotNull NotificationData notification, @NotNull Project project, @NotNull String text) {
List<NotificationHyperlink> hyperlinks = new ArrayList<>();
hyperlinks.add(new OpenUrlHyperlink("http://www.gradle.org/docs/current/userguide/build_environment.html", "Read Gradle's configuration guide"));
hyperlinks.add(new OpenUrlHyperlink("http://docs.oracle.com/javase/7/docs/technotes/guides/vm/gc-ergonomics.html", "Read about Java's heap size"));
return hyperlinks;
}
use of com.android.tools.idea.gradle.project.sync.hyperlink.OpenUrlHyperlink in project android by JetBrains.
the class GradleVersionReaderTest method testGetQuickFixes.
public void testGetQuickFixes() throws Exception {
loadSimpleApplication();
Module appModule = myModules.getAppModule();
List<NotificationHyperlink> quickFixes = myVersionReader.getQuickFixes(appModule, null, null);
assertThat(quickFixes).hasSize(2);
NotificationHyperlink quickFix = quickFixes.get(0);
assertThat(quickFix).isInstanceOf(FixAndroidGradlePluginVersionHyperlink.class);
FixAndroidGradlePluginVersionHyperlink fixAndroidGradlePluginQuickFix = (FixAndroidGradlePluginVersionHyperlink) quickFix;
assertEquals(BuildEnvironment.getInstance().getGradlePluginVersion(), fixAndroidGradlePluginQuickFix.getPluginVersion().toString());
GradleVersion gradleVersion = fixAndroidGradlePluginQuickFix.getGradleVersion();
assertNotNull(gradleVersion);
assertEquals(GRADLE_LATEST_VERSION, gradleVersion.toString());
quickFix = quickFixes.get(1);
assertThat(quickFix).isInstanceOf(OpenUrlHyperlink.class);
OpenUrlHyperlink openUrlQuickFix = (OpenUrlHyperlink) quickFix;
assertEquals("https://developer.android.com/studio/releases/index.html#Revisions", openUrlQuickFix.getUrl());
}
use of com.android.tools.idea.gradle.project.sync.hyperlink.OpenUrlHyperlink in project android by JetBrains.
the class AndroidGradleExperimentalPluginVersionReaderTest method testGetQuickFixesWithExperimentalPlugin.
public void testGetQuickFixesWithExperimentalPlugin() throws Exception {
loadProject(EXPERIMENTAL_PLUGIN);
Module appModule = myModules.getAppModule();
List<NotificationHyperlink> quickFixes = myVersionReader.getQuickFixes(appModule, VersionRange.parse("[0.7.0, +)"), null);
assertThat(quickFixes).hasSize(2);
NotificationHyperlink quickFix = quickFixes.get(0);
assertThat(quickFix).isInstanceOf(FixAndroidGradlePluginVersionHyperlink.class);
FixAndroidGradlePluginVersionHyperlink fixAndroidGradlePluginQuickFix = (FixAndroidGradlePluginVersionHyperlink) quickFix;
assertEquals(BuildEnvironment.getInstance().getExperimentalPluginVersion(), fixAndroidGradlePluginQuickFix.getPluginVersion().toString());
quickFix = quickFixes.get(1);
assertThat(quickFix).isInstanceOf(OpenUrlHyperlink.class);
OpenUrlHyperlink openUrlQuickFix = (OpenUrlHyperlink) quickFix;
assertEquals("https://developer.android.com/studio/releases/gradle-plugin.html#updating-gradle", openUrlQuickFix.getUrl());
}
Aggregations