From 600f38c94daa8baf9e429cc20d5ab7f87b54ce3b Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Mon, 3 Jun 2013 17:57:37 +0800 Subject: [PATCH] Don't ship frameworks in repository, instead we download them. --- .gitignore | 1 + browser/api/atom_api_auto_updater.cc | 29 +++++++++++++++++++++++ browser/api/atom_api_auto_updater.h | 35 ++++++++++++++++++++++++++++ script/lib/polite-curl | 14 +++++++++++ script/update | 1 + script/update-frameworks | 21 +++++++++++++++++ 6 files changed, 101 insertions(+) create mode 100644 browser/api/atom_api_auto_updater.cc create mode 100644 browser/api/atom_api_auto_updater.h create mode 100755 script/lib/polite-curl create mode 100755 script/update-frameworks diff --git a/.gitignore b/.gitignore index 0999ffcd4617..7eb2ff83c723 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ atom-shell.zip version build/ dist/ +frameworks/ node/ node_modules/ vendor/ diff --git a/browser/api/atom_api_auto_updater.cc b/browser/api/atom_api_auto_updater.cc new file mode 100644 index 000000000000..620a3ad63824 --- /dev/null +++ b/browser/api/atom_api_auto_updater.cc @@ -0,0 +1,29 @@ +// Copyright (c) 2013 GitHub, Inc. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "browser/api/atom_api_auto_updater.h" + +#include "browser/auto_updater.h" + +namespace atom { + +namespace api { + +AutoUpdater::AutoUpdater(v8::Handle wrapper) + : EventEmitter(wrapper) { +} + +AutoUpdater::~AutoUpdater() { +} + +// static +void AutoUpdater::Initialize(v8::Handle target) { + v8::HandleScope scope; +} + +} // namespace api + +} // namespace atom + +NODE_MODULE(atom_browser_auto_updater, atom::api::AutoUpdater::Initialize) diff --git a/browser/api/atom_api_auto_updater.h b/browser/api/atom_api_auto_updater.h new file mode 100644 index 000000000000..f873583f3482 --- /dev/null +++ b/browser/api/atom_api_auto_updater.h @@ -0,0 +1,35 @@ +// Copyright (c) 2013 GitHub, Inc. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef ATOM_BROWSER_API_ATOM_API_AUTO_UPDATER_H_ +#define ATOM_BROWSER_API_ATOM_API_AUTO_UPDATER_H_ + +#include "browser/api/atom_api_event_emitter.h" +#include "browser/auto_updater_delegate.h" + +namespace atom { + +namespace api { + +class AutoUpdater : public EventEmitter, + public auto_updater::AutoUpdaterDelegate { + public: + virtual ~AutoUpdater(); + + static void Initialize(v8::Handle target); + + protected: + explicit AutoUpdater(v8::Handle wrapper); + + private: + static v8::Handle New(const v8::Arguments &args); + + DISALLOW_COPY_AND_ASSIGN(AutoUpdater); +}; + +} // namespace api + +} // namespace atom + +#endif // ATOM_BROWSER_API_ATOM_API_AUTO_UPDATER_H_ diff --git a/script/lib/polite-curl b/script/lib/polite-curl new file mode 100755 index 000000000000..dbf5ce4c41fb --- /dev/null +++ b/script/lib/polite-curl @@ -0,0 +1,14 @@ +if [ -t 0 ] ; then # If stdout is a terminal + INTERACTIVE=1 +fi + +polite_curl() +{ + if [ $INTERACTIVE ] ; then + CURL_ARGS="--progress-bar" + else + CURL_ARGS="-fsS" + fi + + curl $CURL_ARGS $* +} diff --git a/script/update b/script/update index 30b9218acd4e..444b2896118c 100755 --- a/script/update +++ b/script/update @@ -4,6 +4,7 @@ set -e cd "$(dirname "$0")/.." +./script/update-frameworks ./script/update-node v0.10.9 gyp --depth . atom.gyp \ diff --git a/script/update-frameworks b/script/update-frameworks new file mode 100755 index 000000000000..27a63ee1d0f4 --- /dev/null +++ b/script/update-frameworks @@ -0,0 +1,21 @@ +#!/bin/bash + +cd "$(dirname $0)/.." + +. script/lib/polite-curl + +[ -d frameworks ] || mkdir frameworks +cd frameworks + +FRAMEWORKS_URL='https://gh-contractor-zcbenz.s3.amazonaws.com/frameworks' + +trap 'rm *.zip' EXIT + +echo 'Downloading Quincy...' +polite_curl "$FRAMEWORKS_URL/Quincy.framework.zip" > Quincy.framework.zip + +echo 'Downloading Sparkle...' +polite_curl "$FRAMEWORKS_URL/Sparkle.framework.zip" > Sparkle.framework.zip + +unzip Quincy.framework.zip +unzip Sparkle.framework.zip