cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agri...@apache.org
Subject [26/34] git commit: Check in debug keystore. Add build script that uses it.
Date Tue, 06 May 2014 19:29:40 GMT
Check in debug keystore. Add build script that uses it.


Project: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/commit/10c8de14
Tree: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/tree/10c8de14
Diff: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/diff/10c8de14

Branch: refs/heads/master
Commit: 10c8de1416d884cae749a5aaf5fc1608f869b7a4
Parents: 7f0622a
Author: Andrew Grieve <agrieve@chromium.org>
Authored: Fri Mar 21 13:51:37 2014 -0700
Committer: Andrew Grieve <agrieve@chromium.org>
Committed: Fri Mar 21 13:54:45 2014 -0700

----------------------------------------------------------------------
 README.md        | 24 +++++++++++++++--------
 buildharness.sh  | 44 ++++++++++++++++++++++++++++++++++++++++++
 createproject.sh | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++
 makeharness.sh   | 53 ---------------------------------------------------
 4 files changed, 113 insertions(+), 61 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/10c8de14/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
index 6c77ffa..7e11863 100644
--- a/README.md
+++ b/README.md
@@ -9,28 +9,36 @@ from the [cca](https://github.com/MobileChomeApps/mobile-chrome-apps) toolkit.
 ## Use a Pre-built APK
 Pre-built APKs are available [here](https://github.com/MobileChromeApps/harness/releases).
 
-## Building From Source
-Use `makeharness.sh` to create a project. Example invocation:
+## Creating a Project
+Use `createproject.sh` to create a project. Example invocation:
 
-    PLATFORMS="android ios" ./makeharness.sh ../../cordova/cordova-app-harness
+    PLATFORMS="android ios" ./createproject.sh ../../cordova/cordova-app-harness
 
 For more info:
 
-    ./makeharness.sh --help
+    ./createproject.sh --help
 
 ### Extra Steps
 
 - Replace the default Cordova icons with your desired icons.
   - `rm platforms/android/res/drawable-*/icon.png`
   - `cp ../../mobile-chrome-apps/templates/default-app/assets/icons/icon128.png platforms/android/res/drawable/icon.png`
+- Replace the title in index.html to "Chrome ADT vX.X.X"
+  - `vim www/cdvah/index.html`
+
+### Cutting a Release
+
 - Update the version in `config.xml`
   - `vim config.xml`
 - Update versionCode in `platforms/android/AndroidManifest.xml`
   - `vim platforms/android/AndroidManifest.xml`
-- Replace the title in index.html to "Chrome ADT vX.X.X"
-  - `vim www/cdvah/index.html`
-- Build the app in release mode to get a signed APK file.
-  - `cordova build android --release`
+- Tag release
+  - `git tag -am "Tagged vX.X.X-alpha"`
+- Build apk
+  - `cd CCAHarness && ../buildharness.sh`
+- Upload apk to GitHub's releases page
+  - Attach the apk
+  - Write *short* release notes (download link should be visible without scrolling).
 
 ## TODO
 

http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/10c8de14/buildharness.sh
----------------------------------------------------------------------
diff --git a/buildharness.sh b/buildharness.sh
new file mode 100755
index 0000000..4d023ae
--- /dev/null
+++ b/buildharness.sh
@@ -0,0 +1,44 @@
+#!/bin/bash
+
+KEYSTORE_PATH=../CCAHarness-debug.keystore
+APK_PATH=platforms/android/ant-build/*-debug.apk
+AAPT_PATH=$(which aapt)
+
+if [[ -z "$AAPT_PATH" ]]; then
+  ANDROID_PATH=$(which android)
+  if [[ -z "$ANDROID_PATH" ]]; then
+    echo "aapt not found (nor android tool)"
+    exit 1
+  fi
+  BUILD_TOOLS=${ANDROID_PATH%/tools*}/build-tools
+  AAPT_PATH=$(find "$BUILD_TOOLS" -name "aapt" | tail -n1)
+  if [[ -z "$AAPT_PATH" ]]; then
+    echo "aapt not found"
+    exit 1
+  fi
+fi
+
+if [[ ! -e platforms/android ]]; then
+  echo "Please run this with CWD=CCAHarness"
+  exit 1
+fi
+
+if [[ ! -e $KEYSTORE_PATH ]]; then
+  echo "Couldn't find $KEYSTORE_PATH"
+  exit 1
+fi
+
+cordova build android || exit 1
+
+# Remove previous signing artifacts
+"$AAPT_PATH" remove $APK_PATH META-INF/MANIFEST.MF || exit 1
+"$AAPT_PATH" remove $APK_PATH META-INF/CERT.SF
+"$AAPT_PATH" remove $APK_PATH META-INF/CERT.RSA
+
+# Resign.
+jarsigner -verbose -sigalg MD5withRSA -digestalg SHA1 -keystore $KEYSTORE_PATH -storepass
android $APK_PATH androiddebugkey || exit 1
+
+# Verify signing
+jarsigner -verify $APK_PATH || exit 1
+
+echo "Build Complete. APK is at: "$APK_PATH

http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/10c8de14/createproject.sh
----------------------------------------------------------------------
diff --git a/createproject.sh b/createproject.sh
new file mode 100755
index 0000000..83dfb3e
--- /dev/null
+++ b/createproject.sh
@@ -0,0 +1,53 @@
+#!/bin/bash
+
+if [[ $# -eq 0 || "$1" = "--help" ]]; then
+    echo "Usage: makeharness.sh path/to/cordova-app-harness"
+    echo 'Options via variables:'
+    echo '  PLATFORMS="android ios"'
+    echo '  CORDOVA="path/to/cordova"'
+    echo '  PLUGIN_SEARCH_PATH="path1:path2:path3"'
+    echo '  DIR_NAME="path/to/put/new/project" (default is "CCAHarness")'
+    echo '  CCA="path/to/cca"'
+    exit 1
+fi
+
+CCA="${CCA-cca}"
+AH_PATH=$(cd "$1" && pwd)
+H_PATH=$(cd $(dirname "$0") && pwd)
+DIR_NAME=CCAHarness
+
+export APP_ID=org.chromium.eduardo
+export APP_NAME="Chrome AdT"
+"$AH_PATH/createproject.sh" "$DIR_NAME" || exit 1
+
+if [[ -e "$CCA" ]]; then
+    CCA="$(cd $(dirname "$CCA") && pwd)/$(basename "$CCA")"
+fi
+cd "$DIR_NAME"
+
+# Using CCA here to get the right search path.
+echo "Installing Chromium plugins"
+"$CCA" plugin add \
+    org.chromium.bootstrap \
+    org.chromium.navigation \
+    org.chromium.fileSystem \
+    org.chromium.i18n \
+    org.chromium.identity \
+    org.chromium.idle \
+    org.chromium.notifications \
+    org.chromium.power \
+    org.chromium.socket \
+    org.chromium.syncFileSystem \
+    org.chromium.FileChooser \
+    org.chromium.polyfill.blob_constructor \
+    org.chromium.polyfill.CustomEvent \
+    org.chromium.polyfill.xhr_features \
+    org.apache.cordova.network-information \
+    "$H_PATH"/harness-push
+
+
+if [[ $? != 0 ]]; then
+    echo "Plugin installation failed. Probably you need to set PLUGIN_SEARCH_PATH env variable
so that it contains the plugin that failed to install."
+    exit 1
+fi
+

http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/10c8de14/makeharness.sh
----------------------------------------------------------------------
diff --git a/makeharness.sh b/makeharness.sh
deleted file mode 100755
index 8cc1363..0000000
--- a/makeharness.sh
+++ /dev/null
@@ -1,53 +0,0 @@
-#!/bin/bash
-
-if [[ $# -eq 0 || "$1" = "--help" ]]; then
-    echo "Usage: makeharness.sh path/to/cordova-app-harness"
-    echo 'Options via variables:'
-    echo '  PLATFORMS="android ios"'
-    echo '  CORDOVA="path/to/cordova"'
-    echo '  PLUGIN_SEARCH_PATH="path1:path2:path3"'
-    echo '  DIR_NAME="path/to/put/new/project" (default is "CCAHarness")'
-    echo '  CCA="path/to/cca"'
-    exit 1
-fi
-
-CCA="${CCA-cca}"
-AH_PATH=$(cd "$1" && pwd)
-H_PATH=$(cd $(dirname "$0") && pwd)
-DIR_NAME=CCAHarness
-
-export APP_ID=org.chromium.ChromeADT
-export APP_NAME="Chrome ADT"
-"$AH_PATH/createproject.sh" "$DIR_NAME" || exit 1
-
-if [[ -e "$CCA" ]]; then
-    CCA="$(cd $(dirname "$CCA") && pwd)/$(basename "$CCA")"
-fi
-cd "$DIR_NAME"
-
-# Using CCA here to get the right search path.
-echo "Installing Chromium plugins"
-"$CCA" plugin add \
-    org.chromium.bootstrap \
-    org.chromium.navigation \
-    org.chromium.fileSystem \
-    org.chromium.i18n \
-    org.chromium.identity \
-    org.chromium.idle \
-    org.chromium.notifications \
-    org.chromium.power \
-    org.chromium.socket \
-    org.chromium.syncFileSystem \
-    org.chromium.FileChooser \
-    org.chromium.polyfill.blob_constructor \
-    org.chromium.polyfill.CustomEvent \
-    org.chromium.polyfill.xhr_features \
-    org.apache.cordova.network-information \
-    "$H_PATH"/harness-push
-
-
-if [[ $? != 0 ]]; then
-    echo "Plugin installation failed. Probably you need to set PLUGIN_SEARCH_PATH env variable
so that it contains the plugin that failed to install."
-    exit 1
-fi
-


Mime
View raw message