rake_embedded 0.1.4 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +4 -1
  3. data/rake_embedded/version.rb +1 -1
  4. data/rem_core.rb +21 -24
  5. data/scripts/build_functions/gcc/compile.rb +43 -0
  6. data/scripts/build_functions/gcc/default.rb +23 -0
  7. data/scripts/build_functions/gcc/image.rb +34 -0
  8. data/scripts/build_functions/gcc/link.rb +46 -0
  9. data/scripts/build_functions/sdcc/default.rb +23 -0
  10. data/scripts/build_functions/sdcc/image.rb +34 -0
  11. data/scripts/build_functions/sdcc/link.rb +41 -0
  12. data/scripts/download_tasks/download.rb +47 -0
  13. data/scripts/package.rb +53 -64
  14. data/scripts/patch_tasks/{DefaultTasks.rb → patch.rb} +9 -11
  15. data/scripts/prepare_tasks/prepare.rb +80 -0
  16. data/scripts/recipe_handling/recipes.rb +13 -17
  17. data/scripts/remfile_functions/remfile_gen.rb +20 -6
  18. data/shell_scripts/check_deps.sh +18 -14
  19. data/shell_scripts/comment_unused_functions_cppcheck.sh +17 -14
  20. data/shell_scripts/find_func_and_comment.sh +17 -14
  21. data/tests/docker/dockerfile_debian_8.dockertest +3 -2
  22. data/tests/docker/dockerfile_debian_9.dockertest +3 -2
  23. data/tests/docker/dockerfile_ubuntu_14_04.dockertest +3 -2
  24. data/tests/docker/dockerfile_ubuntu_16_04.dockertest +3 -2
  25. data/tests/run_all_rem_tests.sh +17 -0
  26. data/tests/run_docker_test.sh +17 -0
  27. data/tests/run_docker_tests.sh +17 -0
  28. data/tests/tests/TEST_append_features.sh +25 -0
  29. data/tests/tests/TEST_build_test_project.sh +22 -1
  30. data/tests/tests/TEST_check_deps_test_project.sh +17 -0
  31. data/tests/tests/TEST_global_deps.sh +17 -0
  32. data/tests/tests/TEST_remfile.sh +39 -0
  33. data/tests/tests/TEST_remove_unused_functions.sh +18 -1
  34. metadata +13 -5
  35. data/scripts/download_tasks/DefaultTasks.rb +0 -49
  36. data/scripts/prepare_tasks/DefaultTasks.rb +0 -82
@@ -1,5 +1,22 @@
1
1
  #!/bin/bash
2
2
 
3
+ # Copyright (C) 2018 Franz Flasch <franz.flasch@gmx.at>
4
+
5
+ # This file is part of REM - Rake for EMbedded Systems and Microcontrollers.
6
+
7
+ # REM is free software: you can redistribute it and/or modify
8
+ # it under the terms of the GNU General Public License as published by
9
+ # the Free Software Foundation, either version 3 of the License, or
10
+ # (at your option) any later version.
11
+
12
+ # REM is distributed in the hope that it will be useful,
13
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ # GNU General Public License for more details.
16
+
17
+ # You should have received a copy of the GNU General Public License
18
+ # along with REM. If not, see <http://www.gnu.org/licenses/>.
19
+
3
20
  set -e
4
21
 
5
22
  REM_PATH=$1
@@ -13,5 +30,13 @@ git clone https://github.com/franzflasch/rem_recipe_testing.git
13
30
  rem ARCH=avr MACH=atmega168 PROJECT_FOLDER=rem_packages,rem_recipe_testing/avr_append_test,rem_recipe_testing/common -m -j4 package:test_project:image[hex] VERBOSE=1 && echo OK || exit 5
14
31
  rm -rf rem_workdir
15
32
 
33
+ # Testing the task appending feature
34
+ rem ARCH=arm MACH=stm32f3 PROJECT_FOLDER=rem_packages,rem_recipe_testing/avr_append_task_test/foobar -m -j4 package:foo_task:compile VERBOSE=1 | grep -i "hello from the base recipe" && echo OK || exit 6
35
+ rm -rf rem_workdir
36
+
37
+ # If adding the append recipe it should be possible to use it on avr and also the compile task should have changed
38
+ rem ARCH=avr MACH=atmega168 PROJECT_FOLDER=rem_packages,rem_recipe_testing/avr_append_task_test -m -j4 package:foo_task:compile VERBOSE=1 | grep -i "hello from the append recipe" && echo OK || exit 6
39
+ rm -rf rem_workdir
40
+
16
41
  rm -rf rem_packages
17
42
  rm -rf rem_recipe_testing
@@ -1,5 +1,22 @@
1
1
  #!/bin/bash
2
2
 
3
+ # Copyright (C) 2018 Franz Flasch <franz.flasch@gmx.at>
4
+
5
+ # This file is part of REM - Rake for EMbedded Systems and Microcontrollers.
6
+
7
+ # REM is free software: you can redistribute it and/or modify
8
+ # it under the terms of the GNU General Public License as published by
9
+ # the Free Software Foundation, either version 3 of the License, or
10
+ # (at your option) any later version.
11
+
12
+ # REM is distributed in the hope that it will be useful,
13
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ # GNU General Public License for more details.
16
+
17
+ # You should have received a copy of the GNU General Public License
18
+ # along with REM. If not, see <http://www.gnu.org/licenses/>.
19
+
3
20
  set -e
4
21
 
5
22
  REM_PATH=$1
@@ -11,6 +28,8 @@ git clone https://github.com/franzflasch/rem_packages.git
11
28
  git clone https://github.com/franzflasch/rem_test_project.git
12
29
  git clone https://github.com/franzflasch/rem_libopenpic32.git
13
30
 
31
+ rem ARCH=native MACH=linux PROJECT_FOLDER=rem_packages,rem_test_project -m -j4 package:test_project:link VERBOSE=1 && echo OK || exit 1
32
+ rm -rf rem_workdir
14
33
  rem ARCH=avr MACH=atmega168 PROJECT_FOLDER=rem_packages,rem_test_project -m -j4 package:test_project:image[hex] VERBOSE=1 && echo OK || exit 1
15
34
  rm -rf rem_workdir
16
35
  rem ARCH=arm MACH=stm32f1 PROJECT_FOLDER=rem_packages,rem_test_project -m -j4 package:test_project:image[bin] VERBOSE=1 && echo OK || exit 2
@@ -19,7 +38,9 @@ rem ARCH=arm MACH=stm32f3 PROJECT_FOLDER=rem_packages,rem_test_project -m -j4 pa
19
38
  rm -rf rem_workdir
20
39
  rem ARCH=arm MACH=stm32f4 PROJECT_FOLDER=rem_packages,rem_test_project -m -j4 package:test_project:image[bin] VERBOSE=1 && echo OK || exit 4
21
40
  rm -rf rem_workdir
22
- rem ARCH=8051 MACH=nrf24le1_32 PROJECT_FOLDER=rem_packages,rem_test_project -m -j4 package:test_project:image[bin] VERBOSE=1 && echo OK || exit 5
41
+ rem ARCH=arm MACH=nrf51822 PROJECT_FOLDER=rem_packages,rem_test_project -m -j4 package:test_project:image[bin] VERBOSE=1 && echo OK || exit 4
42
+ rm -rf rem_workdir
43
+ rem ARCH=8051 MACH=nrf24le1_32 PROJECT_FOLDER=rem_packages,rem_test_project -m -j4 package:test_project:link VERBOSE=1 && echo OK || exit 5
23
44
  rm -rf rem_workdir
24
45
  rem ARCH=mips MACH=pic32mx2 PROJECT_FOLDER=rem_test_project,rem_libopenpic32,rem_packages package:test_project:image[srec] VERBOSE=1 && echo OK || exit 5
25
46
  rm -rf rem_workdir
@@ -1,5 +1,22 @@
1
1
  #!/bin/bash
2
2
 
3
+ # Copyright (C) 2018 Franz Flasch <franz.flasch@gmx.at>
4
+
5
+ # This file is part of REM - Rake for EMbedded Systems and Microcontrollers.
6
+
7
+ # REM is free software: you can redistribute it and/or modify
8
+ # it under the terms of the GNU General Public License as published by
9
+ # the Free Software Foundation, either version 3 of the License, or
10
+ # (at your option) any later version.
11
+
12
+ # REM is distributed in the hope that it will be useful,
13
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ # GNU General Public License for more details.
16
+
17
+ # You should have received a copy of the GNU General Public License
18
+ # along with REM. If not, see <http://www.gnu.org/licenses/>.
19
+
3
20
  set -e
4
21
 
5
22
  REM_PATH=$1
@@ -1,5 +1,22 @@
1
1
  #!/bin/bash
2
2
 
3
+ # Copyright (C) 2018 Franz Flasch <franz.flasch@gmx.at>
4
+
5
+ # This file is part of REM - Rake for EMbedded Systems and Microcontrollers.
6
+
7
+ # REM is free software: you can redistribute it and/or modify
8
+ # it under the terms of the GNU General Public License as published by
9
+ # the Free Software Foundation, either version 3 of the License, or
10
+ # (at your option) any later version.
11
+
12
+ # REM is distributed in the hope that it will be useful,
13
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ # GNU General Public License for more details.
16
+
17
+ # You should have received a copy of the GNU General Public License
18
+ # along with REM. If not, see <http://www.gnu.org/licenses/>.
19
+
3
20
  set -e
4
21
 
5
22
  REM_PATH=$1
@@ -0,0 +1,39 @@
1
+ #!/bin/bash
2
+
3
+ # Copyright (C) 2018 Franz Flasch <franz.flasch@gmx.at>
4
+
5
+ # This file is part of REM - Rake for EMbedded Systems and Microcontrollers.
6
+
7
+ # REM is free software: you can redistribute it and/or modify
8
+ # it under the terms of the GNU General Public License as published by
9
+ # the Free Software Foundation, either version 3 of the License, or
10
+ # (at your option) any later version.
11
+
12
+ # REM is distributed in the hope that it will be useful,
13
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ # GNU General Public License for more details.
16
+
17
+ # You should have received a copy of the GNU General Public License
18
+ # along with REM. If not, see <http://www.gnu.org/licenses/>.
19
+
20
+ set -e
21
+
22
+ REM_PATH=$1
23
+
24
+ echo REMPATH $REM_PATH
25
+ export PATH=$REM_PATH:$PATH
26
+
27
+ git clone https://github.com/franzflasch/rem_packages.git
28
+ git clone https://github.com/franzflasch/rem_recipe_testing.git
29
+
30
+ # Test remfile generation
31
+ rem ARCH=avr MACH=atmega168 PROJECT_FOLDER=rem_packages,rem_recipe_testing/avr_append_task_test package:foo_task:remfile_generate -m -j4 VERBOSE=1 && echo OK || exit 1
32
+
33
+ cat rem_workdir/avr_atmega168/build/pkgs.rem_file | grep rem_recipe_testing/avr_append_task_test/foobar/foo_task.rem && echo OK || exit 2
34
+ cat rem_workdir/avr_atmega168/build/pkgs.rem_file | grep rem_recipe_testing/avr_append_task_test/append/foo_task.remappend && echo OK || exit 3
35
+
36
+ rm -rf rem_workdir
37
+
38
+ rm -rf rem_packages
39
+ rm -rf rem_recipe_testing
@@ -1,5 +1,22 @@
1
1
  #!/bin/bash
2
2
 
3
+ # Copyright (C) 2018 Franz Flasch <franz.flasch@gmx.at>
4
+
5
+ # This file is part of REM - Rake for EMbedded Systems and Microcontrollers.
6
+
7
+ # REM is free software: you can redistribute it and/or modify
8
+ # it under the terms of the GNU General Public License as published by
9
+ # the Free Software Foundation, either version 3 of the License, or
10
+ # (at your option) any later version.
11
+
12
+ # REM is distributed in the hope that it will be useful,
13
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ # GNU General Public License for more details.
16
+
17
+ # You should have received a copy of the GNU General Public License
18
+ # along with REM. If not, see <http://www.gnu.org/licenses/>.
19
+
3
20
  set -e
4
21
 
5
22
  REM_PATH=$1
@@ -11,7 +28,7 @@ export PATH=$REM_PATH/shell_scripts:$PATH
11
28
  git clone https://github.com/franzflasch/rem_packages.git
12
29
  git clone https://github.com/franzflasch/rem_test_project.git
13
30
 
14
- rem ARCH=8051 MACH=nrf24le1_32 PROJECT_FOLDER=rem_packages,rem_test_project -m -j4 package:test_project:image[bin] VERBOSE=1 && echo OK || exit 1
31
+ rem ARCH=8051 MACH=nrf24le1_32 PROJECT_FOLDER=rem_packages,rem_test_project -m -j4 package:test_project:link VERBOSE=1 && echo OK || exit 1
15
32
  comment_unused_functions_cppcheck.sh rem_workdir/8051_nrf24le1_32/build "rem_workdir/8051_nrf24le1_32/build/nrf24le1_sdk_nohash/" && echo OK || exit 2
16
33
  rm -rf rem_workdir
17
34
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rake_embedded
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Franz Flasch
8
8
  autorequire:
9
9
  bindir: "."
10
10
  cert_chain: []
11
- date: 2017-12-29 00:00:00.000000000 Z
11
+ date: 2018-04-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -74,10 +74,17 @@ files:
74
74
  - rem.png
75
75
  - rem_core.rb
76
76
  - rem_path.rb
77
+ - scripts/build_functions/gcc/compile.rb
78
+ - scripts/build_functions/gcc/default.rb
79
+ - scripts/build_functions/gcc/image.rb
80
+ - scripts/build_functions/gcc/link.rb
77
81
  - scripts/build_functions/package_build_functions.rb
82
+ - scripts/build_functions/sdcc/default.rb
83
+ - scripts/build_functions/sdcc/image.rb
84
+ - scripts/build_functions/sdcc/link.rb
78
85
  - scripts/dependency_functions/dependency_graph.rb
79
86
  - scripts/dependency_functions/dependency_tasks.rb
80
- - scripts/download_tasks/DefaultTasks.rb
87
+ - scripts/download_tasks/download.rb
81
88
  - scripts/global_config/config_helper/check_env.rb
82
89
  - scripts/global_config/config_helper/config.rb
83
90
  - scripts/global_config/global_config.rb
@@ -85,8 +92,8 @@ files:
85
92
  - scripts/misc/helper_string_parse.rb
86
93
  - scripts/misc/print_functions.rb
87
94
  - scripts/package.rb
88
- - scripts/patch_tasks/DefaultTasks.rb
89
- - scripts/prepare_tasks/DefaultTasks.rb
95
+ - scripts/patch_tasks/patch.rb
96
+ - scripts/prepare_tasks/prepare.rb
90
97
  - scripts/recipe_handling/recipes.rb
91
98
  - scripts/remfile_functions/remfile_gen.rb
92
99
  - shell_scripts/check_deps.sh
@@ -103,6 +110,7 @@ files:
103
110
  - tests/tests/TEST_build_test_project.sh
104
111
  - tests/tests/TEST_check_deps_test_project.sh
105
112
  - tests/tests/TEST_global_deps.sh
113
+ - tests/tests/TEST_remfile.sh
106
114
  - tests/tests/TEST_remove_unused_functions.sh
107
115
  homepage: https://github.com/franzflasch/REM
108
116
  licenses:
@@ -1,49 +0,0 @@
1
- =begin
2
-
3
- Copyright (C) 2015 Franz Flasch <franz.flasch@gmx.at>
4
-
5
- This file is part of REM - Rake for EMbedded Systems and Microcontrollers.
6
-
7
- REM is free software: you can redistribute it and/or modify
8
- it under the terms of the GNU General Public License as published by
9
- the Free Software Foundation, either version 3 of the License, or
10
- (at your option) any later version.
11
-
12
- REM is distributed in the hope that it will be useful,
13
- but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
- GNU General Public License for more details.
16
-
17
- You should have received a copy of the GNU General Public License
18
- along with REM. If not, see <http://www.gnu.org/licenses/>.
19
- =end
20
-
21
- module DefaultDownload
22
- module DownloadPackage
23
-
24
- private
25
-
26
- def download_compressed_file
27
- #execute "wget -c #{uri[0].uri} -P #{pkg_dl_dir}"
28
- FileUtils.mkdir_p("#{pkg_dl_dir}")
29
- execute "curl -o #{pkg_dl_dir}/#{get_filename_from_uri(uri[0].uri)} -LOk #{uri[0].uri}"
30
- end
31
-
32
- def do_download_clean
33
- FileUtils.rm_rf("#{pkg_dl_dir}")
34
- end
35
-
36
- def do_download
37
- case uri[0].uri_type
38
- when "zip"
39
- print_debug "Zip package"
40
- download_compressed_file()
41
- when "gz"
42
- print_debug "GZ package"
43
- download_compressed_file()
44
- else
45
- print_debug('No zip package, falling through...')
46
- end
47
- end
48
- end
49
- end
@@ -1,82 +0,0 @@
1
- =begin
2
-
3
- Copyright (C) 2015 Franz Flasch <franz.flasch@gmx.at>
4
-
5
- This file is part of REM - Rake for EMbedded Systems and Microcontrollers.
6
-
7
- REM is free software: you can redistribute it and/or modify
8
- it under the terms of the GNU General Public License as published by
9
- the Free Software Foundation, either version 3 of the License, or
10
- (at your option) any later version.
11
-
12
- REM is distributed in the hope that it will be useful,
13
- but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
- GNU General Public License for more details.
16
-
17
- You should have received a copy of the GNU General Public License
18
- along with REM. If not, see <http://www.gnu.org/licenses/>.
19
- =end
20
-
21
- module DefaultPrepare
22
- module PreparePackageBuildDir
23
-
24
- private
25
-
26
- def prepare_copy
27
- base_dir.each do |dir|
28
- FileUtils.cp_r("#{dir}/.", pkg_build_dir, {:remove_destination => true, :verbose => false})
29
- end
30
- end
31
-
32
- def prepare_clone_git
33
- execute "git clone #{uri[0].uri} #{pkg_build_dir}"
34
- if(uri[0].uri_src_rev != "undefined")
35
- execute "git --git-dir=#{pkg_build_dir}/.git --work-tree=#{pkg_build_dir} checkout #{uri[0].uri_src_rev}"
36
- end
37
- end
38
-
39
- def prepare_checkout_svn
40
- execute "svn co --non-interactive --trust-server-cert #{uri[0].uri} #{pkg_build_dir}"
41
- if(uri[0].uri_src_rev != "undefined")
42
- # TODO: add possibilty to checkout specific revision
43
- end
44
- end
45
-
46
- def prepare_zip
47
- execute "unzip -qq #{pkg_dl_dir}/#{get_filename_from_uri(uri[0].uri)} -d #{pkg_build_dir}"
48
- end
49
-
50
- def prepare_gz
51
- FileUtils.mkdir_p("#{pkg_build_dir}")
52
- execute "tar -xvf #{pkg_dl_dir}/#{get_filename_from_uri(uri[0].uri)} -C #{pkg_build_dir}"
53
- end
54
-
55
- def do_prepare_clean
56
- FileUtils.rm_rf(pkg_build_dir)
57
- end
58
-
59
- def do_prepare_builddir
60
- case uri[0].uri_type
61
- when "local"
62
- print_debug "LOCAL package"
63
- when "zip"
64
- print_debug "ZIP package"
65
- prepare_zip()
66
- when "gz"
67
- print_debug "GZ package"
68
- prepare_gz();
69
- when "git"
70
- print_debug "GIT repo"
71
- prepare_clone_git()
72
- when "svn"
73
- print_debug "SVN repo"
74
- prepare_checkout_svn()
75
- else
76
- print_abort('No valid URI type!')
77
- end
78
- # files need to be copied in every case:
79
- prepare_copy()
80
- end
81
- end
82
- end