diff --git a/dart.gyp b/dart.gyp index b87b5688272..914b088d9ac 100644 --- a/dart.gyp +++ b/dart.gyp @@ -184,5 +184,13 @@ 'pkg/pkg.gyp:pkg_packages', ], }, + { + 'target_name': 'try', + 'type': 'none', + 'dependencies': [ + 'create_sdk', + 'site/try/build_try.gyp:try_site', + ], + }, ], } diff --git a/sdk/lib/_internal/compiler/samples/jsonify/jsonify.dart b/sdk/lib/_internal/compiler/samples/jsonify/jsonify.dart index 36596aaa2b9..e639c4e52e9 100644 --- a/sdk/lib/_internal/compiler/samples/jsonify/jsonify.dart +++ b/sdk/lib/_internal/compiler/samples/jsonify/jsonify.dart @@ -31,6 +31,8 @@ var handler; RandomAccessFile output; Uri outputUri; Uri sdkRoot; +const bool outputJson = + const bool.fromEnvironment('outputJson', defaultValue: false); main(List arguments) { handler = new FormattingDiagnosticHandler() @@ -77,7 +79,10 @@ jsonify(MirrorSystem mirrors) { } }); - output.writeStringSync(''' + if (outputJson) { + output.writeStringSync(JSON.encode(map)); + } else { + output.writeStringSync(''' // Copyright (c) 2013, 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. @@ -88,7 +93,8 @@ jsonify(MirrorSystem mirrors) { library dart.sdk_sources; const Map SDK_SOURCES = const '''); - output.writeStringSync(JSON.encode(map).replaceAll(r'$', r'\$')); - output.writeStringSync(';\n'); + output.writeStringSync(JSON.encode(map).replaceAll(r'$', r'\$')); + output.writeStringSync(';\n'); + } output.closeSync(); } diff --git a/site/try/app.yaml b/site/try/app.yaml index 4d6864d454b..24ae3106ff7 100644 --- a/site/try/app.yaml +++ b/site/try/app.yaml @@ -5,11 +5,26 @@ # App Engine configuration, see: # https://developers.google.com/appengine/docs/python/config/appconfig +# The version number should be something like rSVN_REVISION. +version: remember to edit app.yaml before deploying +# This version name is used to create a new host, for example, +# http://r31824.try-dart-lang.appspot.com/, which can be tested before going +# live at http://try.dartlang.org/. This is controlled from +# https://appengine.google.com/deployment?&app_id=s~try-dart-lang + application: try-dart-lang -version: 5-sdk1-0 runtime: python27 api_version: 1 threadsafe: yes + +# Set "Cache-Control" and "Expires" HTTP headers to only cache for one second. +# We do this because we frequently push new changes and rely on AppCache for +# caching. Once files are installed in AppCache, the site launches +# immediately. +# +# Problem: PageSpeed Insights doesn't realize that we use AppCache and keeps +# nagging about caching. +# Solution: Ignore its advice about "Leverage browser caching". default_expiration: 1s handlers: @@ -34,12 +49,15 @@ handlers: upload: (.*\.(html|js|png|css|dart|json)) secure: never -- url: /css/fonts/ - static_dir: font +- url: /css/fonts/fontawesome-webfont.woff + static_files: fontawesome-webfont.woff + upload: fontawesome-webfont.woff secure: never -error_handlers: - - file: static/not_found.html +- url: .* + static_files: not_found.html + upload: not_found.html + secure: never libraries: - name: webapp2 diff --git a/site/try/build_try.gyp b/site/try/build_try.gyp new file mode 100644 index 00000000000..4a7eea07853 --- /dev/null +++ b/site/try/build_try.gyp @@ -0,0 +1,94 @@ +# Copyright (c) 2014, 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 + +{ + 'targets': [ + { + 'target_name': 'try_site', + 'type': 'none', + 'dependencies': [ + '../../runtime/dart-runtime.gyp:dart', + # Concern: there should really be a dependency on + # ../../dart.gyp:create_sdk, but this is reported as a cycle by GYP. + ], + 'actions': [ + { + 'action_name': 'sdk_json', + 'message': 'Creating sdk.json', + 'inputs': [ + + # Depending on this file ensures that the SDK is built before this + # action is executed. + '<(PRODUCT_DIR)/dart-sdk/README', + + # This dependency is redundant for now, as this directory is + # implicitly part of the dependencies for dart-sdk/README. + ' + + + + Missing Resource + + + +

Missing Resource

+ +