BWU Dart Archive Downloader

BWU Dart Archive Downloader makes it easy to download files like API docs, Dartium, Dartium for Android APK, Dart Eclipse plugin, or the Dart SDK from http://gsdview.appspot.com/dart-archive/channels/ Its main purpose is to make maintenance tasks and automatic setup for continuous integration (CI) as easy as possible.

Example

library maintenance.bin.dartupdate;

import 'dart:io' as io;
import 'package:maintenance/maintenance.dart';
import 'package:bwu_utils_dev/grinder.dart';

main() async {
  io.Directory tempDir;
  try {
    tempDir = io.Directory.systemTemp.createTempSync('sdk_download_test-');
    final updater = new DartUpdate(new SdkDownloadOptions()
      ..downloadDirectory = tempDir
      ..channel = DownloadChannel.beRaw
      ..installDirectory = new io.Directory('/usr/local/apps/dart/')
      ..backupDirectory = new io.Directory('/usr/local/apps/dart_backup'));

    await updater.update();
    io.Process.start('setfacl', [
      '-Rm',
      'g:users:rwX,d:g:users:rwX',
      '/usr/local/apps/dart',
    ]);
  } catch (e, s) {
    print('Dart update failed: ${e.message}.');
    print(s);
  } finally {
    if (tempDir != null) {
      return tempDir.delete(recursive: true);
    }
  }
}

Libraries

bwu_dart_archive_downloader
bwu_dart_archive_downloader.dart_update