summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Johns <chrisj@rtems.org>2022-09-19 12:14:47 +1000
committerChris Johns <chrisj@rtems.org>2022-09-19 12:14:47 +1000
commitf7817a1be3b93ddf6dcb4b414d005d65eeded6a0 (patch)
tree9ddec45504ee3cb56af19831fc1eae4c5f13a9d9
parent867efbb310f43a3213fd4a31b9007a425ef57bc3 (diff)
wscript: Separate build configs from waf build logic
-rw-r--r--builds.py98
-rw-r--r--wscript88
2 files changed, 110 insertions, 76 deletions
diff --git a/builds.py b/builds.py
new file mode 100644
index 0000000..5f7b22d
--- /dev/null
+++ b/builds.py
@@ -0,0 +1,98 @@
+# SPDX-License-Identifier: BSD-2-Clause
+"""
+RSB Deployment Builds
+"""
+
+#
+# Copyright 2022 Chris Johns (chris@contemporary.software)
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+
+rtems_version_default = 6
+
+configs = {
+ 5: [
+ {
+ 'buildset': '5/project-tools',
+ 'good': True,
+ 'dry-run': False
+ },
+ {
+ 'buildset': '5/project-tools-bsp',
+ 'good': True,
+ 'dry-run': False
+ },
+ ],
+ 6: [
+ {
+ 'buildset': '6/test-aarch64-bsps-bad-opts',
+ 'good': False,
+ 'dry-run': True
+ },
+ {
+ 'buildset': '6/test-aarch64-bsps',
+ 'good': True,
+ 'dry-run': True
+ },
+ {
+ 'buildset': '6/test-aarch64-bsps-opts',
+ 'good': True,
+ 'dry-run': True
+ },
+ {
+ 'buildset': '6/test-aarch64-config',
+ 'good': True,
+ 'dry-run': True
+ },
+ {
+ 'buildset': '6/test-aarch64-powerpc-config',
+ 'good': True,
+ 'dry-run': True
+ },
+ {
+ 'buildset': '6/project-tools',
+ 'good': True,
+ 'dry-run': False
+ },
+ {
+ 'buildset': '6/project-tools-bsp',
+ 'good': True,
+ 'dry-run': False
+ },
+ {
+ 'buildset': '6/project-tools-bsp-config',
+ 'good': True,
+ 'dry-run': False
+ },
+ {
+ 'buildset': '6/project-aarch64-tools-bsp-libbsd',
+ 'good': True,
+ 'dry-run': False
+ },
+ {
+ 'buildset': '6/project-aarch64-tools-bsp-libbsd-config',
+ 'good': True,
+ 'dry-run': False
+ },
+ ],
+}
diff --git a/wscript b/wscript
index 5d61212..e3b88b2 100644
--- a/wscript
+++ b/wscript
@@ -38,80 +38,16 @@ import os
import os.path
import shutil
-out = 'out'
-
-rtems_version_default = 6
-
-builds = {
- 5: [
- {
- 'buildset': '5/project-tools',
- 'good': True,
- 'dry-run': False
- },
- {
- 'buildset': '5/project-tools-bsp',
- 'good': True,
- 'dry-run': False
- },
- ],
- 6: [
- {
- 'buildset': '6/test-aarch64-bsps-bad-opts',
- 'good': False,
- 'dry-run': True
- },
- {
- 'buildset': '6/test-aarch64-bsps',
- 'good': True,
- 'dry-run': True
- },
- {
- 'buildset': '6/test-aarch64-bsps-opts',
- 'good': True,
- 'dry-run': True
- },
- {
- 'buildset': '6/test-aarch64-config',
- 'good': True,
- 'dry-run': True
- },
- {
- 'buildset': '6/test-aarch64-powerpc-config',
- 'good': True,
- 'dry-run': True
- },
- {
- 'buildset': '6/project-tools',
- 'good': True,
- 'dry-run': False
- },
- {
- 'buildset': '6/project-tools-bsp',
- 'good': True,
- 'dry-run': False
- },
- {
- 'buildset': '6/project-tools-bsp-config',
- 'good': True,
- 'dry-run': False
- },
- {
- 'buildset': '6/project-aarch64-tools-bsp-libbsd',
- 'good': True,
- 'dry-run': False
- },
- {
- 'buildset': '6/project-aarch64-tools-bsp-libbsd-config',
- 'good': True,
- 'dry-run': False
- },
- ],
-}
+#
+# Provide a set of builds and the RTEMS version
+#
+import builds
from waflib import Context, Build, Errors, Logs, Scripting, Task, TaskGen, Utils
+out = 'out'
+
class set_builder_task(Task.Task):
always_run = True
semaphore = Task.TaskSemaphore(1)
@@ -211,7 +147,7 @@ def options(opt):
dest='rsb_path',
help='Path to the RTEMS Source Builder (RSB)')
opt.add_option('--rtems-version',
- default=rtems_version_default,
+ default=builds.rtems_version_default,
dest='rtems_version',
help='Version of RTEMS')
opt.add_option('--prefix',
@@ -234,7 +170,7 @@ def configure(conf):
rtems_version = int(conf.options.rtems_version)
except:
conf.fatal('invalid RTEMS version: ' + conf.options.rtems_version)
- if rtems_version not in builds:
+ if rtems_version not in builds.configs:
conf.fatal('unsupported RTEMS version: ' + conf.options.rtems_version)
conf.msg('RTEMS Version', rtems_version, 'GREEN')
rsb_path = os.path.abspath(conf.options.rsb_path)
@@ -258,10 +194,10 @@ def configure(conf):
def build(bld):
dry_runs = [
- build for build in builds[bld.env.RTEMS_VERSION] if build['dry-run']
+ build for build in builds.configs[bld.env.RTEMS_VERSION] if build['dry-run']
]
tars = [
- build for build in builds[bld.env.RTEMS_VERSION]
+ build for build in builds.configs[bld.env.RTEMS_VERSION]
if not build['dry-run']
]
for build in dry_runs:
@@ -294,10 +230,10 @@ def distclean(ctx):
def show(bld):
- for build in builds[bld.env.RTEMS_VERSION]:
+ for build in builds.configs[bld.env.RTEMS_VERSION]:
set_builder_build(bld, build, show=True)
def dry_run(bld):
- for build in builds[bld.env.RTEMS_VERSION]:
+ for build in builds.configs[bld.env.RTEMS_VERSION]:
set_builder_build(bld, build, dry_run=True)