1
1
// List of targets to compile
2
2
def targets = [
3
- " K64F"
3
+ " K64F" ,
4
+ " NUCLEO_F429ZI" ,
5
+ " UBLOX_EVK_ODIN_W2"
4
6
]
5
7
6
8
// Map toolchains to compilers
@@ -11,23 +13,37 @@ def toolchains = [
11
13
]
12
14
13
15
def configurations = [
14
- " default" ,
15
- " thread"
16
+ " def" : [" ETH" ],
17
+ " thd" : [" ATMEL" , " MCR20" ],
18
+ " 6lp" : [" ATMEL" , " MCR20" ]
16
19
]
17
-
20
+
21
+ def connectiontypes = [
22
+ " ETH" ,
23
+ " ATMEL" ,
24
+ " MCR20"
25
+ ]
26
+
18
27
def stepsForParallel = [:]
19
28
20
29
// Jenkins pipeline does not support map.each, we need to use oldschool for loop
21
30
for (int i = 0 ; i < targets. size(); i++ ) {
22
31
for (int j = 0 ; j < toolchains. size(); j++ ) {
23
32
for (int k = 0 ; k < configurations. size(); k++ ) {
24
- def target = targets. get(i)
25
- def toolchain = toolchains. keySet(). asList(). get(j)
26
- def compilerLabel = toolchains. get(toolchain)
27
- def config = configurations. get(k)
28
-
29
- def stepName = " ${ target} ${ toolchain} ${ config} "
30
- stepsForParallel[stepName] = buildStep(target, compilerLabel, toolchain, config)
33
+ for (int l = 0 ; l < connectiontypes. size(); l++ ) {
34
+
35
+ def target = targets. get(i)
36
+ def toolchain = toolchains. keySet(). asList(). get(j)
37
+ def compilerLabel = toolchains. get(toolchain)
38
+ def config = configurations. keySet(). asList(). get(k)
39
+ def allowed_configs = configurations. get(config)
40
+ def connectiontype = connectiontypes. get(l)
41
+
42
+ def stepName = " ${ target} ${ toolchain} ${ config} ${ connectiontype} "
43
+ if (allowed_configs. contains(connectiontype)) {
44
+ stepsForParallel[stepName] = buildStep(target, compilerLabel, toolchain, config, connectiontype)
45
+ }
46
+ }
31
47
}
32
48
}
33
49
}
@@ -36,30 +52,46 @@ timestamps {
36
52
parallel stepsForParallel
37
53
}
38
54
39
- def buildStep (target , compilerLabel , toolchain , configName ) {
55
+ def buildStep (target , compilerLabel , toolchain , configName , connectiontype ) {
40
56
return {
41
- stage (" ${ target} _${ compilerLabel} _${ configName} " ) {
57
+ stage (" ${ target} _${ compilerLabel} _${ configName} _ ${ connectiontype } " ) {
42
58
node (" ${ compilerLabel} " ) {
43
59
deleteDir()
44
60
dir(" mbed-os-example-client" ) {
45
61
checkout scm
46
62
47
- if (" ${ configName} " == " thread " ) {
48
- // Add IPV6 feature
49
- execute(" sed -i 's/\" CLIENT \" , \" COMMON_PAL\" /\" CLIENT \" , \" IPV6 \" , \" COMMON_PAL\" /' mbed_app.json" )
63
+ if (" ${ configName} " == " thd " ) {
64
+ // Change device type to Thread router
65
+ execute(" sed -i 's/\" NANOSTACK \" , \" LOWPAN_ROUTER \" , \" COMMON_PAL\" /\" NANOSTACK \" , \" THREAD_ROUTER \" , \" COMMON_PAL\" /' mbed_app.json" )
50
66
// Change connection type to thread
51
67
execute (" sed -i 's/\" value\" : \" ETHERNET\" /\" value\" : \" MESH_THREAD\" /' mbed_app.json" )
52
- // Add atmel-rf-driver
53
- execute (" mbed add https://github.com/ARMmbed/atmel-rf-driver" )
54
68
}
55
-
69
+
70
+ if (" ${ configName} " == " 6lp" ) {
71
+ // Change connection type to 6LoWPAN
72
+ execute (" sed -i 's/\" value\" : \" ETHERNET\" /\" value\" : \" MESH_LOWPAN_ND\" /' mbed_app.json" )
73
+
74
+ // Change channel for HW tests
75
+ execute (" sed -i 's/\" mbed-mesh-api.6lowpan-nd-channel\" : 12/\" mbed-mesh-api.6lowpan-nd-channel\" : 18/' mbed_app.json" )
76
+ }
77
+
78
+ if (" ${ connectiontype} " == " MCR20" ) {
79
+ // Replace default rf shield
80
+ execute (" sed -i 's/\" value\" : \" ATMEL\" /\" value\" : \" MCR20\" /' mbed_app.json" )
81
+ }
82
+
56
83
// Copy security.h to build
57
84
mbed. getSecurityFile()
58
85
59
86
execute (" mbed deploy --protocol ssh" )
60
- execute (" mbed compile --build .build/${ target} _${ compilerLabel} _${ configName} / -m ${ target} -t ${ toolchain} -c" )
61
- archive ' **/mbed-os-example-client.bin'
87
+
88
+ dir(" mbed-os" ) {
89
+ execute (" git fetch origin latest" )
90
+ execute (" git checkout FETCH_HEAD" )
91
+ }
92
+ execute (" mbed compile --build out/${ target} _${ toolchain} _${ configName} _${ connectiontype} / -m ${ target} -t ${ toolchain} -c" )
62
93
}
94
+ archive ' **/mbed-os-example-client.bin'
63
95
}
64
96
}
65
97
}
0 commit comments