Skip to content

Commit 43e0a34

Browse files
Merge pull request #531 from brianesquilona/dev_features_mbedcli
Added script for release build in Linux (mainly)
2 parents b571618 + 32b7243 commit 43e0a34

File tree

2 files changed

+58
-1
lines changed

2 files changed

+58
-1
lines changed

tools/build_release.sh

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
#!/bin/bash -e
2+
##
3+
## DAPLink Interface Firmware
4+
## Copyright (c) 2009-2016, ARM Limited, All Rights Reserved
5+
## SPDX-License-Identifier: Apache-2.0
6+
##
7+
## Licensed under the Apache License, Version 2.0 (the "License"); you may
8+
## not use this file except in compliance with the License.
9+
## You may obtain a copy of the License at
10+
##
11+
## http://www.apache.org/licenses/LICENSE-2.0
12+
##
13+
## Unless required by applicable law or agreed to in writing, software
14+
## distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
15+
## WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
## See the License for the specific language governing permissions and
17+
## limitations under the License.
18+
##
19+
20+
project_tool=$1
21+
env_folder=${2-env}
22+
requirements_file=${3-requirements.txt}
23+
24+
if [[ "$project_tool" != "mbedcli" && "$project_tool" != "" ]]; then
25+
echo "Only mbedcli is supported in Linux build"
26+
exit 1
27+
else
28+
echo "Compiling in Linux using mbedcli"
29+
fi
30+
31+
if [[ "$ARM_PATH" == "" ]]; then
32+
echo "Need variable ARM_PATH to point to ARMCC directory"
33+
exit 1
34+
else
35+
echo "Using ARMCC in $ARM_PATH"
36+
fi
37+
38+
echo $env_folder
39+
echo $requirements_file
40+
41+
if [ ! -d $env_folder ];then
42+
echo "Generating virtualenv folder $env_folder"
43+
virtualenv $env_folder
44+
else
45+
echo "Using $env_folder"
46+
fi
47+
48+
source $env_folder/bin/activate
49+
pip install -r $requirements_file
50+
mbed deploy
51+
52+
python tools/mbedcli_compile.py --clean --release
53+
if [ $? -ne 0 ]; then
54+
exit $?
55+
fi
56+
python tools/copy_release_files.py --project-tool mbedcli
57+
exit $?

tools/copy_release_files.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def generate_info_files(dir):
7070
# Check are there any local, uncommitted modifications.
7171
try:
7272
check_output("git diff --no-ext-diff --quiet --exit-code", shell=True)
73-
except (CalledProcessError, WindowsError):
73+
except (CalledProcessError, OSError):
7474
git_has_changes = '1'
7575
else:
7676
git_has_changes = '0'

0 commit comments

Comments
 (0)