From 99fd0047dec51359a6cb99877b5400a4a36b76bc Mon Sep 17 00:00:00 2001 From: Kenneth Geisshirt Date: Tue, 7 Jun 2022 14:56:03 +0200 Subject: [PATCH] Remove old, unused scripts (#4613) --- CHANGELOG.md | 1 + package-lock.json | 75 +------- package.json | 1 - scripts/download-realm.js | 303 -------------------------------- scripts/find-ios-device.rb | 24 --- scripts/find-ios-runtime.rb | 9 - scripts/test-android.js | 62 ------- scripts/xcode-download-realm.sh | 34 ---- 8 files changed, 7 insertions(+), 502 deletions(-) delete mode 100644 scripts/download-realm.js delete mode 100644 scripts/find-ios-device.rb delete mode 100644 scripts/find-ios-runtime.rb delete mode 100644 scripts/test-android.js delete mode 100755 scripts/xcode-download-realm.sh diff --git a/CHANGELOG.md b/CHANGELOG.md index ac7ca52476..dab8d502ec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -55,6 +55,7 @@ const Person = { * Upgraded Realm Core from v12.0.0 to v12.1.0. * Fix for updated FLX sync error message. ([#4611](https://github.com/realm/realm-js/pull/4611)) * Updated build script to use Xcode 13.1 to match latest Apple App Store compatibility. ([#4605](https://github.com/realm/realm-js/issues/4605)) +* Removed unused scripts `scripts/download-realm.js`, `scripts/find-ios-device.rb`, `scripts/find-ios-runtime.rb`, `scripts/test-android.js` and `scripts/xcode-download-realm.sh`. ([#4402](https://github.com/realm/realm-js/issues/4402)) 10.18.0 Release notes (2022-5-29) ============================================================= diff --git a/package-lock.json b/package-lock.json index 2f4ff30a28..232094baaa 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,7 +17,6 @@ "command-line-args": "^5.1.1", "deepmerge": "2.1.0", "fs-extra": "^4.0.3", - "https-proxy-agent": "^2.2.4", "ini": "^1.3.7", "node-addon-api": "4.2.0", "node-fetch": "^2.6.1", @@ -3606,17 +3605,6 @@ "integrity": "sha1-/ts5T58OAqqXaOcCvaI7UF+ufh8=", "dev": true }, - "node_modules/agent-base": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.3.0.tgz", - "integrity": "sha512-salcGninV0nPrwpGNn4VTXBb1SOuXQBiqbrNXoeizJsHrsL6ERFM2Ne3JUSBWRE6aeNJI2ROP/WEEIDUiDe3cg==", - "dependencies": { - "es6-promisify": "^5.0.0" - }, - "engines": { - "node": ">= 4.0.0" - } - }, "node_modules/agentkeepalive": { "version": "4.1.4", "resolved": "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-4.1.4.tgz", @@ -5119,6 +5107,7 @@ "version": "3.2.7", "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, "dependencies": { "ms": "^2.1.1" } @@ -5541,19 +5530,6 @@ "integrity": "sha1-wsNYJlYkfDnqEHyx5mUrb58kUjw=", "dev": true }, - "node_modules/es6-promise": { - "version": "4.2.8", - "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz", - "integrity": "sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==" - }, - "node_modules/es6-promisify": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz", - "integrity": "sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM=", - "dependencies": { - "es6-promise": "^4.0.3" - } - }, "node_modules/es6-symbol": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.3.tgz", @@ -7392,18 +7368,6 @@ "npm": ">=1.3.7" } }, - "node_modules/https-proxy-agent": { - "version": "2.2.4", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-2.2.4.tgz", - "integrity": "sha512-OmvfoQ53WLjtA9HeYP9RNrWMJzzAz1JGaSFr1nijg0PVR1JaD/xbJq1mdEIIlxGpXp9eSe/O2LgU9DJmTPd0Eg==", - "dependencies": { - "agent-base": "^4.3.0", - "debug": "^3.1.0" - }, - "engines": { - "node": ">= 4.5.0" - } - }, "node_modules/human-signals": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", @@ -9728,7 +9692,8 @@ "node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true }, "node_modules/multimatch": { "version": "5.0.0", @@ -16679,14 +16644,6 @@ "integrity": "sha1-/ts5T58OAqqXaOcCvaI7UF+ufh8=", "dev": true }, - "agent-base": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.3.0.tgz", - "integrity": "sha512-salcGninV0nPrwpGNn4VTXBb1SOuXQBiqbrNXoeizJsHrsL6ERFM2Ne3JUSBWRE6aeNJI2ROP/WEEIDUiDe3cg==", - "requires": { - "es6-promisify": "^5.0.0" - } - }, "agentkeepalive": { "version": "4.1.4", "resolved": "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-4.1.4.tgz", @@ -17878,6 +17835,7 @@ "version": "3.2.7", "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, "requires": { "ms": "^2.1.1" } @@ -18214,19 +18172,6 @@ "integrity": "sha1-wsNYJlYkfDnqEHyx5mUrb58kUjw=", "dev": true }, - "es6-promise": { - "version": "4.2.8", - "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz", - "integrity": "sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==" - }, - "es6-promisify": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz", - "integrity": "sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM=", - "requires": { - "es6-promise": "^4.0.3" - } - }, "es6-symbol": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.3.tgz", @@ -19646,15 +19591,6 @@ "sshpk": "^1.7.0" } }, - "https-proxy-agent": { - "version": "2.2.4", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-2.2.4.tgz", - "integrity": "sha512-OmvfoQ53WLjtA9HeYP9RNrWMJzzAz1JGaSFr1nijg0PVR1JaD/xbJq1mdEIIlxGpXp9eSe/O2LgU9DJmTPd0Eg==", - "requires": { - "agent-base": "^4.3.0", - "debug": "^3.1.0" - } - }, "human-signals": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", @@ -21493,7 +21429,8 @@ "ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true }, "multimatch": { "version": "5.0.0", diff --git a/package.json b/package.json index 7548600d5b..51e6af3e7b 100644 --- a/package.json +++ b/package.json @@ -86,7 +86,6 @@ "command-line-args": "^5.1.1", "deepmerge": "2.1.0", "fs-extra": "^4.0.3", - "https-proxy-agent": "^2.2.4", "ini": "^1.3.7", "node-addon-api": "4.2.0", "node-fetch": "^2.6.1", diff --git a/scripts/download-realm.js b/scripts/download-realm.js deleted file mode 100644 index 61a04984cf..0000000000 --- a/scripts/download-realm.js +++ /dev/null @@ -1,303 +0,0 @@ -//////////////////////////////////////////////////////////////////////////// -// -// Copyright 2016 Realm Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -//////////////////////////////////////////////////////////////////////////// - -const fs = require("fs-extra"); -const path = require("path"); -const os = require("os"); -const fetch = require("node-fetch"); -const HttpsProxyAgent = require("https-proxy-agent"); -const ini = require("ini"); -const tar = require("tar"); -const crypto = require("crypto"); - -const LOCKFILE_NAME = "download-realm.lock"; - -const TEMP_DIR_SUFFIX = generateRandomString(); - -function generateRandomString() { - return crypto.randomBytes(20).toString("hex"); -} - -function ensureDirExists(dir) { - if (!fs.existsSync(dir)) { - fs.mkdirSync(dir); - } -} - -function getTempDir() { - /* - * Each run of this script will have it's own temp directory. - * That way, parallel runs of this script on a same computer won't - * conflict. - * - * It is also possible to overrride this temp directory by setting - * REALM_DOWNLOAD_CORE_TEMP_DIR so, for instance, CI systems will - * be able to clean up files. - */ - return process.env.REALM_DOWNLOAD_CORE_TEMP_DIR || path.join(os.tmpdir(), TEMP_DIR_SUFFIX); -} - -function printProgress(input, totalBytes, archive) { - const ProgressBar = require("progress"); - const StreamCounter = require("stream-counter"); - - const message = `Downloading ${archive} [:bar] (:ratek)`; - const bar = new ProgressBar(message, { - complete: "=", - incomplete: " ", - width: process.stdout.columns - message.length, - total: totalBytes / 1024, - }); - - input.pipe(new StreamCounter()).on("progress", function () { - bar.tick(this.bytes / 1024 - bar.curr); - }); -} - -function copyLocal(archive, destination) { - const archivePath = `${process.env.HOME}/${archive}`; - const exists = fs.existsSync(archivePath); - if (exists) { - console.log(`Skipping download for ${archive}. Local archive available at ${archivePath}`); - fs.copySync(archivePath, destination); - return true; - } - - return false; -} - -function download(serverFolder, archive, destination) { - if (copyLocal(archive, destination)) { - return Promise.resolve(); - } - - const url = `https://static.realm.io/downloads/${serverFolder}/${archive}`; - console.log(`Download url: ${url}`); - const proxyUrl = - process.env.HTTP_PROXY || process.env.http_proxy || process.env.HTTPS_PROXY || process.env.https_proxy; - let agent; - if (proxyUrl) { - const agentOpts = require("url").parse(proxyUrl); - agent = new HttpsProxyAgent(agentOpts); - } - return fetch(url, { agent }).then((response) => { - if (response.status !== 200) { - throw new Error(`Error downloading ${url} - received status ${response.status} ${response.statusText}`); - } - - const lastModified = new Date(response.headers.get("Last-Modified")); - const contentLength = parseInt(response.headers.get("Content-Length"), 10); - return fs - .stat(destination) - .then((stat) => { - if (stat.mtime.getTime() <= lastModified.getTime() || stat.size !== contentLength) { - return saveFile(response); - } - }) - .catch(() => saveFile(response)); - }); - - function saveFile(response) { - if (process.stdout.isTTY) { - printProgress(response.body, parseInt(response.headers.get("Content-Length")), archive); - } else { - console.log(`Downloading ${archive}`); - } - return new Promise((resolve) => { - const file = fs.createWriteStream(destination); - response.body.pipe(file).once("finish", () => file.close(resolve)); - }); - } -} - -function extract(downloadedArchive, targetFolder, archiveRootFolder) { - console.log(`Extracting ${path.basename(downloadedArchive)} => ${targetFolder}`); - if (!archiveRootFolder) { - ensureDirExists(targetFolder); - return tar.extract({ file: downloadedArchive, cwd: targetFolder }); - } else { - const base = path.basename(downloadedArchive).split("."); - const tempExtractLocation = path.resolve(getTempDir(), base.slice(0, base.length - 2).join(".")); - ensureDirExists(tempExtractLocation); - return tar - .extract({ file: downloadedArchive, cwd: tempExtractLocation }) - .then(() => fs.readdir(path.resolve(tempExtractLocation, archiveRootFolder))) - .then((items) => - Promise.all( - items.map((item) => { - const source = path.resolve(tempExtractLocation, archiveRootFolder, item); - const target = path.resolve(targetFolder, item); - return fs.copy(source, target, { filter: (n) => path.extname(n) !== ".so" }); - }), - ), - ) - .then(() => fs.remove(tempExtractLocation)); - } -} - -function acquire(desired, target) { - const corePath = desired.CORE_ARCHIVE && path.resolve(getTempDir(), desired.CORE_ARCHIVE); - const syncPath = desired.SYNC_ARCHIVE && path.resolve(getTempDir(), desired.SYNC_ARCHIVE); - const openSSLPath = desired.OPENSSL && path.resolve(getTempDir(), "openssl.tar.gz"); - - return fs - .emptyDir(target) - .then(() => corePath && download(desired.CORE_SERVER_FOLDER, desired.CORE_ARCHIVE, corePath)) - .then(() => corePath && extract(corePath, target, desired.CORE_ARCHIVE_ROOT)) - .then(() => syncPath && download(desired.SYNC_SERVER_FOLDER, desired.SYNC_ARCHIVE, syncPath)) - .then(() => syncPath && extract(syncPath, target, desired.SYNC_ARCHIVE_ROOT)) - .then( - () => openSSLPath && download(`openssl/${dependencies.OPENSSL_VERSION}/Linux/x86_64`, "openssl.tgz", openSSLPath), - ) - .then(() => openSSLPath && extract(openSSLPath, path.resolve(target, "openssl"), "")) - .then(() => writeLockfile(target, desired)); -} - -function getCoreRequirements(dependencies, options, required = {}) { - required.CORE_SERVER_FOLDER = "core"; - let flavor = options.debug ? "Debug" : "Release"; - - switch (options.platform) { - case "mac": - required.CORE_ARCHIVE = `realm-core-${flavor}-v${dependencies.REALM_CORE_VERSION}-macosx-devel.tar.gz`; - return required; - case "ios": - flavor = flavor === "Debug" ? "MinSizeDebug" : flavor; - required.CORE_ARCHIVE = `realm-core-${flavor}-v${dependencies.REALM_CORE_VERSION}-iphoneos.tar.gz`; - return required; - case "win": { - if (!options.arch) throw new Error("Specifying '--arch' is required for platform 'win'"); - const arch = options.arch === "ia32" ? "Win32" : options.arch; - required.CORE_ARCHIVE = `realm-core-${flavor}-v${dependencies.REALM_CORE_VERSION}-Windows-${arch}-devel.tar.gz`; - return required; - } - case "linux": { - const arch_string = options.arch == "arm" ? "-armhf" : ""; - required.CORE_ARCHIVE = `realm-core-${flavor}-v${dependencies.REALM_CORE_VERSION}-Linux${arch_string}-devel.tar.gz`; - required.OPENSSL = true; - return required; - } - default: - throw new Error(`Unsupported core platform '${options.platform}'`); - } -} - -function getSyncRequirements(dependencies, options, required = {}) { - required.SYNC_SERVER_FOLDER = "sync"; - let flavor = options.debug ? "Debug" : "Release"; - - switch (options.platform) { - case "mac": - required.SYNC_ARCHIVE = `realm-sync-node-cocoa-${dependencies.REALM_SYNC_VERSION}.tar.gz`; - required.SYNC_ARCHIVE_ROOT = `realm-sync-node-cocoa-${dependencies.REALM_SYNC_VERSION}`; - return required; - case "ios": - required.SYNC_ARCHIVE = `realm-sync-cocoa-${dependencies.REALM_SYNC_VERSION}.tar.gz`; - required.SYNC_ARCHIVE_ROOT = "core"; - return required; - case "win": { - const arch = options.arch === "ia32" ? "Win32" : options.arch; - required.SYNC_ARCHIVE = `realm-sync-${flavor}-v${dependencies.REALM_SYNC_VERSION}-Windows-${arch}-devel.tar.gz`; - return getCoreRequirements(dependencies, options, required); - } - case "linux": { - const arch_string = options.arch == "arm" ? "-armhf" : ""; - // flavor is ignored since we only publish Release mode - required.SYNC_ARCHIVE = `realm-sync-Release-v${dependencies.REALM_SYNC_VERSION}-Linux${arch_string}-devel.tar.gz`; - required.OPENSSL = "https://static.realm.io/downloads/openssl/1.1.1b/Linux/x86_64/openssl.tgz"; - return getCoreRequirements(dependencies, options, required); - } - default: - throw new Error(`Unsupported sync platform '${options.platform}'`); - } -} - -function writeLockfile(target, contents) { - return fs.writeFile(path.resolve(target, LOCKFILE_NAME), ini.encode(contents)); -} - -function readLockfile(target) { - try { - return ini.parse(fs.readFileSync(path.resolve(target, LOCKFILE_NAME), "utf8")); - } catch (e) { - return null; - } -} - -function shouldSkipAcquire(target, requirements, force) { - if (force) { - console.log("Skipping lockfile check as --force is enabled"); - return false; - } - - const existingLockfile = readLockfile(target); - - if (!existingLockfile) { - console.log(`No lockfile found at the target ${target}, proceeding.`); - return false; - } - - if (!Object.keys(requirements).every((key) => existingLockfile[key] === requirements[key])) { - console.log(`Target directory ${target} has a differing lockfile, overwriting.`); - return false; - } - - console.log(`Matching lockfile already exists at target ${target} - nothing to do (use --force to override)`); - return true; -} - -const optionDefinitions = [ - { name: "platform", type: String, defaultOption: true }, - { name: "arch", type: String }, - { name: "sync", type: Boolean }, - { name: "debug", type: Boolean }, - { name: "force", type: Boolean }, -]; - -const options = require("command-line-args")(optionDefinitions); -if (options.platform === "..\\win") { - options.platform = "win"; // handle gyp idiocy -} - -const vendorDir = path.resolve(__dirname, "../vendor"); - -let realmDir = path.resolve(vendorDir, `realm-${options.platform}`); -if (options.arch) { - realmDir += `-${options.arch}`; -} -if (options.debug) { - realmDir += "-dbg"; -} - -ensureDirExists(getTempDir()); - -const dependencies = ini.parse(fs.readFileSync(path.resolve(__dirname, "../dependencies.list"), "utf8")); - -const requirements = (options.sync ? getSyncRequirements : getCoreRequirements)(dependencies, options); - -console.log("Resolved requirements:", requirements); -console.log("Resolved options:", options); - -if (!shouldSkipAcquire(realmDir, requirements, options.force)) { - acquire(requirements, realmDir) - .then(() => console.log("Success")) - .catch((error) => { - console.error(error); - process.exit(1); - }); -} diff --git a/scripts/find-ios-device.rb b/scripts/find-ios-device.rb deleted file mode 100644 index cb5a2a511e..0000000000 --- a/scripts/find-ios-device.rb +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/ruby - -require 'json' - -ios_sim_default_device_type = ENV["IOS_SIM_DEVICE_TYPE"] or "iPhone 5s" -ios_sim_default_ios_version = ENV["IOS_SIM_OS"] or "iOS 10.1" -mode = ARGV[0] - -devices = JSON.parse(%x{xcrun simctl list devices --json})['devices'] - .each { |os, group| group.each{ |dev| dev['os'] = os } } - .flat_map { |x| x[1] } -if mode == "booted" then - device = devices.select{|x| x['state'] == 'Booted'} -else - device = devices - .select{ |x| x['availability'] == '(available)' } - .each { |x| x['score'] = (x['name'] == '$ios_sim_default_device_type' ? 1 : 0) + (x['os'] == '$ios_sim_default_ios_version' ? 1 : 0) } - .sort_by! { |x| [x['score'], x['name']] } - .reverse! -end - -if device and device[0] then - puts device[0]['udid'] -end diff --git a/scripts/find-ios-runtime.rb b/scripts/find-ios-runtime.rb deleted file mode 100644 index e2b8cfa1f2..0000000000 --- a/scripts/find-ios-runtime.rb +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/ruby - -require 'json' - -runtime = JSON.parse(%x{xcrun simctl list devices --json})['runtimes'] - .select{|x| (x['identifier'].include? 'com.apple.CoreSimulator.SimRuntime.iOS') && - (x['availability'] == "(available)")}[0]["identifier"] - -puts runtime diff --git a/scripts/test-android.js b/scripts/test-android.js deleted file mode 100644 index db5e2c78c0..0000000000 --- a/scripts/test-android.js +++ /dev/null @@ -1,62 +0,0 @@ -//////////////////////////////////////////////////////////////////////////// -// -// Copyright 2016 Realm Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -//////////////////////////////////////////////////////////////////////////// - -var shell = require("shelljs"); - -shell.set("-e"); - -shell.pushd("./tests/react-test-app"); - -shell.exec("npm install"); - -if (process.platform !== "win32") { - shell.env["PATH"] = "/opt/android-sdk-linux/platform-tools:$PATH"; -} - -shell.exec("npm install realm"); -shell.exec("npm install realm-tests"); - -shell.cp("../../src/object-store/tests/query.json", "node_modules/realm-tests/query-tests.json"); - -shell.echo("Uninstalling old apk"); -shell.exec("adb uninstall io.realm.react.testapp"); - -shell.set("+e"); -shell.echo("Reversing port for physical device"); -shell.exec("adb reverse tcp:8081 tcp:8081"); - -shell.echo("Reversing port for Realm Object Server"); -shell.exec("adb reverse tcp:9080 tcp:9080"); - -shell.set("-e"); - -shell.echo("Building Release APK"); -shell.pushd("android"); -shell.exec("gradlew assembleRelease"); - -shell.echo("Installing APK"); -shell.exec("adb install app/build/outputs/apk/app-release.apk"); - -shell.echo("Starting the Main Activity"); -shell.exec("adb shell am start -n io.realm.react.testapp/.MainActivity"); - -shell.popd(); - -shell.exec('adb shell "logcat -c && logcat | grep -m 1 __REALM_JS_TESTS_COMPLETED__"'); - -shell.exec("adb pull /sdcard/tests.xml"); diff --git a/scripts/xcode-download-realm.sh b/scripts/xcode-download-realm.sh deleted file mode 100755 index 9ea688b8b9..0000000000 --- a/scripts/xcode-download-realm.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash -set -e - -#enable for debugging -# set -x - -SCRIPTS_DIR=$1 -if test -z "$SCRIPTS_DIR" -then - echo "error: This script requires a first argument to be the directory path where download-realm.js is located"; - exit 1; -fi - -export NODE_COMMAND="node" - -if ! which node > /dev/null; then - echo "warning: node is not found in PATH. Looking for nvm in $HOME/.nvm" - [ ! -d "$HOME/.nvm" ] && echo "error: node or nvm not found." && exit 1; - - #do not print nvm output. comment set +x if output is needed for debugging - # set +x - [ -z "$NVM_DIR" ] && export NVM_DIR="$HOME/.nvm" - [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" - export NODE_CURRENT_VERSION=$(nvm current); - echo "warning: nvm found. Using node version: $NODE_CURRENT_VERSION" - # set -x - - #use nvm to invoke the current node - export NODE_COMMAND="nvm run $NODE_CURRENT_VERSION" -fi - -$NODE_COMMAND "${SCRIPTS_DIR}/download-realm.js" ios --sync - -exit 0