Skip to content

Commit

Permalink
Move private_settings.py to root mbed_settings.py. Various updates to…
Browse files Browse the repository at this point in the history
… reflect the path changes
  • Loading branch information
screamerbg committed Jun 9, 2016
1 parent 5e6722d commit 87a978c
Show file tree
Hide file tree
Showing 15 changed files with 32 additions and 32 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ dist
MANIFEST

# Private settings
private_settings.py
mbed_settings.py

# Default Build Directory
.build/
Expand Down
8 changes: 4 additions & 4 deletions docs/BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,9 @@ Workspace tools are set of Python scripts used off-line by Mbed SDK team to:
Before we can run our first test we need to configure our test environment a little!
Now we need to tell workspace tools where our compilers are.

* Please to go ```mbed/tools/``` directory and create empty file called ```private_settings.py```.
* Please to go ```mbed``` directory and create empty file called ```mbed_settings.py```.
```
$ touch private_settings.py
$ touch mbed_settings.py
```
* Populate this file the Python code below:
```python
Expand Down Expand Up @@ -203,10 +203,10 @@ GCC_CR_PATH = "C:/Work/toolchains/LPCXpresso_6.1.4_194/lpcxpresso/tools/bin"
IAR_PATH = "C:/Work/toolchains/iar_6_5/arm"
```

Note: Settings in ```private_settings.py``` will overwrite variables with default values in ```mbed/tools/settings.py``` file.
Note: Settings in ```mbed_settings.py``` will overwrite variables with default values in ```mbed/default_settings.py``` file.

## Build Mbed SDK library from sources
Let's build mbed SDK library off-line from sources using your compiler. We've already cloned mbed SDK sources, we've also installed compilers and added their paths to ```private_settings.py```.
Let's build mbed SDK library off-line from sources using your compiler. We've already cloned mbed SDK sources, we've also installed compilers and added their paths to ```mbed_settings.py```.
We now should be ready to use workspace tools script ```build.py``` to compile and build mbed SDK from sources.

We are still using console. You should be already in ```mbed/tools/``` directory if not go to ```mbed/tools/``` and type below command:
Expand Down
2 changes: 1 addition & 1 deletion docs/TESTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ $ git clone https://github.com/mbedmicro/mbed.git
$ hg clone https://mbed.org/users/rgrover1/code/cpputest/
```

After above three steps you should have proper directory structure. All you need to do now is to configure your ```private_settings.py``` in ```mbed/tools/``` directory. Please refer to mbed SDK build script documentation for details.
After above three steps you should have proper directory structure. All you need to do now is to configure your ```mbed_settings.py``` in ```mbed``` directory. Please refer to mbed SDK build script documentation for details.

## CppUTest with mbed port
To make sure you actualy have CppUTest library with mbed SDK port you can go to CppUTest ```armcc``` platform directory:
Expand Down
16 changes: 8 additions & 8 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@
OWNER_NAMES = 'emilmont, bogdanm'
OWNER_EMAILS = 'Emilio.Monti@arm.com, Bogdan.Marinescu@arm.com'

# If private_settings.py exists in tools, read it in a temporary file
# If mbed_settings.py exists in tools, read it in a temporary file
# so it can be restored later
private_settings = join('tools', 'private_settings.py')
mbed_settings = join('mbed_settings.py')
backup = None
if isfile(private_settings):
if isfile(mbed_settings):
backup = TemporaryFile()
with open(private_settings, "rb") as f:
with open(mbed_settings, "rb") as f:
copyfileobj(f, backup)

# Create the correct private_settings.py for the distribution
with open(private_settings, "wt") as f:
# Create the correct mbed_settings.py for the distribution
with open(mbed_settings, "wt") as f:
f.write("from mbed_settings import *\n")

setup(name='mbed-tools',
Expand All @@ -42,8 +42,8 @@
license=LICENSE,
install_requires=["PrettyTable>=0.7.2", "PySerial>=2.7", "IntelHex>=1.3", "colorama>=0.3.3", "Jinja2>=2.7.3", "project-generator>=0.8.11,<0.9.0", "junit-xml", "requests", "pyYAML"])

# Restore previous private_settings if needed
# Restore previous mbed_settings if needed
if backup:
backup.seek(0)
with open(private_settings, "wb") as f:
with open(mbed_settings, "wb") as f:
copyfileobj(backup, f)
10 changes: 5 additions & 5 deletions tools/buildbot/master.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -286,20 +286,20 @@ from buildbot.config import BuilderConfig

c['builders'] = []

copy_private_settings = ShellCommand(name = "copy private_settings.py",
command = "cp ../private_settings.py tools/private_settings.py",
copy_mbed_settings = ShellCommand(name = "copy mbed_settings.py",
command = "cp ../mbed_settings.py mbed_settings.py",
haltOnFailure = True,
description = "Copy private_settings.py")
description = "Copy mbed_settings.py")

mbed_build_release = BuildFactory()
mbed_build_release.addStep(git_clone)
mbed_build_release.addStep(copy_private_settings)
mbed_build_release.addStep(copy_mbed_settings)

for target_name, toolchains in OFFICIAL_MBED_LIBRARY_BUILD:
builder_name = "All_TC_%s" % target_name
mbed_build = BuildFactory()
mbed_build.addStep(git_clone)
mbed_build.addStep(copy_private_settings)
mbed_build.addStep(copy_mbed_settings)
# Adding all chains for target
for toolchain in toolchains:
build_py = BuildCommand(name = "Build %s using %s" % (target_name, toolchain),
Expand Down
2 changes: 1 addition & 1 deletion tools/host_tests/tcpecho_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import string, random
from time import time

from private_settings import SERVER_ADDRESS
from mbed_settings import SERVER_ADDRESS

ECHO_PORT = 7

Expand Down
2 changes: 1 addition & 1 deletion tools/host_tests/tcpecho_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from SocketServer import BaseRequestHandler, TCPServer
from time import time

from private_settings import LOCALHOST
from mbed_settings import LOCALHOST

MAX_INDEX = 126
MEGA = float(1024 * 1024)
Expand Down
2 changes: 1 addition & 1 deletion tools/host_tests/tcpecho_server_loop.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
ROOT = abspath(join(dirname(__file__), "..", ".."))
sys.path.insert(0, ROOT)

from tools.private_settings import LOCALHOST
from mbed_settings import LOCALHOST
from SocketServer import BaseRequestHandler, TCPServer


Expand Down
2 changes: 1 addition & 1 deletion tools/host_tests/udpecho_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import string, random
from time import time

from private_settings import CLIENT_ADDRESS
from mbed_settings import CLIENT_ADDRESS

ECHO_PORT = 7

Expand Down
2 changes: 1 addition & 1 deletion tools/host_tests/udpecho_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
limitations under the License.
"""
from SocketServer import BaseRequestHandler, UDPServer
from private_settings import SERVER_ADDRESS
from mbed_settings import SERVER_ADDRESS

class UDP_EchoHandler(BaseRequestHandler):
def handle(self):
Expand Down
2 changes: 1 addition & 1 deletion tools/make.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
from tools.options import get_default_options_parser
from tools.build_api import build_project
try:
import tools.private_settings as ps
import mbed_settings as ps
except:
ps = object()

Expand Down
4 changes: 2 additions & 2 deletions tools/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from tools.libraries import LIBRARIES

try:
import tools.private_settings as ps
import mbed_settings as ps
except:
ps = object()

Expand Down Expand Up @@ -132,7 +132,7 @@
args_error(parser, "[ERROR] specify either '-n' or '-p', not both")
if n:
if not n in TEST_MAP.keys():
# Check if there is an alias for this in private_settings.py
# Check if there is an alias for this in mbed_settings.py
if getattr(ps, "test_alias", None) is not None:
alias = ps.test_alias.get(n, "")
if not alias in TEST_MAP.keys():
Expand Down
4 changes: 2 additions & 2 deletions tools/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
ROOT = abspath(join(dirname(__file__), ".."))

# These default settings have two purposes:
# 1) Give a template for writing local "private_settings.py"
# 1) Give a template for writing local "mbed_settings.py"
# 2) Give default initialization fields for the "toolchains.py" constructors

##############################################################################
Expand Down Expand Up @@ -59,7 +59,7 @@
# IAR
IAR_PATH = "C:/Program Files (x86)/IAR Systems/Embedded Workbench 7.3/arm"

# Goanna static analyser. Please overload it in private_settings.py
# Goanna static analyser. Please overload it in mbed_settings.py
GOANNA_PATH = "c:/Program Files (x86)/RedLizards/Goanna Central 3.2.3/bin"

# cppcheck path (command) and output message format
Expand Down
2 changes: 1 addition & 1 deletion tools/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1732,7 +1732,7 @@ def get_default_test_options_parser():
parser.add_option('-M', '--MUTS',
dest='muts_spec_filename',
metavar="FILE",
help='Points to file with MUTs specification (overwrites settings.py and private_settings.py)')
help='Points to file with MUTs specification (overwrites settings.py and mbed_settings.py)')

parser.add_option("-j", "--jobs",
dest='jobs',
Expand Down
4 changes: 2 additions & 2 deletions tools/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -1142,10 +1142,10 @@
GROUPS["rtos"] = [test["id"] for test in TESTS if test["id"].startswith("RTOS_")]
GROUPS["net"] = [test["id"] for test in TESTS if test["id"].startswith("NET_")]
GROUPS["automated"] = [test["id"] for test in TESTS if test.get("automated", False)]
# Look for 'TEST_GROUPS' in private_settings.py and update the GROUPS dictionary
# Look for 'TEST_GROUPS' in mbed_settings.py and update the GROUPS dictionary
# with the information in test_groups if found
try:
from tools.private_settings import TEST_GROUPS
from mbed_settings import TEST_GROUPS
except:
TEST_GROUPS = {}
GROUPS.update(TEST_GROUPS)
Expand Down

0 comments on commit 87a978c

Please sign in to comment.