Delete sky_demo, and remove all dependencies on SKY_DIR.

The sky_demo was out-of-date and broken.  Rather than fix it and
continue to maintain it, I think it should just be deleted.

It's clear that sky apps can communicate with mojo services, so we don't
really gain much by maintaining our own.

In addition, the process for setting up a sky app with a mojo service
has gotten much easier since "sky_tool run-mojo" has become available.

Furthermore there are other sky apps now (like Croupier) that are using
syncbase+mojo, and serve as better examples of sky+mojo+syncbase
integration.

Change-Id: I29ed0fca82efc7029671a9ef09b4168ca1413724
diff --git a/Makefile b/Makefile
index 70f7feb..4a29353 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
 PWD := $(shell pwd)
-DART_FILES := $(shell find dart/bin dart/lib dart/test sky_demo/lib -name "*.dart" -not -path "dart/lib/gen/*")
+DART_FILES := $(shell find dart/bin dart/lib dart/test -name "*.dart" -not -path "dart/lib/gen/*")
 V23_GO_FILES := $(shell find $(JIRI_ROOT) -name "*.go")
 
 include ../shared/mojo.mk
@@ -14,7 +14,6 @@
 endif
 
 ifdef ANDROID
-	SKY_BUILD_DIR := $(SKY_DIR)/src/out/android_Debug
 	ETHER_BUILD_DIR := $(PWD)/gen/mojo/android
 
 	THIRD_PARTY_LIBS := $(JIRI_ROOT)/third_party/cout/android_arm
@@ -28,7 +27,6 @@
 	APP_HOME_DIR = /data/data/org.chromium.mojo.shell/app_home
 	V23_MOJO_FLAGS += --logtostderr=true --root-dir=$(APP_HOME_DIR)/syncbase_data
 else
-	SKY_BUILD_DIR := $(SKY_DIR)/src/out/Debug
 	ETHER_BUILD_DIR := $(PWD)/gen/mojo/linux_amd64
 
 	THIRD_PARTY_LIBS := $(JIRI_ROOT)/third_party/cout/linux_amd64
@@ -96,35 +94,21 @@
 
 # Lints src and test files with dartanalyzer. This takes a few seconds.
 .PHONY: dartanalyzer
-dartanalyzer: dart/packages sky_demo/packages gen-mojom
+dartanalyzer: dart/packages gen-mojom
 	# TODO(nlacasse): Fix dart mojom binding generator so it does not produce
 	# files that violate dartanalyzer.  For now, we use "grep -v" to hide all
 	# hints and warnings from *.mojom.dart files.
 	cd dart && dartanalyzer bin/*.dart lib/*.dart test/**/*.dart | grep -v "\.mojom\.dart, line"
-	cd sky_demo && dartanalyzer lib/*.dart | grep -v "\.mojom\.dart, line"
 
 # Installs dart dependencies.
 .PHONY: dart/packages
 dart/packages:
 	cd dart && pub upgrade
 
-# Installs dart dependencies.
-.PHONY: sky_demo/packages
-sky_demo/packages:
-	cd sky_demo && pub upgrade
-
 .PHONY: run-syncbase-example
 run-syncbase-example: $(ETHER_BUILD_DIR)/syncbase_server.mojo dart/packages dart/lib/gen/dart-gen/mojom/lib/mojo/syncbase.mojom.dart | syncbase-env-check
 	$(call MOJO_RUN,https://mojo.v.io/syncbase_example.dart)
 
-.PHONY: run-sky-demo
-run-sky-demo: MOJO_SHELL_FLAGS += --config-alias SKY_DIR=$(SKY_DIR) --config-alias SKY_BUILD_DIR=$(SKY_BUILD_DIR)
-run-sky-demo: sky_demo/packages $(ETHER_BUILD_DIR)/syncbase_server.mojo dart/lib/gen/dart-gen/mojom/lib/mojo/syncbase.mojom.dart | syncbase-env-check
-ifndef SKY_DIR
-	$(error SKY_DIR is not set)
-endif
-	$(MOJO_DIR)/src/mojo/devtools/common/mojo_run --config-file $(PWD)/sky_demo/mojoconfig $(MOJO_SHELL_FLAGS) $(MOJO_ANDROID_FLAGS) 'mojo:window_manager https://mojo.v.io/sky_demo/lib/main.dart'
-
 .PHONY: test
 test: test-unit test-integration
 
@@ -157,4 +141,4 @@
 
 .PHONY: veryclean
 veryclean: clean
-	rm -rf {dart,sky_demo}/{.packages,pubspec.lock,packages}
+	rm -rf dart/{.packages,pubspec.lock,packages}
diff --git a/README.md b/README.md
index 4f3bc9c..07f78c5 100644
--- a/README.md
+++ b/README.md
@@ -63,15 +63,6 @@
         $ ./mojo/tools/mojob.py gn --android
         $ ./mojo/tools/mojob.py build --android # NOTE: This can take up to 10 minutes.
 
-## Sky setup
-
-You must have the Sky code in `$SKY_DIR`. Follow the instructions in the Sky
-[CONTRIBUTING.md][sky contrib] file for "Getting the code" and "Building the
-code".
-
-Also, you must patch your Mojo code (and rebuild Mojo):
-https://github.com/domokit/mojo/issues/370
-
 ## Install Dart SDK
 
 To run Dart apps, you must install the Dart SDK.
@@ -97,4 +88,3 @@
 [depot tools]: http://www.chromium.org/developers/how-tos/install-depot-tools
 [goma]: https://sites.google.com/a/google.com/goma/how-to-use-goma/how-to-use-goma-for-chrome-team
 [mojo readme]: https://github.com/domokit/mojo/blob/master/README.md
-[sky contrib]: https://github.com/domokit/sky_engine/blob/master/CONTRIBUTING.md
diff --git a/sky_demo/lib/main.dart b/sky_demo/lib/main.dart
deleted file mode 100644
index 5de8671..0000000
--- a/sky_demo/lib/main.dart
+++ /dev/null
@@ -1,95 +0,0 @@
-// Copyright 2015 The Vanadium Authors. 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:async';
-import 'dart:convert' show UTF8;
-
-import 'package:sky/src/services/embedder.dart' show embedder;
-import 'package:sky/widgets.dart';
-
-import 'package:ether/syncbase_client.dart'
-    show Perms, SyncbaseClient, SyncbaseTable;
-
-log(String msg) {
-  DateTime now = new DateTime.now();
-  print('$now $msg');
-}
-
-Perms emptyPerms() => new Perms()..json = '{}';
-
-class DemoApp extends App {
-  final SyncbaseClient _syncbaseClient;
-
-  DemoApp() : _syncbaseClient = new SyncbaseClient(
-          embedder.connectToService, 'https://mojo.v.io/syncbase_server.mojo');
-
-  int seq = 0;
-  SyncbaseTable tb;
-  String putStr, getStr;
-
-  Future doSyncbaseInit() async {
-    log('DemoApp.doSyncbaseInit');
-    if (tb != null) {
-      log('syncbase already initialized');
-      return;
-    }
-    var app = _syncbaseClient.app('app');
-    if (!(await app.exists())) {
-      await app.create(emptyPerms());
-    }
-    var db = app.noSqlDatabase('db');
-    if (!(await db.exists())) {
-      await db.create(emptyPerms());
-    }
-    var table = db.table('table');
-    if (!(await table.exists())) {
-      await table.create(emptyPerms());
-    }
-    tb = table;
-    log('syncbase is now initialized');
-  }
-
-  Future doPutGet() async {
-    log('DemoApp.doPutGet');
-    await doSyncbaseInit();
-
-    setState(() {
-      putStr = seq.toString();
-      getStr = '';
-    });
-    seq++;
-    log('setState putStr done');
-
-    // TODO(sadovsky): Switch to tb.put/get once they exist.
-    var row = tb.row('key');
-    await row.put(UTF8.encode(putStr));
-    var getBytes = await row.get();
-
-    setState(() {
-      getStr = UTF8.decode(getBytes);
-    });
-    log('setState getStr done');
-  }
-
-  // TODO(sadovsky): I don't think Sky calls App.close().
-  Future close({bool immediate: false}) async {
-    log('DemoApp.close');
-    await _syncbaseClient.close(immediate: immediate);
-  }
-
-  Widget build() {
-    return new Container(
-        decoration: const BoxDecoration(
-            backgroundColor: const Color(0xFF00ACC1)),
-        child: new Flex([
-      new RaisedButton(child: new Text('doPutGet'), onPressed: doPutGet),
-      new Text('putStr: $putStr'),
-      new Text('getStr: $getStr')
-    ], direction: FlexDirection.vertical));
-  }
-}
-
-void main() {
-  runApp(new DemoApp());
-}
diff --git a/sky_demo/mojoconfig b/sky_demo/mojoconfig
deleted file mode 100644
index d0ce1a9..0000000
--- a/sky_demo/mojoconfig
+++ /dev/null
@@ -1,34 +0,0 @@
-# Combination of ../mojoconfig and $MOJO_DIR/src/mojo/tools/configs/sky.
-
-{
-  'dev_servers': [
-    {
-      'host': 'https://mojo.v.io/',
-      'mappings': [
-        ('packages/', [
-          # For sky_demo packages.
-          '@{ETHER_DIR}/sky_demo/packages',
-        ]),
-        ('', [
-          # For syncbase_server.mojo.
-          '@{ETHER_BUILD_DIR}',
-          # For sky_demo/lib/main.dart.
-          '@{ETHER_DIR}',
-        ]),
-      ],
-    },
-    {
-      'host': 'https://sky/',
-      'mappings': [
-        ('', [
-          # For sky_viewer.mojo.
-          '@{SKY_BUILD_DIR}'
-        ]),
-      ],
-    }
-  ],
-
-  'content_handlers': {
-    'application/dart': 'https://sky/sky_viewer.mojo',
-  }
-}
diff --git a/sky_demo/pubspec.yaml b/sky_demo/pubspec.yaml
deleted file mode 100644
index ca5894e..0000000
--- a/sky_demo/pubspec.yaml
+++ /dev/null
@@ -1,8 +0,0 @@
-name: sky_demo
-dependencies:
-  sky: any
-  sky_tools: any
-  ether: any
-dependency_overrides:
-  ether:
-    path: ../dart
diff --git a/tools/sync_repos.sh b/tools/sync_repos.sh
index 010486e..f4244db 100755
--- a/tools/sync_repos.sh
+++ b/tools/sync_repos.sh
@@ -22,18 +22,3 @@
   ./mojo/tools/mojob.py gn --android
   ./mojo/tools/mojob.py build --android
 fi
-
-####################
-# Sky
-
-cd $SKY_DIR/src
-git pull
-gclient sync
-if [[ "${DESKTOP}" = "1" ]]; then
-  ./sky/tools/gn
-  ninja -C out/Debug
-fi
-if [[ "${ANDROID}" = "1" ]]; then
-  ./sky/tools/gn --android
-  ninja -C out/android_Debug
-fi