diff --git a/sky/BUILD.gn b/sky/BUILD.gn index 63dec398e5ce4..9af1220f86c69 100644 --- a/sky/BUILD.gn +++ b/sky/BUILD.gn @@ -23,6 +23,7 @@ group("sky_dev") { testonly = true deps = [ + "//sky/packages", "//sky/sdk", "//sky/sdk/example/demo_launcher", ] diff --git a/sky/packages/BUILD.gn b/sky/packages/BUILD.gn new file mode 100644 index 0000000000000..31cb33321fb02 --- /dev/null +++ b/sky/packages/BUILD.gn @@ -0,0 +1,11 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +group("packages") { + testonly = true + + deps = [ + "//sky/packages/sky_engine", + ] +} diff --git a/sky/packages/sky_engine/BUILD.gn b/sky/packages/sky_engine/BUILD.gn new file mode 100644 index 0000000000000..a6af8f7ef4125 --- /dev/null +++ b/sky/packages/sky_engine/BUILD.gn @@ -0,0 +1,27 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//mojo/public/dart/rules.gni") + +dart_pkg("sky_engine") { + sources = [ + "README.md", + "pubspec.yaml", + ] + + deps = [ + "//sky/engine/bindings", + ] + + sdk_ext_directory = "$root_gen_dir/sky/bindings" + sdk_ext_files = [ + "//sky/engine/bindings/sky_internals.dart", + "//sky/engine/bindings/builtin_natives.dart", + ] + sdk_ext_mappings = [ + "dart:sky,dart_sky.dart", + "dart:sky.internals,sky_internals.dart", + "dart:sky_builtin_natives,builtin_natives.dart", + ] +} diff --git a/sky/packages/sky_engine/README.md b/sky/packages/sky_engine/README.md new file mode 100644 index 0000000000000..c13095c9589d0 --- /dev/null +++ b/sky/packages/sky_engine/README.md @@ -0,0 +1,7 @@ +Sky Engine +========== + +This packages describes the dart:sky library, which is the interface between +Dart and the Sky Engine. This package also contains a number of Sky shell +binaries that let you run code that uses the dart:sky library on various +platforms. diff --git a/sky/packages/sky_engine/pubspec.yaml b/sky/packages/sky_engine/pubspec.yaml new file mode 100644 index 0000000000000..9bae97102dcdb --- /dev/null +++ b/sky/packages/sky_engine/pubspec.yaml @@ -0,0 +1,5 @@ +name: sky_engine +version: 0.0.1 +author: Chromium Authors +description: Dart SDK extensions for dart:sky +homepage: https://github.com/domokit/sky_engine diff --git a/sky/sdk/BUILD.gn b/sky/sdk/BUILD.gn index 5bff99bca1a56..aab97437a71b4 100644 --- a/sky/sdk/BUILD.gn +++ b/sky/sdk/BUILD.gn @@ -108,21 +108,11 @@ dart_pkg("sky") { "//mojo/dart/mojom", "//mojo/public/dart:mojo", "//sky/engine/bindings", - "//sky/services/testing:interfaces", + "//sky/packages/sky_engine", "//sky/services/media:interfaces", + "//sky/services/testing:interfaces", "//third_party/dart-pkg", ] - - sdk_ext_directory = "$root_gen_dir/sky/bindings" - sdk_ext_files = [ - "//sky/engine/bindings/sky_internals.dart", - "//sky/engine/bindings/builtin_natives.dart", - ] - sdk_ext_mappings = [ - "dart:sky,dart_sky.dart", - "dart:sky.internals,sky_internals.dart", - "dart:sky_builtin_natives,builtin_natives.dart", - ] } action("material_design_icons") { diff --git a/sky/sdk/pubspec.yaml b/sky/sdk/pubspec.yaml index 469f0638be068..7a0528f3c4f9e 100644 --- a/sky/sdk/pubspec.yaml +++ b/sky/sdk/pubspec.yaml @@ -1,15 +1,16 @@ +name: sky +version: 0.0.21 author: Chromium Authors +description: A framework for writing Sky applications +homepage: https://github.com/domokit/sky_engine/tree/master/sky/sdk dependencies: cassowary: ^0.1.7 mojo_services: ^0.0.15 mojo: ^0.0.17 mojom: ^0.0.17 newton: ^0.1.0 + sky_engine: ^0.0.1 sky_tools: ^0.0.2 vector_math: ^1.4.3 -description: Dart files to support executing inside Sky environment: sdk: '>=1.8.0 <2.0.0' -homepage: https://github.com/domokit/mojo/tree/master/sky -name: sky -version: 0.0.21 diff --git a/sky/tools/roll_versions.py b/sky/tools/roll_versions.py index 80861c4c967e8..e74259b66d148 100755 --- a/sky/tools/roll_versions.py +++ b/sky/tools/roll_versions.py @@ -10,6 +10,7 @@ PUBSPECS = [ + 'sky/packages/sky_engine/pubspec.yaml', 'sky/sdk/pubspec.yaml', ] diff --git a/sky/tools/setup_dart_analyzer b/sky/tools/setup_dart_analyzer index 8062ea9652849..0d733742600eb 100755 --- a/sky/tools/setup_dart_analyzer +++ b/sky/tools/setup_dart_analyzer @@ -15,13 +15,6 @@ SRC_ROOT = os.path.dirname(os.path.dirname(SKY_TOOLS_DIR)) SKY_SDK_DIR = os.path.join(SRC_ROOT, 'sky', 'sdk') SKY_PUBSPEC = os.path.join(SKY_SDK_DIR, 'pubspec.yaml') SKY_PUBSPEC_LOCK = os.path.join(SKY_SDK_DIR, 'pubspec.lock') -SDK_EXT = os.path.join(SKY_SDK_DIR, 'lib', '_sdkext') - -SDK_EXT_TEMPLATE = '''{ - "dart:sky": "%(build_dir)s/gen/dart-pkg/sky/sdk_ext/dart_sky.dart", - "dart:sky.internals": "%(build_dir)s/gen/dart-pkg/sky/sdk_ext/sky_internals.dart", - "dart:sky_builtin_natives": "%(build_dir)s/gen/dart-pkg/sky/sdk_ext/builtin_natives.dart" -}''' def version_for_pubspec(pubspec_path): with open(pubspec_path, 'r') as stream: @@ -31,7 +24,10 @@ def version_for_pubspec(pubspec_path): def entry_for_dependency(dart_pkg_dir, dependency): dependency_path = os.path.join(dart_pkg_dir, dependency) - version = version_for_pubspec(os.path.join(dependency_path, 'pubspec.yaml')) + pubspec_path = os.path.join(dependency_path, 'pubspec.yaml') + if not os.path.exists(pubspec_path): + return + version = version_for_pubspec(pubspec_path) return { 'description': { 'path': os.path.relpath(dependency_path, SKY_SDK_DIR), @@ -59,16 +55,15 @@ def main(): with open(SKY_PUBSPEC, 'r') as stream: spec = yaml.load(stream) for dependency in spec['dependencies'].keys(): - packages[dependency] = entry_for_dependency(dart_pkg_dir, dependency) + entry = entry_for_dependency(dart_pkg_dir, dependency) + if not entry: + continue + packages[dependency] = entry lock = { 'packages': packages } with open(SKY_PUBSPEC_LOCK, 'w') as stream: yaml.dump(lock, stream=stream, default_flow_style=False) - with open(SDK_EXT, 'w') as stream: - rebased_build_dir = os.path.relpath(args.build_dir, os.path.dirname(SDK_EXT)) - stream.write(SDK_EXT_TEMPLATE % { 'build_dir': rebased_build_dir }) - if __name__ == '__main__': sys.exit(main())