Move platform scripts into platforms

This commit is contained in:
John Firebaugh
2015-12-16 14:05:23 -08:00
parent a903d2eef0
commit 7a4e7376e1
46 changed files with 40 additions and 40 deletions

View File

@@ -0,0 +1,51 @@
#!/bin/bash
set -e
set -o pipefail
# Inspect binary.
if [[ ${TRAVIS_OS_NAME} == "linux" ]]; then
ldd ./lib/mapbox-gl-native.node
else
otool -L ./lib/mapbox-gl-native.node
fi
COMMIT_MESSAGE=$(git show -s --format=%B $TRAVIS_COMMIT | tr -d '\n')
PACKAGE_JSON_VERSION=$(node -e "console.log(require('./package.json').version)")
if [[ ${TRAVIS_TAG} == node-v${PACKAGE_JSON_VERSION} ]] || test "${COMMIT_MESSAGE#*'[publish binary]'}" != "$COMMIT_MESSAGE"; then
source ~/.nvm/nvm.sh
nvm use $NODE_VERSION
npm install aws-sdk
./node_modules/.bin/node-pre-gyp package
if [[ ${TRAVIS_OS_NAME} == "linux" ]]; then
./node_modules/.bin/node-pre-gyp testpackage
fi
./node_modules/.bin/node-pre-gyp publish info
if [[ ${TRAVIS_OS_NAME} == "linux" ]]; then
source ./platform/linux/scripts/setup.sh
rm -rf build
rm -rf lib
npm install --fallback-to-build=false
npm test
fi
fi
if [[ ${TRAVIS_OS_NAME} == "linux" ]] && [ ! -z "${AWS_ACCESS_KEY_ID}" ] && [ ! -z "${AWS_SECRET_ACCESS_KEY}" ] ; then
# Install and add awscli to PATH for uploading the results
pip install --user awscli
export PATH="`python -m site --user-base`/bin:${PATH}"
REPO_NAME=$(basename $TRAVIS_REPO_SLUG)
gzip --stdout node_modules/mapbox-gl-test-suite/render-tests/index.html | \
aws s3 cp --acl public-read --content-encoding gzip --content-type text/html \
- s3://mapbox/$REPO_NAME/render-tests/$TRAVIS_JOB_NUMBER/index.html
echo http://mapbox.s3.amazonaws.com/$REPO_NAME/render-tests/$TRAVIS_JOB_NUMBER/index.html
fi

View File

@@ -0,0 +1,8 @@
#!/usr/bin/env bash
NAME=$1
shift
CMD=$@
DIR="build/binding.xcodeproj/xcshareddata/xcschemes"
mkdir -p "${DIR}"
sed "s#{{NODE_PATH}}#$(dirname `which node`)#;s#{{BLUEPRINT_IDENTIFIER}}#$(hexdump -n 12 -v -e '/1 "%02X"' /dev/urandom)#;s#{{WORKING_DIRECTORY}}#$(pwd)#;s#{{NODE_ARGUMENT}}#${CMD}#" platform/node/scripts/node.xcscheme > "${DIR}/${NAME}.xcscheme"

View File

@@ -0,0 +1,28 @@
#!/usr/bin/env bash
set -e
set -o pipefail
mapbox_time "checkout_mason" \
git submodule update --init .mason
export PATH="`pwd`/.mason:${PATH}" MASON_DIR="`pwd`/.mason"
if [ ${TRAVIS_OS_NAME} == "linux" ]; then
mapbox_time "install_mesa" \
mason install mesa 10.4.3
fi
if [ ! -d ~/.nvm ]; then
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.28.0/install.sh | bash
fi
source ~/.nvm/nvm.sh
mapbox_time $NODE_VERSION \
nvm install $NODE_VERSION
nvm alias default $NODE_VERSION
node --version
npm --version

View File

@@ -0,0 +1,98 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0700"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "{{BLUEPRINT_IDENTIFIER}}"
BuildableName = "action_after_build"
BlueprintName = "action_after_build"
ReferencedContainer = "container:build/binding.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "YES"
customWorkingDirectory = "{{WORKING_DIRECTORY}}"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<PathRunnable
runnableDebuggingMode = "0"
FilePath = "{{NODE_PATH}}/node">
</PathRunnable>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "{{BLUEPRINT_IDENTIFIER}}"
BuildableName = "action_after_build"
BlueprintName = "action_after_build"
ReferencedContainer = "container:build/binding.xcodeproj">
</BuildableReference>
</MacroExpansion>
<CommandLineArguments>
<CommandLineArgument
argument = "{{NODE_ARGUMENT}}"
isEnabled = "YES">
</CommandLineArgument>
</CommandLineArguments>
<EnvironmentVariables>
<EnvironmentVariable
key = "PATH"
value = "{{NODE_PATH}}:$PATH"
isEnabled = "YES">
</EnvironmentVariable>
</EnvironmentVariables>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "{{BLUEPRINT_IDENTIFIER}}"
BuildableName = "action_after_build"
BlueprintName = "action_after_build"
ReferencedContainer = "container:build/binding.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

31
platform/node/scripts/run.sh Executable file
View File

@@ -0,0 +1,31 @@
#!/usr/bin/env bash
set -e
set -o pipefail
source ./platform/${TRAVIS_OS_NAME}/scripts/setup.sh
BUILDTYPE=${BUILDTYPE:-Release}
################################################################################
# Build
################################################################################
source ~/.nvm/nvm.sh
nvm use $NODE_VERSION
mapbox_time "compile_program" \
npm install --build-from-source
################################################################################
# Test
################################################################################
# Travis OS X has no GPU
if [[ ${TRAVIS_OS_NAME} == "linux" ]]; then
mapbox_time "run_tests" \
npm test
mapbox_time "run_render_tests" \
npm run test-suite
fi