Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions sky/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ group("sky_dev") {
testonly = true

deps = [
"//sky/packages",
"//sky/sdk",
"//sky/sdk/example/demo_launcher",
]
Expand Down
11 changes: 11 additions & 0 deletions sky/packages/BUILD.gn
Original file line number Diff line number Diff line change
@@ -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",
]
}
27 changes: 27 additions & 0 deletions sky/packages/sky_engine/BUILD.gn
Original file line number Diff line number Diff line change
@@ -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",
]
}
7 changes: 7 additions & 0 deletions sky/packages/sky_engine/README.md
Original file line number Diff line number Diff line change
@@ -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.
5 changes: 5 additions & 0 deletions sky/packages/sky_engine/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
name: sky_engine
version: 0.0.1
author: Chromium Authors <sky-dev@googlegroups.com>
description: Dart SDK extensions for dart:sky
homepage: https://github.com/domokit/sky_engine
14 changes: 2 additions & 12 deletions sky/sdk/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -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") {
Expand Down
9 changes: 5 additions & 4 deletions sky/sdk/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
name: sky
version: 0.0.21
author: Chromium Authors <sky-dev@googlegroups.com>
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
1 change: 1 addition & 0 deletions sky/tools/roll_versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@


PUBSPECS = [
'sky/packages/sky_engine/pubspec.yaml',
'sky/sdk/pubspec.yaml',
]

Expand Down
21 changes: 8 additions & 13 deletions sky/tools/setup_dart_analyzer
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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),
Expand Down Expand Up @@ -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())