コード例 #1
0
  private static void rebuildGoogleProjectIfPluginVersionChanged(IProject project) {
    try {
      // We're only worried about Google projects
      if (NatureUtils.hasNature(project, GWTNature.NATURE_ID)
          || NatureUtils.hasNature(project, GaeNature.NATURE_ID)) {
        // Find the last plugin version that know the project was built with
        Version lastForcedRebuildAt = GdtPreferences.getVersionForLastForcedRebuild(project);
        Version currentPluginVersion = GdtPlugin.getVersion();

        if (!lastForcedRebuildAt.equals(currentPluginVersion)) {
          GdtPreferences.setVersionForLastForcedRebuild(project, currentPluginVersion);

          BuilderUtilities.scheduleRebuild(project);
          CorePluginLog.logInfo(
              "Scheduled rebuild of project "
                  + project.getName()
                  + " because of plugin update (current version: "
                  + currentPluginVersion.toString()
                  + ")");
        }
      }
    } catch (CoreException e) {
      CorePluginLog.logError(e);
    }
  }
コード例 #2
0
  public static String getInstallationId() {
    String id = GdtPreferences.getInstallationId();
    if (id == null) {
      // Use the current time in millis as the installation id and store it
      // back to the prefs.
      id = Long.toString(System.currentTimeMillis());
      GdtPreferences.setInstallationId(id);
    }

    return id;
  }
コード例 #3
0
  @Override
  public void start(BundleContext context) throws Exception {
    super.start(context);
    plugin = this;
    logger = new Logger(this);

    // Force the installation id initialization before SDK registration.
    getInstallationId();

    GdtPreferences.registerSdks();
    ProjectUtilities.setWebAppProjectCreatorFactory(WebAppProjectCreator.FACTORY);

    /*
     * Execute this on the UI thread. This has the effect of delaying the
     * execution until the Workbench is running and the UI is available. This is
     * necessary because the code in this method manipulates the Workbench UI.
     */
    Display.getDefault()
        .asyncExec(
            new Runnable() {
              public void run() {
                maybeAddNewWizardActionsToWorkbench();
              }
            });

    LaunchConfigAffectingChangesListener.INSTANCE.start();

    // Load problem severities
    GdtProblemSeverities.initializeInstance(
        new Class<?>[] {
          AppEngineProblemType.class, GWTProblemType.class,
          RemoteServiceProblemType.class, UiBinderJavaProblemType.class,
          ClientBundleProblemType.class, ProjectStructureOrSdkProblemType.class,
          UiBinderTemplateProblemType.class
        },
        GdtPreferences.getEncodedProblemSeverities());

    rebuildGoogleProjectsIfPluginVersionChanged();

    new ProjectMigrator().migrate();
  }