OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 library update_homebrew; | 5 library update_homebrew; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 import 'dart:convert'; | 8 import 'dart:convert'; |
9 import 'dart:io'; | 9 import 'dart:io'; |
10 | 10 |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 version '$stableVersion' | 227 version '$stableVersion' |
228 url '$urlBase/stable/release/${revisions['stable']}/$dartiumFile' | 228 url '$urlBase/stable/release/${revisions['stable']}/$dartiumFile' |
229 sha256 '${hashes['stable'][dartiumFile]}' | 229 sha256 '${hashes['stable'][dartiumFile]}' |
230 end | 230 end |
231 | 231 |
232 def install | 232 def install |
233 libexec.install Dir['*'] | 233 libexec.install Dir['*'] |
234 bin.install_symlink "#{libexec}/bin/dart" | 234 bin.install_symlink "#{libexec}/bin/dart" |
235 bin.write_exec_script Dir["#{libexec}/bin/{pub,docgen,dart?*}"] | 235 bin.write_exec_script Dir["#{libexec}/bin/{pub,docgen,dart?*}"] |
236 | 236 |
237 if build.with? 'content-shell' | 237 if build.with? 'dartium' |
238 dartium_binary = 'Chromium.app/Contents/MacOS/Chromium' | 238 dartium_binary = 'Chromium.app/Contents/MacOS/Chromium' |
239 prefix.install resource('dartium') | 239 prefix.install resource('dartium') |
240 (bin+"dartium").write shim_script dartium_binary | 240 (bin+"dartium").write shim_script dartium_binary |
241 end | 241 end |
242 | 242 |
243 if build.with? 'content-shell' | 243 if build.with? 'content-shell' |
244 content_shell_binary = 'Content Shell.app/Contents/MacOS/Content Shell' | 244 content_shell_binary = 'Content Shell.app/Contents/MacOS/Content Shell' |
245 prefix.install resource('content_shell') | 245 prefix.install resource('content_shell') |
246 (bin+"content_shell").write shim_script content_shell_binary | 246 (bin+"content_shell").write shim_script content_shell_binary |
247 end | 247 end |
248 end | 248 end |
249 | 249 |
250 def shim_script target | 250 def shim_script target |
251 <<-EOS.undent | 251 <<-EOS.undent |
252 #!/bin/bash | 252 #!/bin/bash |
253 exec "#{prefix}/#{target}" "\$@" | 253 exec "#{prefix}/#{target}" "\$@" |
254 EOS | 254 EOS |
255 end | 255 end |
256 | 256 |
257 def caveats; <<-EOS.undent | 257 def caveats; <<-EOS.undent |
258 Please note the path to the Dart SDK: | 258 Please note the path to the Dart SDK: |
259 #{opt_libexec} | 259 #{opt_libexec} |
260 | 260 |
261 --with-dartium: | 261 --with-dartium: |
262 To use with IntelliJ, set the Dartium execute home to: | 262 To use with IntelliJ, set the Dartium execute home to: |
263 #{prefix}/Chromium.app | 263 #{opt_prefix}/Chromium.app |
264 EOS | 264 EOS |
265 end | 265 end |
266 | 266 |
267 test do | 267 test do |
268 (testpath/'sample.dart').write <<-EOS.undent | 268 (testpath/'sample.dart').write <<-EOS.undent |
269 void main() { | 269 void main() { |
270 print(r"test message"); | 270 print(r"test message"); |
271 } | 271 } |
272 EOS | 272 EOS |
273 | 273 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 | 323 |
324 await runGit(['push']); | 324 await runGit(['push']); |
325 } finally { | 325 } finally { |
326 await tempDir.delete(recursive: true); | 326 await tempDir.delete(recursive: true); |
327 } | 327 } |
328 }, onError: (error, chain) { | 328 }, onError: (error, chain) { |
329 print(error); | 329 print(error); |
330 print(chain.terse); | 330 print(chain.terse); |
331 }); | 331 }); |
332 } | 332 } |
OLD | NEW |