Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(974)

Side by Side Diff: samples/simple_todo/java/SimpleTodo.java

Issue 2035023003: Remove service-compiler related code. (Closed) Base URL: git@github.com:dartino/sdk.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « samples/simple_todo/compile.sh ('k') | samples/simple_todo/java/SnapshotRunner.java » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // BSD-style license that can be found in the LICENSE.md file.
4
5 import dartino.*;
6
7 import java.io.FileInputStream;
8 import java.io.FileNotFoundException;
9 import java.io.IOException;
10
11 class SimpleTodo {
12
13 public static void main(String args[]) {
14 // Expecting a snapshot of the dart service code on the command line.
15 if (args.length != 1) {
16 System.out.println("Usage: java SimpleTodo <snapshot>");
17 System.exit(1);
18 }
19
20 // Load libdartino.so.
21 System.loadLibrary("dartino");
22
23 // Setup Dartino.
24 DartinoApi.Setup();
25 DartinoServiceApi.Setup();
26 DartinoApi.AddDefaultSharedLibrary("libdartino.so");
27
28 try {
29 // Load snapshot and start dart code on a separate thread.
30 FileInputStream snapshotStream = new FileInputStream(args[0]);
31 int available = snapshotStream.available();
32 byte[] snapshot = new byte[available];
33 snapshotStream.read(snapshot);
34 Thread dartThread = new Thread(new SnapshotRunner(snapshot));
35 dartThread.start();
36 } catch (FileNotFoundException e) {
37 System.err.println("Failed loading snapshot: file not found.");
38 System.exit(1);
39 } catch (IOException e) {
40 System.err.println("Failed loading snapshot: unknown error.");
41 System.exit(1);
42 }
43
44 TodoController.InteractWithService();
45 }
46 }
OLDNEW
« no previous file with comments | « samples/simple_todo/compile.sh ('k') | samples/simple_todo/java/SnapshotRunner.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698