roku_builder 3.13.0 → 4.0.0
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.
- checksums.yaml +4 -4
- data/.travis.yml +1 -1
- data/CHANGELOG +12 -0
- data/Gemfile.lock +22 -7
- data/Guardfile +3 -3
- data/README.md +22 -398
- data/bin/roku +1 -194
- data/config.json.example +1 -1
- data/intergration/roku_builder/test_core.rb +52 -0
- data/intergration/roku_builder/test_files/core_intergration_test/manifest_template +7 -0
- data/intergration/roku_builder/test_files/core_intergration_test/test.pkg +0 -0
- data/intergration/roku_builder/test_files/inspector_intergration_test/components/rectanglescene.xml +28 -0
- data/intergration/roku_builder/test_files/inspector_intergration_test/images/rde_mm_focus_hd.jpg +0 -0
- data/intergration/roku_builder/test_files/inspector_intergration_test/images/rde_mm_focus_sd.jpg +0 -0
- data/intergration/roku_builder/test_files/inspector_intergration_test/images/rde_splash_fhd.jpg +0 -0
- data/intergration/roku_builder/test_files/inspector_intergration_test/images/rde_splash_hd.jpg +0 -0
- data/intergration/roku_builder/test_files/inspector_intergration_test/images/rde_splash_sd.jpg +0 -0
- data/intergration/roku_builder/test_files/inspector_intergration_test/images/rsgde_bg_hd.jpg +0 -0
- data/intergration/roku_builder/test_files/inspector_intergration_test/images/rsgde_mm_focus_hd.jpg +0 -0
- data/intergration/roku_builder/test_files/inspector_intergration_test/images/rsgde_splash_hd.jpg +0 -0
- data/intergration/roku_builder/test_files/inspector_intergration_test/manifest +21 -0
- data/intergration/roku_builder/test_files/inspector_intergration_test/source/main.brs +23 -0
- data/intergration/roku_builder/test_files/inspector_intergration_test/test.pkg +0 -0
- data/intergration/roku_builder/test_files/linker_intergration_test/components/rectanglescene.xml +29 -0
- data/intergration/roku_builder/test_files/linker_intergration_test/images/rde_mm_focus_hd.jpg +0 -0
- data/intergration/roku_builder/test_files/linker_intergration_test/images/rde_mm_focus_sd.jpg +0 -0
- data/intergration/roku_builder/test_files/linker_intergration_test/images/rde_splash_fhd.jpg +0 -0
- data/intergration/roku_builder/test_files/linker_intergration_test/images/rde_splash_hd.jpg +0 -0
- data/intergration/roku_builder/test_files/linker_intergration_test/images/rde_splash_sd.jpg +0 -0
- data/intergration/roku_builder/test_files/linker_intergration_test/images/rsgde_bg_hd.jpg +0 -0
- data/intergration/roku_builder/test_files/linker_intergration_test/images/rsgde_mm_focus_hd.jpg +0 -0
- data/intergration/roku_builder/test_files/linker_intergration_test/images/rsgde_splash_hd.jpg +0 -0
- data/intergration/roku_builder/test_files/linker_intergration_test/manifest +21 -0
- data/intergration/roku_builder/test_files/linker_intergration_test/source/main.brs +21 -0
- data/intergration/roku_builder/test_files/linker_intergration_test/test.pkg +0 -0
- data/intergration/roku_builder/test_files/loader_intergration_test/components/rectanglescene.xml +29 -0
- data/intergration/roku_builder/test_files/loader_intergration_test/images/rde_mm_focus_hd.jpg +0 -0
- data/intergration/roku_builder/test_files/loader_intergration_test/images/rde_mm_focus_sd.jpg +0 -0
- data/intergration/roku_builder/test_files/loader_intergration_test/images/rde_splash_fhd.jpg +0 -0
- data/intergration/roku_builder/test_files/loader_intergration_test/images/rde_splash_hd.jpg +0 -0
- data/intergration/roku_builder/test_files/loader_intergration_test/images/rde_splash_sd.jpg +0 -0
- data/intergration/roku_builder/test_files/loader_intergration_test/images/rsgde_bg_hd.jpg +0 -0
- data/intergration/roku_builder/test_files/loader_intergration_test/images/rsgde_mm_focus_hd.jpg +0 -0
- data/intergration/roku_builder/test_files/loader_intergration_test/images/rsgde_splash_hd.jpg +0 -0
- data/intergration/roku_builder/test_files/loader_intergration_test/manifest +21 -0
- data/intergration/roku_builder/test_files/loader_intergration_test/source/main.brs +21 -0
- data/intergration/roku_builder/test_files/loader_intergration_test/test.pkg +0 -0
- data/intergration/roku_builder/test_files/monitor_intergration_test/components/rectanglescene.xml +29 -0
- data/intergration/roku_builder/test_files/monitor_intergration_test/images/rde_mm_focus_hd.jpg +0 -0
- data/intergration/roku_builder/test_files/monitor_intergration_test/images/rde_mm_focus_sd.jpg +0 -0
- data/intergration/roku_builder/test_files/monitor_intergration_test/images/rde_splash_fhd.jpg +0 -0
- data/intergration/roku_builder/test_files/monitor_intergration_test/images/rde_splash_hd.jpg +0 -0
- data/intergration/roku_builder/test_files/monitor_intergration_test/images/rde_splash_sd.jpg +0 -0
- data/intergration/roku_builder/test_files/monitor_intergration_test/images/rsgde_bg_hd.jpg +0 -0
- data/intergration/roku_builder/test_files/monitor_intergration_test/images/rsgde_mm_focus_hd.jpg +0 -0
- data/intergration/roku_builder/test_files/monitor_intergration_test/images/rsgde_splash_hd.jpg +0 -0
- data/intergration/roku_builder/test_files/monitor_intergration_test/manifest +21 -0
- data/intergration/roku_builder/test_files/monitor_intergration_test/source/main.brs +21 -0
- data/intergration/roku_builder/test_files/monitor_intergration_test/test.pkg +0 -0
- data/intergration/roku_builder/test_files/navigator_intergration_test/components/rectanglescene.xml +29 -0
- data/intergration/roku_builder/test_files/navigator_intergration_test/images/rde_mm_focus_hd.jpg +0 -0
- data/intergration/roku_builder/test_files/navigator_intergration_test/images/rde_mm_focus_sd.jpg +0 -0
- data/intergration/roku_builder/test_files/navigator_intergration_test/images/rde_splash_fhd.jpg +0 -0
- data/intergration/roku_builder/test_files/navigator_intergration_test/images/rde_splash_hd.jpg +0 -0
- data/intergration/roku_builder/test_files/navigator_intergration_test/images/rde_splash_sd.jpg +0 -0
- data/intergration/roku_builder/test_files/navigator_intergration_test/images/rsgde_bg_hd.jpg +0 -0
- data/intergration/roku_builder/test_files/navigator_intergration_test/images/rsgde_mm_focus_hd.jpg +0 -0
- data/intergration/roku_builder/test_files/navigator_intergration_test/images/rsgde_splash_hd.jpg +0 -0
- data/intergration/roku_builder/test_files/navigator_intergration_test/manifest +21 -0
- data/intergration/roku_builder/test_files/navigator_intergration_test/source/main.brs +21 -0
- data/intergration/roku_builder/test_files/navigator_intergration_test/test.pkg +0 -0
- data/intergration/roku_builder/test_files/packager_intergration_test/components/rectanglescene.xml +29 -0
- data/intergration/roku_builder/test_files/packager_intergration_test/images/rde_mm_focus_hd.jpg +0 -0
- data/intergration/roku_builder/test_files/packager_intergration_test/images/rde_mm_focus_sd.jpg +0 -0
- data/intergration/roku_builder/test_files/packager_intergration_test/images/rde_splash_fhd.jpg +0 -0
- data/intergration/roku_builder/test_files/packager_intergration_test/images/rde_splash_hd.jpg +0 -0
- data/intergration/roku_builder/test_files/packager_intergration_test/images/rde_splash_sd.jpg +0 -0
- data/intergration/roku_builder/test_files/packager_intergration_test/images/rsgde_bg_hd.jpg +0 -0
- data/intergration/roku_builder/test_files/packager_intergration_test/images/rsgde_mm_focus_hd.jpg +0 -0
- data/intergration/roku_builder/test_files/packager_intergration_test/images/rsgde_splash_hd.jpg +0 -0
- data/intergration/roku_builder/test_files/packager_intergration_test/manifest +21 -0
- data/intergration/roku_builder/test_files/packager_intergration_test/source/main.brs +21 -0
- data/intergration/roku_builder/test_files/packager_intergration_test/test.pkg +0 -0
- data/intergration/roku_builder/test_files/profiler_intergration_test/components/rectanglescene.xml +29 -0
- data/intergration/roku_builder/test_files/profiler_intergration_test/images/rde_mm_focus_hd.jpg +0 -0
- data/intergration/roku_builder/test_files/profiler_intergration_test/images/rde_mm_focus_sd.jpg +0 -0
- data/intergration/roku_builder/test_files/profiler_intergration_test/images/rde_splash_fhd.jpg +0 -0
- data/intergration/roku_builder/test_files/profiler_intergration_test/images/rde_splash_hd.jpg +0 -0
- data/intergration/roku_builder/test_files/profiler_intergration_test/images/rde_splash_sd.jpg +0 -0
- data/intergration/roku_builder/test_files/profiler_intergration_test/images/rsgde_bg_hd.jpg +0 -0
- data/intergration/roku_builder/test_files/profiler_intergration_test/images/rsgde_mm_focus_hd.jpg +0 -0
- data/intergration/roku_builder/test_files/profiler_intergration_test/images/rsgde_splash_hd.jpg +0 -0
- data/intergration/roku_builder/test_files/profiler_intergration_test/manifest +21 -0
- data/intergration/roku_builder/test_files/profiler_intergration_test/source/main.brs +21 -0
- data/intergration/roku_builder/test_files/profiler_intergration_test/test.pkg +0 -0
- data/intergration/roku_builder/test_files/scripter_intergration_test/components/rectanglescene.xml +29 -0
- data/intergration/roku_builder/test_files/scripter_intergration_test/images/rde_mm_focus_hd.jpg +0 -0
- data/intergration/roku_builder/test_files/scripter_intergration_test/images/rde_mm_focus_sd.jpg +0 -0
- data/intergration/roku_builder/test_files/scripter_intergration_test/images/rde_splash_fhd.jpg +0 -0
- data/intergration/roku_builder/test_files/scripter_intergration_test/images/rde_splash_hd.jpg +0 -0
- data/intergration/roku_builder/test_files/scripter_intergration_test/images/rde_splash_sd.jpg +0 -0
- data/intergration/roku_builder/test_files/scripter_intergration_test/images/rsgde_bg_hd.jpg +0 -0
- data/intergration/roku_builder/test_files/scripter_intergration_test/images/rsgde_mm_focus_hd.jpg +0 -0
- data/intergration/roku_builder/test_files/scripter_intergration_test/images/rsgde_splash_hd.jpg +0 -0
- data/intergration/roku_builder/test_files/scripter_intergration_test/manifest +21 -0
- data/intergration/roku_builder/test_files/scripter_intergration_test/source/main.brs +21 -0
- data/intergration/roku_builder/test_files/scripter_intergration_test/test.pkg +0 -0
- data/intergration/roku_builder/test_files/tester_intergration_test/components/rectanglescene.xml +29 -0
- data/intergration/roku_builder/test_files/tester_intergration_test/images/rde_mm_focus_hd.jpg +0 -0
- data/intergration/roku_builder/test_files/tester_intergration_test/images/rde_mm_focus_sd.jpg +0 -0
- data/intergration/roku_builder/test_files/tester_intergration_test/images/rde_splash_fhd.jpg +0 -0
- data/intergration/roku_builder/test_files/tester_intergration_test/images/rde_splash_hd.jpg +0 -0
- data/intergration/roku_builder/test_files/tester_intergration_test/images/rde_splash_sd.jpg +0 -0
- data/intergration/roku_builder/test_files/tester_intergration_test/images/rsgde_bg_hd.jpg +0 -0
- data/intergration/roku_builder/test_files/tester_intergration_test/images/rsgde_mm_focus_hd.jpg +0 -0
- data/intergration/roku_builder/test_files/tester_intergration_test/images/rsgde_splash_hd.jpg +0 -0
- data/intergration/roku_builder/test_files/tester_intergration_test/manifest +21 -0
- data/intergration/roku_builder/test_files/tester_intergration_test/source/main.brs +21 -0
- data/intergration/roku_builder/test_files/tester_intergration_test/test.pkg +0 -0
- data/intergration/roku_builder/test_helper.rb +138 -0
- data/intergration/roku_builder/test_inspector.rb +35 -0
- data/intergration/roku_builder/test_linker.rb +32 -0
- data/intergration/roku_builder/test_loader.rb +38 -0
- data/intergration/roku_builder/test_monitor.rb +21 -0
- data/intergration/roku_builder/test_navigator.rb +34 -0
- data/intergration/roku_builder/test_packager.rb +41 -0
- data/intergration/roku_builder/test_profiler.rb +48 -0
- data/intergration/roku_builder/test_scripter.rb +38 -0
- data/intergration/roku_builder/test_tester.rb +21 -0
- data/lib/roku_builder.rb +143 -154
- data/lib/roku_builder/config.rb +17 -40
- data/lib/roku_builder/config_parser.rb +49 -200
- data/lib/roku_builder/config_validator.rb +1 -1
- data/lib/roku_builder/errors.rb +12 -0
- data/lib/roku_builder/git.rb +28 -0
- data/lib/roku_builder/hash.rb +8 -0
- data/lib/roku_builder/manifest.rb +121 -0
- data/lib/roku_builder/options.rb +68 -29
- data/lib/roku_builder/plugin.rb +30 -0
- data/lib/roku_builder/plugins/core.rb +117 -0
- data/lib/roku_builder/plugins/inspector.rb +104 -0
- data/lib/roku_builder/{linker.rb → plugins/linker.rb} +38 -12
- data/lib/roku_builder/plugins/loader.rb +152 -0
- data/lib/roku_builder/{monitor.rb → plugins/monitor.rb} +20 -9
- data/lib/roku_builder/{navigator.rb → plugins/navigator.rb} +136 -88
- data/lib/roku_builder/plugins/packager.rb +194 -0
- data/lib/roku_builder/plugins/profiler.rb +135 -0
- data/lib/roku_builder/plugins/scripter.rb +53 -0
- data/lib/roku_builder/{tester.rb → plugins/tester.rb} +28 -19
- data/lib/roku_builder/stager.rb +48 -12
- data/lib/roku_builder/string.rb +20 -0
- data/lib/roku_builder/util.rb +10 -34
- data/lib/roku_builder/version.rb +1 -1
- data/rakefile +5 -1
- data/roku_builder.gemspec +2 -0
- data/test/roku_builder/plugins/test_core.rb +112 -0
- data/test/roku_builder/plugins/test_inspector.rb +165 -0
- data/test/roku_builder/plugins/test_linker.rb +123 -0
- data/test/roku_builder/plugins/test_loader.rb +115 -0
- data/test/roku_builder/plugins/test_monitor.rb +141 -0
- data/test/roku_builder/plugins/test_navigator.rb +274 -0
- data/test/roku_builder/plugins/test_packager.rb +202 -0
- data/test/roku_builder/plugins/test_profiler.rb +127 -0
- data/test/roku_builder/plugins/test_scripter.rb +110 -0
- data/test/roku_builder/plugins/test_tester.rb +109 -0
- data/test/roku_builder/test_config.rb +51 -35
- data/test/roku_builder/test_config_parser.rb +76 -154
- data/test/roku_builder/test_config_validator.rb +18 -1
- data/test/roku_builder/test_files/{loader_test/manifest → config_parser_test/test.pkg} +0 -0
- data/test/roku_builder/test_files/config_test/config.json +3 -0
- data/test/roku_builder/test_files/controller_commands_test/manifest_template +7 -0
- data/test/roku_builder/test_files/core_test/manifest_template +7 -0
- data/test/roku_builder/test_files/core_test/test.pkg +0 -0
- data/test/roku_builder/test_files/inspector_test/manifest +6 -0
- data/test/roku_builder/test_files/inspector_test/test.pkg +0 -0
- data/test/roku_builder/test_files/linker_test/manifest +6 -0
- data/test/roku_builder/test_files/linker_test/test.pkg +0 -0
- data/test/roku_builder/test_files/loader_test/manifest_template +6 -0
- data/test/roku_builder/test_files/loader_test/test.pkg +0 -0
- data/test/roku_builder/test_files/loader_test/test.zip +0 -0
- data/test/roku_builder/test_files/manifest_test/manifest_comments +6 -0
- data/test/roku_builder/test_files/manifest_test/manifest_template +7 -0
- data/test/roku_builder/test_files/manifest_test/test.zip +0 -0
- data/test/roku_builder/test_files/packager_test/manifest +6 -0
- data/test/roku_builder/test_files/packager_test/scripter_test/manifest +6 -0
- data/test/roku_builder/test_files/packager_test/test.pkg +0 -0
- data/test/roku_builder/test_files/roku_builder_test/config.json +32 -0
- data/test/roku_builder/test_files/scripter_test/manifest +6 -0
- data/test/roku_builder/test_files/scripter_test/test.pkg +0 -0
- data/test/roku_builder/test_files/stager_test/test.pkg +0 -0
- data/test/roku_builder/test_files/tester_test/manifest +6 -0
- data/test/roku_builder/test_files/tester_test/test.pkg +0 -0
- data/test/roku_builder/test_helper.rb +44 -11
- data/test/roku_builder/test_logger.rb +1 -0
- data/test/roku_builder/test_manifest.rb +99 -0
- data/test/roku_builder/test_options.rb +106 -77
- data/test/roku_builder/test_options_plugins.rb +111 -0
- data/test/roku_builder/test_plugin.rb +48 -0
- data/test/roku_builder/test_roku_builder.rb +239 -0
- data/test/roku_builder/test_stager.rb +49 -101
- data/test/roku_builder/test_util.rb +19 -4
- metadata +241 -47
- data/lib/roku_builder/controller.rb +0 -98
- data/lib/roku_builder/controller_commands.rb +0 -224
- data/lib/roku_builder/error_handler.rb +0 -142
- data/lib/roku_builder/inspector.rb +0 -82
- data/lib/roku_builder/keyer.rb +0 -106
- data/lib/roku_builder/loader.rb +0 -131
- data/lib/roku_builder/manifest_manager.rb +0 -126
- data/lib/roku_builder/packager.rb +0 -43
- data/lib/roku_builder/profiler.rb +0 -96
- data/lib/roku_builder/scripter.rb +0 -39
- data/test/roku_builder/test_controller.rb +0 -70
- data/test/roku_builder/test_controller_commands.rb +0 -465
- data/test/roku_builder/test_error_handler.rb +0 -90
- data/test/roku_builder/test_inspector.rb +0 -298
- data/test/roku_builder/test_keyer.rb +0 -176
- data/test/roku_builder/test_linker.rb +0 -110
- data/test/roku_builder/test_loader.rb +0 -337
- data/test/roku_builder/test_manifest_manager.rb +0 -103
- data/test/roku_builder/test_monitor.rb +0 -137
- data/test/roku_builder/test_navigator.rb +0 -280
- data/test/roku_builder/test_packager.rb +0 -127
- data/test/roku_builder/test_profiler.rb +0 -35
- data/test/roku_builder/test_scripter.rb +0 -102
- data/test/roku_builder/test_tester.rb +0 -130
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# ********** Copyright Viacom, Inc. Apache 2.0 **********
|
|
2
|
+
|
|
3
|
+
require_relative "test_helper.rb"
|
|
4
|
+
|
|
5
|
+
module RokuBuilder
|
|
6
|
+
class LoaderIntergrationTest < Minitest::Test
|
|
7
|
+
include Helpers
|
|
8
|
+
def setup
|
|
9
|
+
@config = build_config(LoaderIntergrationTest)
|
|
10
|
+
@uuid = SecureRandom.uuid
|
|
11
|
+
build_uuid_script
|
|
12
|
+
end
|
|
13
|
+
def teardown
|
|
14
|
+
FileUtils.rm(@config) if File.exist?(@config)
|
|
15
|
+
cleanup_uuid_script
|
|
16
|
+
end
|
|
17
|
+
def test_sideload
|
|
18
|
+
output = `#{roku} --sideload --stage production`
|
|
19
|
+
assert_log @uuid
|
|
20
|
+
refute(/WARN: Missing File/.match(output))
|
|
21
|
+
end
|
|
22
|
+
def test_delete
|
|
23
|
+
`#{roku} --sideload --working`
|
|
24
|
+
assert_log @uuid
|
|
25
|
+
`#{roku} --delete`
|
|
26
|
+
output = `#{roku} --app-list`
|
|
27
|
+
refute(/\|\s*dev\s*\|/.match(output))
|
|
28
|
+
end
|
|
29
|
+
def test_build
|
|
30
|
+
target = File.join(testfiles_path(LoaderIntergrationTest), "out.zip")
|
|
31
|
+
FileUtils.rm(target) if File.exist?(target)
|
|
32
|
+
`#{roku} --build --working --out #{target}`
|
|
33
|
+
assert File.exist?(target)
|
|
34
|
+
FileUtils.rm(target) if File.exist?(target)
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# ********** Copyright Viacom, Inc. Apache 2.0 **********
|
|
2
|
+
|
|
3
|
+
require_relative "test_helper.rb"
|
|
4
|
+
|
|
5
|
+
module RokuBuilder
|
|
6
|
+
class MonitorIntergrationTest < Minitest::Test
|
|
7
|
+
include Helpers
|
|
8
|
+
def setup
|
|
9
|
+
@config = build_config(MonitorIntergrationTest)
|
|
10
|
+
@uuid = SecureRandom.uuid
|
|
11
|
+
build_uuid_script
|
|
12
|
+
end
|
|
13
|
+
def teardown
|
|
14
|
+
FileUtils.rm(@config) if File.exist?(@config)
|
|
15
|
+
cleanup_uuid_script
|
|
16
|
+
end
|
|
17
|
+
def test_monitor
|
|
18
|
+
skip("To be implemented later")
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# ********** Copyright Viacom, Inc. Apache 2.0 **********
|
|
2
|
+
|
|
3
|
+
require_relative "test_helper.rb"
|
|
4
|
+
|
|
5
|
+
module RokuBuilder
|
|
6
|
+
class NavigatorIntergrationTest < Minitest::Test
|
|
7
|
+
include Helpers
|
|
8
|
+
def setup
|
|
9
|
+
@config = build_config(NavigatorIntergrationTest)
|
|
10
|
+
@uuid = SecureRandom.uuid
|
|
11
|
+
build_uuid_script
|
|
12
|
+
end
|
|
13
|
+
def teardown
|
|
14
|
+
FileUtils.rm(@config) if File.exist?(@config)
|
|
15
|
+
cleanup_uuid_script
|
|
16
|
+
end
|
|
17
|
+
def test_nav
|
|
18
|
+
skip("To be implemented later")
|
|
19
|
+
end
|
|
20
|
+
def test_navigate
|
|
21
|
+
skip("To be implemented later")
|
|
22
|
+
end
|
|
23
|
+
def test_type
|
|
24
|
+
skip("To be implemented later")
|
|
25
|
+
end
|
|
26
|
+
def test_screen
|
|
27
|
+
skip("To be implemented later")
|
|
28
|
+
end
|
|
29
|
+
def test_screens
|
|
30
|
+
skip("To be implemented later")
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# ********** Copyright Viacom, Inc. Apache 2.0 **********
|
|
2
|
+
|
|
3
|
+
require_relative "test_helper.rb"
|
|
4
|
+
|
|
5
|
+
module RokuBuilder
|
|
6
|
+
class PackagerIntergrationTest < Minitest::Test
|
|
7
|
+
include Helpers
|
|
8
|
+
def setup
|
|
9
|
+
@config = build_config(PackagerIntergrationTest)
|
|
10
|
+
@uuid = SecureRandom.uuid
|
|
11
|
+
build_uuid_script
|
|
12
|
+
end
|
|
13
|
+
def teardown
|
|
14
|
+
FileUtils.rm(@config) if File.exist?(@config)
|
|
15
|
+
cleanup_uuid_script
|
|
16
|
+
end
|
|
17
|
+
def test_package
|
|
18
|
+
target = File.join(testfiles_path(PackagerIntergrationTest), "pkg.pkg")
|
|
19
|
+
FileUtils.rm(target) if File.exist?(target)
|
|
20
|
+
output = `#{roku} --package --stage production --out #{target}`
|
|
21
|
+
refute(/WARN: Missing File/.match(output))
|
|
22
|
+
wait_assert {File.exist?(target)}
|
|
23
|
+
FileUtils.rm(target) if File.exist?(target)
|
|
24
|
+
FileUtils.rm(target+".zip") if File.exist?(target+".zip")
|
|
25
|
+
end
|
|
26
|
+
def test_key
|
|
27
|
+
target = File.join(testfiles_path(PackagerIntergrationTest), "pkg.pkg")
|
|
28
|
+
`#{roku} --genkey --out #{target}`
|
|
29
|
+
output = `#{roku} --key --stage production --debug`
|
|
30
|
+
assert output =~ /-> e8efc6f5efd5b4991be53ccf3e273f04535bfb4c/
|
|
31
|
+
FileUtils.rm(target) if File.exist?(target)
|
|
32
|
+
end
|
|
33
|
+
def test_genkey
|
|
34
|
+
target = File.join(testfiles_path(PackagerIntergrationTest), "pkg.pkg")
|
|
35
|
+
`#{roku} --genkey --out #{target}`
|
|
36
|
+
wait_assert {File.exist?(target)}
|
|
37
|
+
FileUtils.rm(target) if File.exist?(target)
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# ********** Copyright Viacom, Inc. Apache 2.0 **********
|
|
2
|
+
|
|
3
|
+
require_relative "test_helper.rb"
|
|
4
|
+
|
|
5
|
+
module RokuBuilder
|
|
6
|
+
class ProfilerIntergrationTest < Minitest::Test
|
|
7
|
+
include Helpers
|
|
8
|
+
def setup
|
|
9
|
+
@config = build_config(ProfilerIntergrationTest)
|
|
10
|
+
@uuid = SecureRandom.uuid
|
|
11
|
+
build_uuid_script
|
|
12
|
+
end
|
|
13
|
+
def teardown
|
|
14
|
+
FileUtils.rm(@config) if File.exist?(@config)
|
|
15
|
+
cleanup_uuid_script
|
|
16
|
+
end
|
|
17
|
+
def test_profile_stats
|
|
18
|
+
`#{roku} --sideload --working`
|
|
19
|
+
assert_log @uuid
|
|
20
|
+
output = `#{roku} --profile stats`
|
|
21
|
+
assert output =~ /Name \| Count/
|
|
22
|
+
assert output =~ /Total \|\s*5/
|
|
23
|
+
assert output =~ /Default \|\s*1/
|
|
24
|
+
assert output =~ /RectangleExample \|\s*1/
|
|
25
|
+
assert output =~ /Poster \|\s*1/
|
|
26
|
+
assert output =~ /Node \|\s*1/
|
|
27
|
+
assert output =~ /Rectangle \|\s*1/
|
|
28
|
+
end
|
|
29
|
+
def test_profile_all
|
|
30
|
+
`#{roku} --sideload --working`
|
|
31
|
+
assert_log @uuid
|
|
32
|
+
output = `#{roku} --profile all`
|
|
33
|
+
assert output =~ /RectangleExample/
|
|
34
|
+
end
|
|
35
|
+
def test_profile_images
|
|
36
|
+
`#{roku} --sideload --working`
|
|
37
|
+
assert_log @uuid
|
|
38
|
+
output = `#{roku} --profile images`
|
|
39
|
+
assert output =~ /Available memory/
|
|
40
|
+
end
|
|
41
|
+
def test_profile_textures
|
|
42
|
+
`#{roku} --sideload --working`
|
|
43
|
+
assert_log @uuid
|
|
44
|
+
output = `#{roku} --profile textures`
|
|
45
|
+
assert output =~ /System textures/
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
end
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# ********** Copyright Viacom, Inc. Apache 2.0 **********
|
|
2
|
+
|
|
3
|
+
require_relative "test_helper.rb"
|
|
4
|
+
|
|
5
|
+
module RokuBuilder
|
|
6
|
+
class ScripterIntergrationTest < Minitest::Test
|
|
7
|
+
include Helpers
|
|
8
|
+
def setup
|
|
9
|
+
@config = build_config(ScripterIntergrationTest)
|
|
10
|
+
@uuid = SecureRandom.uuid
|
|
11
|
+
build_uuid_script
|
|
12
|
+
end
|
|
13
|
+
def teardown
|
|
14
|
+
FileUtils.rm(@config) if File.exist?(@config)
|
|
15
|
+
cleanup_uuid_script
|
|
16
|
+
end
|
|
17
|
+
def test_print_root_dir
|
|
18
|
+
output = `#{roku} --print root_dir --working`
|
|
19
|
+
assert_equal testfiles_path(ScripterIntergrationTest), output
|
|
20
|
+
end
|
|
21
|
+
def test_print_app_name
|
|
22
|
+
output = `#{roku} --print app_name --working`
|
|
23
|
+
assert_equal "App Name", output
|
|
24
|
+
end
|
|
25
|
+
def test_print_title
|
|
26
|
+
output = `#{roku} --print title --working`
|
|
27
|
+
assert_equal "Rectangle Example", output
|
|
28
|
+
end
|
|
29
|
+
def test_print_build_version
|
|
30
|
+
output = `#{roku} --print build_version --working`
|
|
31
|
+
assert_equal "00000", output
|
|
32
|
+
end
|
|
33
|
+
def test_print_app_version
|
|
34
|
+
output = `#{roku} --print app_version --working`
|
|
35
|
+
assert_equal "1.0", output
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# ********** Copyright Viacom, Inc. Apache 2.0 **********
|
|
2
|
+
|
|
3
|
+
require_relative "test_helper.rb"
|
|
4
|
+
|
|
5
|
+
module RokuBuilder
|
|
6
|
+
class TesterIntergrationTest < Minitest::Test
|
|
7
|
+
include Helpers
|
|
8
|
+
def setup
|
|
9
|
+
@config = build_config(TesterIntergrationTest)
|
|
10
|
+
@uuid = SecureRandom.uuid
|
|
11
|
+
build_uuid_script
|
|
12
|
+
end
|
|
13
|
+
def teardown
|
|
14
|
+
FileUtils.rm(@config) if File.exist?(@config)
|
|
15
|
+
cleanup_uuid_script
|
|
16
|
+
end
|
|
17
|
+
def test_test
|
|
18
|
+
skip("To be implemented later")
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
data/lib/roku_builder.rb
CHANGED
|
@@ -4,194 +4,183 @@ require "logger"
|
|
|
4
4
|
require "faraday"
|
|
5
5
|
require "faraday/digestauth"
|
|
6
6
|
require "pathname"
|
|
7
|
-
|
|
7
|
+
require "rubygems"
|
|
8
|
+
require "optparse"
|
|
9
|
+
require "pathname"
|
|
8
10
|
require "net/ping"
|
|
9
|
-
#loader
|
|
10
|
-
require "net/telnet"
|
|
11
|
-
require "fileutils"
|
|
12
|
-
require "tempfile"
|
|
13
|
-
require "tmpdir"
|
|
14
|
-
require "zip"
|
|
15
|
-
require "git"
|
|
16
11
|
#config_manager
|
|
17
12
|
require 'json'
|
|
18
13
|
#stager
|
|
19
14
|
require 'pstore'
|
|
15
|
+
require "git"
|
|
20
16
|
#profiler
|
|
21
17
|
require 'nokogiri'
|
|
22
18
|
#navigator
|
|
23
19
|
require 'io/console'
|
|
24
20
|
#monitor
|
|
25
21
|
require 'readline'
|
|
22
|
+
#loader
|
|
23
|
+
require "net/telnet"
|
|
24
|
+
require "fileutils"
|
|
25
|
+
require "tempfile"
|
|
26
|
+
require "tmpdir"
|
|
27
|
+
require "zip"
|
|
26
28
|
|
|
27
29
|
|
|
28
|
-
|
|
29
|
-
Dir.glob(File.join(File.dirname(__FILE__), "roku_builder", "*")).each do |path|
|
|
30
|
+
Dir.glob(File.join(File.dirname(__FILE__), "roku_builder", "*.rb")).each do |path|
|
|
30
31
|
file = "roku_builder/"+File.basename(path, ".rb")
|
|
31
|
-
require file
|
|
32
|
+
require file
|
|
32
33
|
end
|
|
33
34
|
|
|
34
35
|
module RokuBuilder
|
|
36
|
+
# Run the builder
|
|
37
|
+
# @param options [Hash] The options hash
|
|
38
|
+
def self.run(options: nil)
|
|
39
|
+
@@options = nil
|
|
40
|
+
setup_plugins
|
|
41
|
+
setup_options(options: options)
|
|
42
|
+
return unless @@options
|
|
43
|
+
initialize_logger
|
|
44
|
+
if @@options[:debug]
|
|
45
|
+
execute
|
|
46
|
+
else
|
|
47
|
+
begin
|
|
48
|
+
execute
|
|
49
|
+
rescue StandardError => e
|
|
50
|
+
Logger.instance.fatal "#{e.class}: #{e.message}"
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
end
|
|
35
54
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
# Too many commands given
|
|
47
|
-
EXTRA_COMMANDS = 1
|
|
48
|
-
|
|
49
|
-
# No commands given
|
|
50
|
-
NO_COMMANDS = 2
|
|
51
|
-
|
|
52
|
-
# Too many source options given
|
|
53
|
-
EXTRA_SOURCES = 3
|
|
54
|
-
|
|
55
|
-
# No source options given
|
|
56
|
-
NO_SOURCE = 4
|
|
57
|
-
|
|
58
|
-
# Incorrect use of current option
|
|
59
|
-
BAD_CURRENT = 5
|
|
60
|
-
|
|
61
|
-
# No deeplink options supplied for deeplink
|
|
62
|
-
# BAD_DEEPLINK = 6
|
|
63
|
-
|
|
64
|
-
# Incorrect use of the in option
|
|
65
|
-
BAD_IN_FILE = 7
|
|
66
|
-
|
|
67
|
-
# An Option is Depricated
|
|
68
|
-
DEPRICATED = 8
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
### Device Codes ###
|
|
73
|
-
|
|
74
|
-
# The default device is offline switched to a secondary device
|
|
75
|
-
CHANGED_DEVICE = -1
|
|
76
|
-
|
|
77
|
-
# Device is online
|
|
78
|
-
GOOD_DEVICE = 0
|
|
79
|
-
|
|
80
|
-
# User defined device was not online
|
|
81
|
-
BAD_DEVICE = 1
|
|
82
|
-
|
|
83
|
-
# No configured devices were online
|
|
84
|
-
NO_DEVICES = 2
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
### Execute Codes ###
|
|
88
|
-
|
|
89
|
-
# Config has deplicated options
|
|
90
|
-
DEPRICATED_CONFIG = -1
|
|
91
|
-
|
|
92
|
-
# Tring to overwrite existing config file
|
|
93
|
-
CONFIG_OVERWRITE = 1
|
|
94
|
-
|
|
95
|
-
# Missing config file
|
|
96
|
-
MISSING_CONFIG = 2
|
|
97
|
-
|
|
98
|
-
# Invalid config file
|
|
99
|
-
INVALID_CONFIG = 3
|
|
100
|
-
|
|
101
|
-
# Missing manifest file
|
|
102
|
-
MISSING_MANIFEST = 4
|
|
103
|
-
|
|
104
|
-
# Unknow device given
|
|
105
|
-
UNKNOWN_DEVICE = 5
|
|
106
|
-
|
|
107
|
-
# Unknown project given
|
|
108
|
-
UNKNOWN_PROJECT = 6
|
|
109
|
-
|
|
110
|
-
# Unknown stage given
|
|
111
|
-
UNKNOWN_STAGE = 7
|
|
112
|
-
|
|
113
|
-
# Missing out folder
|
|
114
|
-
MISSING_OUT_FOLDER = 8
|
|
115
|
-
|
|
116
|
-
# Bad Project Directory
|
|
117
|
-
BAD_PROJECT_DIR = 9
|
|
118
|
-
|
|
119
|
-
# Bad Key File
|
|
120
|
-
BAD_KEY_FILE = 10
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
### Execute Codes ###
|
|
124
|
-
|
|
125
|
-
# Failed to sideload app
|
|
126
|
-
FAILED_SIDELOAD = 8
|
|
127
|
-
|
|
128
|
-
# Failed to sign app
|
|
129
|
-
FAILED_SIGNING = 9
|
|
130
|
-
|
|
131
|
-
# Failed to deeplink to app
|
|
132
|
-
FAILED_DEEPLINKING = 10
|
|
55
|
+
def self.setup_options(options:)
|
|
56
|
+
begin
|
|
57
|
+
@@options = Options.new(options: options)
|
|
58
|
+
@@options.validate
|
|
59
|
+
rescue InvalidOptions => e
|
|
60
|
+
Logger.instance.fatal "#{e.class}: #{e.message}"
|
|
61
|
+
@@options = nil
|
|
62
|
+
return
|
|
63
|
+
end
|
|
64
|
+
end
|
|
133
65
|
|
|
134
|
-
|
|
135
|
-
|
|
66
|
+
def self.execute
|
|
67
|
+
load_config
|
|
68
|
+
check_devices
|
|
69
|
+
execute_command
|
|
70
|
+
end
|
|
136
71
|
|
|
137
|
-
|
|
138
|
-
|
|
72
|
+
def self.plugins
|
|
73
|
+
@@plugins ||= []
|
|
74
|
+
end
|
|
139
75
|
|
|
140
|
-
|
|
141
|
-
|
|
76
|
+
def self.register_plugin(plugin)
|
|
77
|
+
@@plugins ||= []
|
|
78
|
+
@@plugins << plugin
|
|
79
|
+
end
|
|
142
80
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
81
|
+
def self.setup_plugins
|
|
82
|
+
load_plugins
|
|
83
|
+
process_plugins
|
|
84
|
+
end
|
|
146
85
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
word.gsub!(/([a-z\d])([A-Z])/,'\1_\2')
|
|
153
|
-
word.tr!("-", "_")
|
|
154
|
-
word.downcase!
|
|
155
|
-
nil
|
|
86
|
+
def self.load_plugins
|
|
87
|
+
Dir.glob(File.join(File.dirname(__FILE__), "roku_builder", "plugins", "*.rb")).each do |path|
|
|
88
|
+
file = "roku_builder/plugins/"+File.basename(path, ".rb")
|
|
89
|
+
require file
|
|
90
|
+
end
|
|
156
91
|
end
|
|
157
92
|
|
|
158
|
-
def
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
93
|
+
def self.process_plugins
|
|
94
|
+
@@plugins ||= []
|
|
95
|
+
@@plugins.sort! {|a,b| a.to_s <=> b.to_s}
|
|
96
|
+
unless @@plugins.count == @@plugins.uniq.count
|
|
97
|
+
duplicates = @@plugins.select{ |e| @@plugins.count(e) > 1 }.uniq
|
|
98
|
+
raise ImplementationError, "Duplicate plugins: #{duplicates.join(", ")}"
|
|
99
|
+
end
|
|
100
|
+
@@plugins.each do |plugin|
|
|
101
|
+
plugin.dependencies.each do |dependency|
|
|
102
|
+
raise ImplementationError, "Missing dependency: #{dependency}" unless @@plugins.include?(dependency)
|
|
103
|
+
end
|
|
104
|
+
plugin.commands.keys.each do |command|
|
|
105
|
+
raise ImplementationError, "Missing command method '#{command}' in #{plugin}" unless plugin.instance_methods.include?(command)
|
|
106
|
+
end
|
|
107
|
+
end
|
|
162
108
|
end
|
|
163
|
-
end
|
|
164
109
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
110
|
+
def self.initialize_logger
|
|
111
|
+
if @@options[:debug]
|
|
112
|
+
Logger.set_debug
|
|
113
|
+
elsif @@options[:verbose]
|
|
114
|
+
Logger.set_info
|
|
115
|
+
else
|
|
116
|
+
Logger.set_warn
|
|
117
|
+
end
|
|
169
118
|
end
|
|
170
|
-
end
|
|
171
119
|
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
120
|
+
def self.load_config
|
|
121
|
+
@@config = Config.new(options: @@options)
|
|
122
|
+
@@config.configure
|
|
123
|
+
unless @@options[:configure] and not @@options[:edit_params]
|
|
124
|
+
@@config.load
|
|
125
|
+
@@config.validate
|
|
126
|
+
@@config.parse
|
|
176
127
|
end
|
|
177
|
-
|
|
178
|
-
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
def self.check_devices
|
|
131
|
+
if @@options.device_command?
|
|
132
|
+
ping = Net::Ping::External.new
|
|
133
|
+
host = @@config.parsed[:device_config][:ip]
|
|
134
|
+
return if ping.ping? host, 1, 0.2, 1
|
|
135
|
+
raise DeviceError, "Device not online" if @@options[:device_given]
|
|
136
|
+
@@config.raw[:devices].each_pair {|key, value|
|
|
137
|
+
unless key == :default
|
|
138
|
+
host = value[:ip]
|
|
139
|
+
if ping.ping? host, 1, 0.2, 1
|
|
140
|
+
@@config.parsed[:device_config] = value
|
|
141
|
+
Logger.instance.warn("Default device offline, choosing Alternate")
|
|
142
|
+
return
|
|
143
|
+
end
|
|
144
|
+
end
|
|
145
|
+
}
|
|
146
|
+
raise DeviceError, "No devices found"
|
|
179
147
|
end
|
|
180
148
|
end
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
command
|
|
149
|
+
|
|
150
|
+
def self.execute_command
|
|
151
|
+
@@plugins.each do |plugin|
|
|
152
|
+
if plugin.commands.keys.include?(@@options.command)
|
|
153
|
+
stager = nil
|
|
154
|
+
if plugin.commands[@@options.command][:stage]
|
|
155
|
+
stager = Stager.new(config: @@config, options: @@options)
|
|
156
|
+
stager.stage
|
|
157
|
+
end
|
|
158
|
+
instance = plugin.new(config: @@config)
|
|
159
|
+
instance.send(@@options.command, {options: @@options})
|
|
160
|
+
stager.unstage if stager
|
|
187
161
|
end
|
|
188
162
|
end
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
# Parses a string into and options hash
|
|
166
|
+
# @param options [String] string of options in the format "a:b, c:d"
|
|
167
|
+
# @return [Hash] Options hash generated
|
|
168
|
+
def self.options_parse(options:)
|
|
169
|
+
parsed = {}
|
|
170
|
+
opts = options.split(/,\s*/)
|
|
171
|
+
opts.each do |opt|
|
|
172
|
+
opt = opt.split(":")
|
|
173
|
+
key = opt.shift.to_sym
|
|
174
|
+
value = opt.join(":")
|
|
175
|
+
parsed[key] = value
|
|
195
176
|
end
|
|
177
|
+
parsed
|
|
178
|
+
end
|
|
179
|
+
|
|
180
|
+
# Run a system command
|
|
181
|
+
# @param command [String] The command to be run
|
|
182
|
+
# @return [String] The output of the command
|
|
183
|
+
def self.system(command:)
|
|
184
|
+
`#{command}`.chomp
|
|
196
185
|
end
|
|
197
186
|
end
|