Пример #1
0
static void
settled_cb (IdeDeviceManager *device_manager,
            GParamSpec       *pspec,
            gpointer          user_data)
{
  GPtrArray *devices;
  guint i;

  if (!ide_device_manager_get_settled (device_manager))
    return;

  devices = ide_device_manager_get_devices (device_manager);
  for (i = 0; i < devices->len; i++)
    {
      IdeDevice *device = g_ptr_array_index (devices, i);
      const gchar *device_id = ide_device_get_id (device);
      const gchar *display_name = ide_device_get_display_name (device);
      const gchar *system_type = ide_device_get_system_type (device);

      g_print ("  %s \"%s\" (%s)\n", device_id, display_name, system_type);
    }
  g_ptr_array_unref (devices);

  quit (EXIT_SUCCESS);
}
Пример #2
0
static void
print_build_info (IdeContext *context,
                  IdeDevice  *device)
{
  IdeProject *project;
  IdeBuildSystem *build_system;
  IdeVcs *vcs;
  const gchar *project_name;
  const gchar *vcs_name;
  const gchar *build_system_name;
  const gchar *device_id;
  const gchar *system_type;
  g_autofree gchar *build_date = NULL;
  GTimeVal tv;

  project = ide_context_get_project (context);
  project_name = ide_project_get_name (project);

  vcs = ide_context_get_vcs (context);
  vcs_name = g_type_name (G_TYPE_FROM_INSTANCE (vcs));

  build_system = ide_context_get_build_system (context);
  build_system_name = g_type_name (G_TYPE_FROM_INSTANCE (build_system));

  device_id = ide_device_get_id (device);
  system_type = ide_device_get_system_type (device);

  g_get_current_time (&tv);
  build_date = g_time_val_to_iso8601 (&tv);

  g_printerr (_("========================\n"));
  g_printerr (_("           Project Name: %s\n"), project_name);
  g_printerr (_(" Version Control System: %s\n"), vcs_name);
  g_printerr (_("           Build System: %s\n"), build_system_name);
  g_printerr (_("    Build Date and Time: %s\n"), build_date);
  g_printerr (_("    Building for Device: %s (%s)\n"), device_id, system_type);
  g_printerr (_("========================\n"));
}