use of com.android.tools.idea.gradle.project.importing.OpenMigrationToGradleUrlHyperlink in project android by JetBrains.
the class GradleSyncInvoker method prepareProject.
private boolean prepareProject(@NotNull Project project, @NotNull Request request, @Nullable GradleSyncListener listener) throws ConfigurationException {
if (AndroidProjectInfo.getInstance(project).requiresAndroidModel() || hasTopLevelGradleBuildFile(project)) {
if (!request.isNewProject()) {
myFileDocumentManager.saveAllDocuments();
}
// continue with sync.
return true;
}
invokeLaterIfProjectAlive(project, () -> {
String msg = String.format("The project '%s' is not a Gradle-based project", project.getName());
AndroidGradleNotification.getInstance(project).showBalloon("Project Sync", msg, ERROR, new OpenMigrationToGradleUrlHyperlink());
if (listener != null) {
listener.syncFailed(project, msg);
}
});
// stop sync.
return false;
}
use of com.android.tools.idea.gradle.project.importing.OpenMigrationToGradleUrlHyperlink in project android by JetBrains.
the class AndroidGradleProjectComponent method showMigrateToGradleWarning.
private void showMigrateToGradleWarning() {
String errMsg = "This project does not use the Gradle build system. We recommend that you migrate to using the Gradle build system.";
NotificationHyperlink moreInfoHyperlink = new OpenMigrationToGradleUrlHyperlink().setCloseOnClick(true);
NotificationHyperlink doNotShowAgainHyperlink = new NotificationHyperlink("do.not.show", "Don't show this message again.") {
@Override
protected void execute(@NotNull Project project) {
PropertiesComponent.getInstance(myProject).setValue(SHOW_MIGRATE_TO_GRADLE_POPUP, Boolean.FALSE.toString());
}
};
AndroidGradleNotification notification = AndroidGradleNotification.getInstance(myProject);
notification.showBalloon("Migrate Project to Gradle?", errMsg, NotificationType.WARNING, moreInfoHyperlink, doNotShowAgainHyperlink);
}
Aggregations