Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

asset graph path is now based on script uri #88

Merged
merged 1 commit into from
Mar 11, 2016
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
11 changes: 10 additions & 1 deletion lib/src/util/constants.dart
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'dart:io';

import 'package:crypto/crypto.dart';

/// Relative path to the asset graph from the root package dir.
const assetGraphPath = '$cacheDir/asset_graph.json';
final assetGraphPath = '$cacheDir/${scriptHash}/asset_graph.json';

/// Relative path to the cache directory from the root package dir.
const cacheDir = '.dart_tool/build';

final String scriptHash = () {
var hasher = new MD5();
hasher.add(Platform.script.path.codeUnits);
return CryptoUtils.bytesToHex(hasher.close());
}();
1 change: 1 addition & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ dependencies:
analyzer: ^0.27.1
barback: ^0.15.0
code_transformers: ^0.4.1
crypto: 0.9.1
logging: ^0.11.2
glob: ^1.1.0
path: ^1.1.0
Expand Down