This commit is contained in:
Michael Xia
2015-10-29 15:48:45 -07:00
16 changed files with 175 additions and 42 deletions

3
DEPS
View File

@@ -255,8 +255,7 @@ hooks = [
'src/sky/tools/dart_pub_get.py',
'--repository-root', '../..',
'--dart-sdk-directory',
'../../third_party/dart-sdk/dart-sdk',
'--dirs-to-ignore', 'sky/packages/sky',
'../../third_party/dart-sdk/dart-sdk'
],
},
{

View File

@@ -68,3 +68,5 @@ Thumbs.db
/mojo/common/dart/packages
/sky/packages/**/packages
/sky/packages/sky_services/lib/
/sky/tools/pubspec_maintenance/packages/
/sky/tools/pubspec_maintenance/pubspec.lock

View File

@@ -1,6 +1,7 @@
name: address_book
dependencies:
flutter: ">=0.0.3 <0.1.0"
flutter:
'0.0.15'
sky_tools: any
dependency_overrides:
material_design_icons:

View File

@@ -1,6 +1,7 @@
name: hello_world
dependencies:
flutter: ">=0.0.3 <0.1.0"
flutter:
'0.0.15'
sky_tools: any
dependency_overrides:
material_design_icons:

View File

@@ -1,6 +1,7 @@
name: mine_digger
dependencies:
flutter: ">=0.0.3 <0.1.0"
flutter:
'0.0.15'
sky_tools: any
dependency_overrides:
material_design_icons:

View File

@@ -4,7 +4,6 @@
import 'dart:async';
import 'dart:convert';
import 'dart:math';
import 'dart:io';
import 'dart:typed_data';
@@ -44,7 +43,7 @@ final CipherParameters _params = _initParams();
Uint8List serializeManifest(Map manifestDescriptor, ECPublicKey publicKey, Uint8List zipBytes) {
if (manifestDescriptor == null)
return null;
final List<String> kSavedKeys = [
final List<String> kSavedKeys = <String>[
'name',
'version',
'update-url'
@@ -66,9 +65,9 @@ Uint8List serializeManifest(Map manifestDescriptor, ECPublicKey publicKey, Uint8
}
// Returns the ASN.1 encoded signature of the input manifestBytes.
List<int> signManifest(Uint8List manifestBytes, ECPrivateKey privateKey) {
Uint8List signManifest(Uint8List manifestBytes, ECPrivateKey privateKey) {
if (manifestBytes == null || privateKey == null)
return [];
return new Uint8List(0);
Signer signer = new Signer(_params.signerAlgorithm);
PrivateKeyParameter params = new PrivateKeyParameter(privateKey);
signer.init(true, new ParametersWithRandom(params, _params.random));
@@ -121,26 +120,22 @@ ECPrivateKey _asn1ParsePrivateKey(ECDomainParameters ecDomain, Uint8List private
// Parses a DER-encoded ASN.1 ECDSA signature block.
ECSignature _asn1ParseSignature(Uint8List signature) {
ASN1Parser parser = new ASN1Parser(signature);
ASN1Object object = parser.nextObject();
if (object is! ASN1Sequence)
try {
ASN1Parser parser = new ASN1Parser(signature);
ASN1Object object = parser.nextObject();
if (object is! ASN1Sequence)
return null;
ASN1Sequence sequence = object;
if (!(sequence.elements.length == 2 &&
sequence.elements[0] is ASN1Integer &&
sequence.elements[1] is ASN1Integer))
return null;
ASN1Integer r = sequence.elements[0];
ASN1Integer s = sequence.elements[1];
return new ECSignature(r.valueAsPositiveBigInteger, s.valueAsPositiveBigInteger);
} on ASN1Exception {
return null;
ASN1Sequence sequence = object;
if (!(sequence.elements.length == 2 &&
sequence.elements[0] is ASN1Integer &&
sequence.elements[1] is ASN1Integer))
return null;
ASN1Integer r = sequence.elements[0];
ASN1Integer s = sequence.elements[1];
return new ECSignature(r.valueAsPositiveBigInteger, s.valueAsPositiveBigInteger);
}
ECPrivateKey _readPrivateKeySync(String privateKeyPath) {
File file = new File(privateKeyPath);
if (!file.existsSync())
return null;
List<int> bytes = file.readAsBytesSync();
return _asn1ParsePrivateKey(_params.domain, new Uint8List.fromList(bytes));
}
}
ECPublicKey _publicKeyFromPrivateKey(ECPrivateKey privateKey) {
@@ -154,8 +149,16 @@ class KeyPair {
ECPublicKey publicKey;
ECPrivateKey privateKey;
static KeyPair readFromPrivateKeySync(String path) {
ECPrivateKey privateKey = _readPrivateKeySync(path);
static KeyPair readFromPrivateKeySync(String privateKeyPath) {
File file = new File(privateKeyPath);
if (!file.existsSync())
return null;
return fromPrivateKeyBytes(file.readAsBytesSync());
}
static KeyPair fromPrivateKeyBytes(List<int> privateKeyBytes) {
ECPrivateKey privateKey = _asn1ParsePrivateKey(
_params.domain, new Uint8List.fromList(privateKeyBytes));
if (privateKey == null)
return null;

View File

@@ -1,10 +1,11 @@
name: flx
version: 0.0.1
version: 0.0.4
author: Flutter Authors <flutter-dev@googlegroups.com>
description: Library for dealing with Flutter bundle (.flx) files
homepage: http://flutter.io
dependencies:
sky_services: ^0.0.40
sky_services:
'0.0.45'
yaml: ^2.1.3
asn1lib: ^0.4.1
cipher: ^0.7.1

View File

@@ -1,5 +1,5 @@
name: sky_engine
version: 0.0.43
version: 0.0.45
author: Flutter Authors <flutter-dev@googlegroups.com>
description: Dart SDK extensions for dart:ui
homepage: http://flutter.io

View File

@@ -1,5 +1,5 @@
name: sky_services
version: 0.0.43
version: 0.0.45
author: Flutter Authors <flutter-dev@googlegroups.com>
description: Mojom interfaces associated with Flutter
homepage: http://flutter.io

View File

@@ -23,7 +23,7 @@ const String kBundleFile = 'app.flx';
UpdateServiceProxy _initUpdateService() {
UpdateServiceProxy updateService = new UpdateServiceProxy.unbound();
shell.requestService(null, updateService);
shell.connectToService(null, updateService);
return updateService;
}

View File

@@ -1,15 +1,17 @@
name: updater
version: 0.0.1
author: Flutter Authors <flutter-dev@googlegroups.com>
description: The autoupdater for flutter
homepage: http://flutter.io
dependencies:
mojo: 0.3.0
flutter: ">=0.0.3 <0.1.0"
flutter:
'0.0.15'
sky_services: ^0.0.40
yaml: ^2.1.3
path: ^1.3.0
flx: 0.0.1
flutter_sprites:
'0.0.12'
dependency_overrides:
flutter:
path: ../sky

View File

@@ -4,13 +4,19 @@ author: Flutter Authors <flutter-dev@googlegroups.com>
description: A workspace to host pub packages
homepage: https://github.com/flutter/engine/tree/master/sky/packages/workbench
dependencies:
flutter: ">=0.0.3 <0.1.0"
sky_tools: ">=0.0.26"
flutter:
'0.0.15'
sky_tools: any
cipher: any
asn1lib: any
flutter_rendering_examples: any
flutter_sprites: any
flutter_sprites:
'0.0.12'
playfair: any
flx:
'0.0.4'
sky_services:
'0.0.45'
dependency_overrides:
material_design_icons:
path: ../material_design_icons
@@ -20,5 +26,7 @@ dependency_overrides:
path: ../../../examples/rendering
flutter_sprites:
path: ../../../skysprites
flx:
path: ../flx
environment:
sdk: '>=1.8.0 <2.0.0'

View File

@@ -0,0 +1,5 @@
name: flutter-pubspec-maintenance
dependencies:
den_api: ^0.1.0
path: ^1.3.6
pub_semver: ^1.2.2

View File

@@ -0,0 +1,110 @@
import 'dart:async';
import 'dart:io';
import 'package:den_api/den_api.dart';
import 'package:path/path.dart' as path;
import 'package:pub_semver/pub_semver.dart';
// set this to true when we decide to ship 0.1.0
const bool haveWeEverReleasedAPointRelease = false;
class FlutterPubspec {
static Future<FlutterPubspec> load(String path) async {
return new FlutterPubspec.fromPubspec(await Pubspec.load(path));
}
FlutterPubspec.fromPubspec(this._data) {
_openPubspecs.add(this);
}
final Pubspec _data;
String get name => _data.name;
Version get version => _data.version;
PackageDep get asDependency {
return new PackageDep(name, 'hosted', version, '');
}
void bumpVersion({ bool breakingChange }) {
_data.bump(haveWeEverReleasedAPointRelease && breakingChange ? ReleaseType.minor : ReleaseType.patch);
print('$name is now at $version');
}
void setDependency(FlutterPubspec dependency) {
_data.addDependency(dependency.asDependency);
}
void setDependencyIfNecessary(FlutterPubspec dependency) {
if (_data.dependencies.containsKey(dependency.name))
_data.addDependency(dependency.asDependency);
}
void _save() {
_data.save();
}
static List<FlutterPubspec> _openPubspecs = <FlutterPubspec>[];
static void saveAll() {
for (FlutterPubspec file in _openPubspecs)
file._save();
}
}
main() async {
bool breakingChange = true;
// The published packages
FlutterPubspec flutterEngine = await FlutterPubspec.load('sky/packages/sky_engine')
..bumpVersion(breakingChange: breakingChange);
FlutterPubspec flutterServices = await FlutterPubspec.load('sky/packages/sky_services')
..bumpVersion(breakingChange: breakingChange);
FlutterPubspec flutterFlx = await FlutterPubspec.load('sky/packages/flx')
..bumpVersion(breakingChange: breakingChange)
..setDependency(flutterServices);
FlutterPubspec flutter = await FlutterPubspec.load('sky/packages/sky')
..bumpVersion(breakingChange: breakingChange)
..setDependency(flutterEngine)
..setDependency(flutterServices);
FlutterPubspec flutterSprites = await FlutterPubspec.load('skysprites')
..bumpVersion(breakingChange: breakingChange)
..setDependency(flutter);
// The internal packages
await FlutterPubspec.load('sky/packages/updater')
..setDependency(flutter)
..setDependency(flutterSprites);
await FlutterPubspec.load('sky/unit')
..setDependency(flutter);
await FlutterPubspec.load('sky/packages/workbench')
..setDependency(flutterServices)
..setDependency(flutterFlx)
..setDependency(flutter)
..setDependency(flutterSprites);
Directory examples = new Directory('examples');
await for (FileSystemEntity entity in examples.list(recursive: true, followLinks: false)) {
if (entity is File && path.basename(entity.path) == Pubspec.basename) {
await FlutterPubspec.load(entity.path)
..setDependency(flutter)
..setDependencyIfNecessary(flutterSprites);
}
}
// we don't update these, since they're their own things and don't depend on
// the above packages:
// sky/tools/pubspec_maintenance/pubspec.yaml
// sky/packages/material_design_icons/pubspec.yaml
FlutterPubspec.saveAll();
}

View File

@@ -25,7 +25,7 @@ _IGNORED_PATTERNS = [
re.compile(r'^$'),
re.compile(r'^Analyzing \['),
re.compile(r'^No issues found'),
re.compile(r'^[0-9]+ (error|warning|hint).*found\.'),
re.compile(r'^[0-9]+ (error|warning|hint|lint).*found\.'),
# We still have some parts in our code, so silence the warnings that come from trying to analyze them directly.
re.compile(r'^Only libraries can be analyzed\.$'),

View File

@@ -18,7 +18,7 @@ import sys
# How to roll the dart sdk: Just change this url! We write this to the stamp
# file after we download, and then check the stamp file for differences.
SDK_URL_BASE = ('http://gsdview.appspot.com/dart-archive/channels/dev/raw/'
'1.13.0-dev.6.0/sdk/')
'1.13.0-dev.7.4/sdk/')
LINUX_64_SDK = 'dartsdk-linux-x64-release.zip'
MACOS_64_SDK = 'dartsdk-macos-x64-release.zip'