Merge pull request #250 from abarth/material_package
Move Material Design Icons to their own package
This commit is contained in:
@@ -15,14 +15,11 @@ dart_pkg("sky") {
|
||||
"lib/animation/forces.dart",
|
||||
"lib/animation/scroll_behavior.dart",
|
||||
"lib/animation/timeline.dart",
|
||||
"lib/assets/.gitignore",
|
||||
"lib/assets/material-design-icons.sha1",
|
||||
"lib/base/debug.dart",
|
||||
"lib/base/hit_test.dart",
|
||||
"lib/base/lerp.dart",
|
||||
"lib/base/node.dart",
|
||||
"lib/base/scheduler.dart",
|
||||
"lib/download_material_design_icons",
|
||||
"lib/editing/editable_string.dart",
|
||||
"lib/editing/editable_text.dart",
|
||||
"lib/editing/input.dart",
|
||||
@@ -115,34 +112,8 @@ dart_pkg("sky") {
|
||||
]
|
||||
}
|
||||
|
||||
action("material_design_icons") {
|
||||
source_file = "lib/assets/material-design-icons"
|
||||
target_file = "$root_gen_dir/dart-pkg/sky/lib/assets/material-design-icons"
|
||||
stamp = "$target_gen_dir/material_design_icons_linked"
|
||||
|
||||
sources = [
|
||||
"lib/assets/material-design-icons.sha1",
|
||||
]
|
||||
outputs = [
|
||||
stamp,
|
||||
]
|
||||
|
||||
script = "//sky/build/symlink.py"
|
||||
args = [
|
||||
rebase_path(source_file, root_build_dir),
|
||||
rebase_path(target_file, root_build_dir),
|
||||
"--touch",
|
||||
rebase_path(stamp, root_build_dir),
|
||||
]
|
||||
|
||||
deps = [
|
||||
":sky",
|
||||
]
|
||||
}
|
||||
|
||||
group("sdk") {
|
||||
deps = [
|
||||
":sky",
|
||||
":material_design_icons",
|
||||
]
|
||||
}
|
||||
|
||||
1
packages/flutter/lib/assets/.gitignore
vendored
1
packages/flutter/lib/assets/.gitignore
vendored
@@ -1 +0,0 @@
|
||||
material-design-icons
|
||||
@@ -1 +0,0 @@
|
||||
74927f91069e6540e40983acb5eb40072704fd2f
|
||||
@@ -1,55 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
# Copyright (c) 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 os
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
import urllib2
|
||||
|
||||
|
||||
def main():
|
||||
sky_lib_dir = os.path.dirname(os.path.abspath(__file__))
|
||||
assets_dir = os.path.join(sky_lib_dir, 'assets')
|
||||
icons_dir = os.path.join(assets_dir, 'material-design-icons')
|
||||
existing_sha1_path = os.path.join(icons_dir, 'material-design-icons.sha1')
|
||||
|
||||
existing_sha1 = None
|
||||
if os.path.isfile(existing_sha1_path):
|
||||
with open(existing_sha1_path, 'r') as f:
|
||||
existing_sha1 = f.read()
|
||||
|
||||
sha1_path = os.path.join(assets_dir, 'material-design-icons.sha1')
|
||||
|
||||
with open(sha1_path, 'r') as f:
|
||||
sha1 = f.read()
|
||||
|
||||
if existing_sha1 == sha1:
|
||||
return
|
||||
|
||||
print "Downloading missing material design icons"
|
||||
|
||||
tgz_path = os.path.join(assets_dir, 'material-design-icons.tgz')
|
||||
url = 'https://storage.googleapis.com/mojo/material-design-icons/%s' % sha1
|
||||
response = urllib2.urlopen(url)
|
||||
|
||||
with open(tgz_path, 'wb') as f:
|
||||
f.write(response.read())
|
||||
|
||||
shutil.rmtree(icons_dir, ignore_errors=True)
|
||||
|
||||
output_path = os.path.join(assets_dir, tgz_path)
|
||||
subprocess.call([
|
||||
'tar', '-xzf', output_path, '-C', assets_dir
|
||||
])
|
||||
|
||||
subprocess.call([
|
||||
'cp', sha1_path, icons_dir
|
||||
])
|
||||
|
||||
os.unlink(tgz_path)
|
||||
|
||||
if __name__ == '__main__':
|
||||
sys.exit(main())
|
||||
@@ -41,7 +41,7 @@ class IconTheme extends Inherited {
|
||||
AssetBundle _initIconBundle() {
|
||||
if (rootBundle != null)
|
||||
return rootBundle;
|
||||
const String _kAssetBase = '/packages/sky/assets/material-design-icons/';
|
||||
const String _kAssetBase = '/packages/material_design_icons/icons/';
|
||||
return new NetworkAssetBundle(Uri.base.resolve(_kAssetBase));
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ description: A framework for writing Sky applications
|
||||
homepage: https://github.com/domokit/sky_engine/tree/master/sky/sdk
|
||||
dependencies:
|
||||
cassowary: ^0.1.7
|
||||
material_design_icons: ^0.0.1
|
||||
mojo_services: ^0.0.15
|
||||
mojo: ^0.0.17
|
||||
mojom: ^0.0.17
|
||||
|
||||
Reference in New Issue
Block a user