OLD | NEW |
1 // Copyright (c) 2015, the Dartino project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dartino 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.md file. | 3 // BSD-style license that can be found in the LICENSE.md file. |
4 | 4 |
5 library dartino_compiler.worker.developer; | 5 library dartino_compiler.worker.developer; |
6 | 6 |
7 import 'dart:async' show | 7 import 'dart:async' show |
8 Future, | 8 Future, |
9 TimeoutException; | 9 TimeoutException; |
10 | 10 |
(...skipping 1265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1276 String toolName) async { | 1276 String toolName) async { |
1277 Uri url = Uri.parse("$gcsRoot/$gcsBucket/$gcsPath/$zipFile"); | 1277 Uri url = Uri.parse("$gcsRoot/$gcsBucket/$gcsPath/$zipFile"); |
1278 return await downloadToolFromUri(url, zipFile, toolName); | 1278 return await downloadToolFromUri(url, zipFile, toolName); |
1279 } | 1279 } |
1280 | 1280 |
1281 String gcsPath; | 1281 String gcsPath; |
1282 | 1282 |
1283 Version version = parseVersion(dartinoVersion); | 1283 Version version = parseVersion(dartinoVersion); |
1284 if (version.isEdgeVersion) { | 1284 if (version.isEdgeVersion) { |
1285 // For edge versions download use a well known version for now. | 1285 // For edge versions download use a well known version for now. |
1286 var knownVersion = "0.3.0-dev.5.2"; | 1286 var knownVersion = "0.5.0-dev.0.0"; |
1287 print("WARNING: For bleeding edge tools from version " | 1287 print("WARNING: For bleeding edge tools from version " |
1288 "$knownVersion is used."); | 1288 "$knownVersion is used."); |
1289 gcsPath = "channels/dev/raw/$knownVersion/sdk"; | 1289 gcsPath = "channels/dev/raw/$knownVersion/sdk"; |
1290 } else if (version.isDevVersion) { | 1290 } else if (version.isDevVersion) { |
1291 // TODO(sgjesse): Change this to channels/dev/release at some point. | 1291 // TODO(sgjesse): Change this to channels/dev/release at some point. |
1292 gcsPath = "channels/dev/raw/$version/sdk"; | 1292 gcsPath = "channels/dev/raw/$version/sdk"; |
1293 } else { | 1293 } else { |
1294 print("Stable version not supported. Got version $version."); | 1294 print("Stable version not supported. Got version $version."); |
1295 } | 1295 } |
1296 | 1296 |
(...skipping 11 matching lines...) Expand all Loading... |
1308 await downloadTool(gcsPath, gccArmEmbedded, "GCC ARM Embedded toolchain"); | 1308 await downloadTool(gcsPath, gccArmEmbedded, "GCC ARM Embedded toolchain"); |
1309 if (result != 0) return result; | 1309 if (result != 0) return result; |
1310 | 1310 |
1311 String openocd = "openocd-${osName}.zip"; | 1311 String openocd = "openocd-${osName}.zip"; |
1312 result = | 1312 result = |
1313 await downloadTool(gcsPath, openocd, "Open On-Chip Debugger (OpenOCD)"); | 1313 await downloadTool(gcsPath, openocd, "Open On-Chip Debugger (OpenOCD)"); |
1314 if (result != 0) return result; | 1314 if (result != 0) return result; |
1315 | 1315 |
1316 // TODO(karlklose): add MacOS version | 1316 // TODO(karlklose): add MacOS version |
1317 if (Platform.isLinux) { | 1317 if (Platform.isLinux) { |
1318 String emul8 = "emul8-${osName}.zip"; | 1318 String gccArmEmbedded = "emul8-${osName}.zip"; |
1319 // TODO(karlklose): remove this and the helper when we have a dev version | 1319 var result = |
1320 // archived that we can point to. | 1320 await downloadTool(gcsPath, gccArmEmbedded, "Emul8"); |
1321 Uri temporaryPath = Uri.parse( | |
1322 "https://storage.googleapis.com/dartino-temporary/channels/be/raw/" | |
1323 "0.4.0-edge.8fa0e09687e17b163825f757a9a7e89e6dd8e97d/sdk/" | |
1324 "emul8-linux.zip"); | |
1325 result = await downloadToolFromUri(temporaryPath, emul8, "Emul8"); | |
1326 if (result != 0) return result; | 1321 if (result != 0) return result; |
1327 } | 1322 } |
1328 | 1323 |
1329 print("Third party tools downloaded"); | 1324 print("Third party tools downloaded"); |
1330 | 1325 |
1331 return 0; | 1326 return 0; |
1332 } | 1327 } |
1333 | 1328 |
1334 Future<Directory> locateBinDirectory() async { | 1329 Future<Directory> locateBinDirectory() async { |
1335 // In the SDK, the tools directory is at the same level as the | 1330 // In the SDK, the tools directory is at the same level as the |
(...skipping 979 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2315 addIfNotNull("open_ocd_board", openOcdBoard); | 2310 addIfNotNull("open_ocd_board", openOcdBoard); |
2316 return result; | 2311 return result; |
2317 } | 2312 } |
2318 } | 2313 } |
2319 | 2314 |
2320 Uri defaultSnapshotLocation(Uri script) { | 2315 Uri defaultSnapshotLocation(Uri script) { |
2321 // TODO(sgjesse): Use a temp directory for the snapshot. | 2316 // TODO(sgjesse): Use a temp directory for the snapshot. |
2322 String snapshotName = basenameWithoutExtension(script.path) + '.snapshot'; | 2317 String snapshotName = basenameWithoutExtension(script.path) + '.snapshot'; |
2323 return script.resolve(snapshotName); | 2318 return script.resolve(snapshotName); |
2324 } | 2319 } |
OLD | NEW |