roku_builder 4.21.4 → 4.22.3
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/lib/roku_builder.rb +2 -2
- data/lib/roku_builder/config_validator.rb +1 -1
- data/lib/roku_builder/plugins/analyzer.rb +5 -1
- data/lib/roku_builder/plugins/key_template.zip +0 -0
- data/lib/roku_builder/plugins/line_inspector.rb +33 -14
- data/lib/roku_builder/plugins/loader.rb +1 -0
- data/lib/roku_builder/plugins/packager.rb +9 -16
- data/lib/roku_builder/plugins/performance_config.json +1 -1
- data/lib/roku_builder/plugins/sca-cmd/bin/sca-cmd +18 -21
- data/lib/roku_builder/plugins/sca-cmd/bin/sca-cmd.bat +9 -20
- data/lib/roku_builder/plugins/sca-cmd/lib/sca-cmd.jar +0 -0
- data/lib/roku_builder/version.rb +1 -1
- data/test/roku_builder/plugins/test_analyzer.rb +2 -1
- data/test/roku_builder/plugins/test_profiler.rb +2 -1
- data/test/roku_builder/test_options.rb +1 -2
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fe82e43712c05c593d5627cdd0b87140186311e278aeae2c08658c6135451ba3
|
4
|
+
data.tar.gz: 43acac9b51f9ece09cc3c6989a0dae36ab8a5ab2d1ef996b37697c373ee1cdcb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e53e522610ddbc4d54d0d03a7b608e6453f4baba8b5dc0c75ab450c13da02792e597310d9ee057d59b5e0544abad8b829a0ca3b27dae3f4ee4da0676f6faa2aa
|
7
|
+
data.tar.gz: 34629a36e098629e19c4e986c5edf86dc1c432a9ad61b61cc1fa08536ce18092d2d7f271aebf6ac8099eaeb9d10ee895f8839a50cbfc76211e9398664a92309a
|
data/lib/roku_builder.rb
CHANGED
@@ -200,7 +200,7 @@ module RokuBuilder
|
|
200
200
|
stager.stage
|
201
201
|
end
|
202
202
|
instance = plugin.new(config: @@config)
|
203
|
-
instance.send(@@options.command, {options: @@options})
|
203
|
+
instance.send(@@options.command, **{options: @@options})
|
204
204
|
stager.unstage if stager
|
205
205
|
end
|
206
206
|
end
|
@@ -224,7 +224,7 @@ module RokuBuilder
|
|
224
224
|
def self.process_hook(hook:, params:)
|
225
225
|
@@plugins.each do |plugin|
|
226
226
|
if plugin.respond_to?("#{hook}_hook".to_sym)
|
227
|
-
plugin.send("#{hook}_hook", params)
|
227
|
+
plugin.send("#{hook}_hook", **params)
|
228
228
|
end
|
229
229
|
end
|
230
230
|
end
|
@@ -21,6 +21,9 @@ module RokuBuilder
|
|
21
21
|
parser.on("--inclide-libraries", "Include libraries in analyze") do
|
22
22
|
options[:include_libraries] = true
|
23
23
|
end
|
24
|
+
parser.on("--sca-precommand COMMAND", "Include libraries in analyze") do |command|
|
25
|
+
options[:sca_precommand] = command
|
26
|
+
end
|
24
27
|
end
|
25
28
|
|
26
29
|
def self.dependencies
|
@@ -30,6 +33,7 @@ module RokuBuilder
|
|
30
33
|
def analyze(options:, quiet: false)
|
31
34
|
@options = options
|
32
35
|
@warnings = []
|
36
|
+
@sca_warning = {}
|
33
37
|
performance_config = get_config("performance_config.json")
|
34
38
|
linter_config = get_config(".roku_builder_linter.json", true)
|
35
39
|
linter_config ||= {is_ssai: false}
|
@@ -64,7 +68,7 @@ module RokuBuilder
|
|
64
68
|
else
|
65
69
|
command = File.join(File.dirname(__FILE__), "sca-cmd", "bin", "sca-cmd.bat")
|
66
70
|
end
|
67
|
-
results = `#{command} #{path}`.split("\n")
|
71
|
+
results = `#{@options[:sca_precommand]} #{command} #{path}`.split("\n")
|
68
72
|
process_sca_results(results, ssai)
|
69
73
|
end
|
70
74
|
|
Binary file
|
@@ -13,38 +13,57 @@ module RokuBuilder
|
|
13
13
|
File.open(file_path) do |file|
|
14
14
|
in_xml_comment = false
|
15
15
|
indent_inspector = IndentationInspector.new(rules: @indent_config, path: file_path) if @indent_config
|
16
|
+
full_file = []
|
17
|
+
file_no_comments = []
|
18
|
+
lines_to_ignore = []
|
16
19
|
file.readlines.each_with_index do |line, line_number|
|
17
20
|
full_line = line.dup
|
18
|
-
line
|
21
|
+
line.gsub!(/'.*/, "") if file_path.end_with?(".brs")
|
19
22
|
if file_path.end_with?(".xml")
|
20
23
|
if in_xml_comment
|
21
24
|
if line.gsub!(/.*-->/, "")
|
22
25
|
in_xml_comment = false
|
23
26
|
else
|
24
|
-
line = ""
|
27
|
+
line = "\n"
|
25
28
|
end
|
26
29
|
end
|
27
30
|
line.gsub!(/<!--.*-->/, "")
|
28
31
|
in_xml_comment = true if line.gsub!(/<!--.*/, "")
|
29
32
|
end
|
30
33
|
indent_inspector.check_line(line: full_line, number: line_number, comment: in_xml_comment) if indent_inspector
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
+
if /'.*ignore-warning/i.match(full_line)
|
35
|
+
lines_to_ignore.push line_number
|
36
|
+
end
|
37
|
+
full_file.push(full_line)
|
38
|
+
file_no_comments.push(line)
|
39
|
+
end
|
40
|
+
@warnings += indent_inspector.warnings if indent_inspector
|
41
|
+
no_comments = file_no_comments.join("")
|
42
|
+
file = full_file.join("")
|
43
|
+
@inspector_config.each do |line_inspector|
|
44
|
+
unless line_inspector[:disabled]
|
45
|
+
to_check = no_comments
|
46
|
+
to_check = file if line_inspector[:include_comments]
|
34
47
|
match = nil
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
48
|
+
start = 0
|
49
|
+
loop do
|
50
|
+
if line_inspector[:case_sensitive]
|
51
|
+
match = /#{line_inspector[:regex]}/.match(to_check, start)
|
52
|
+
else
|
53
|
+
match = /#{line_inspector[:regex]}/i.match(to_check, start)
|
54
|
+
end
|
55
|
+
if match
|
56
|
+
start = match.end(0)
|
57
|
+
line_number = to_check[0..match.begin(0)].split("\n", -1).count - 1
|
58
|
+
unless lines_to_ignore.include?(line_number)
|
59
|
+
add_warning(inspector: line_inspector, file: file_path, line: line_number, match: match)
|
60
|
+
end
|
61
|
+
else
|
62
|
+
break
|
43
63
|
end
|
44
64
|
end
|
45
65
|
end
|
46
66
|
end
|
47
|
-
@warnings += indent_inspector.warnings if indent_inspector
|
48
67
|
end
|
49
68
|
@warnings
|
50
69
|
end
|
@@ -120,6 +120,7 @@ module RokuBuilder
|
|
120
120
|
def file_path(type)
|
121
121
|
file = @config.send(type)[:file]
|
122
122
|
file ||= Manifest.new(config: @config).build_version
|
123
|
+
file ||= SecureRandom.uuid
|
123
124
|
file = file+".zip" unless file.end_with?(".zip")
|
124
125
|
File.join(@config.send(type)[:folder], file)
|
125
126
|
end
|
@@ -61,22 +61,15 @@ module RokuBuilder
|
|
61
61
|
out[:file] ||= "key_"+dev_id+".pkg"
|
62
62
|
@config.out = out
|
63
63
|
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
end
|
74
|
-
loader = Loader.new(config: config_copy)
|
75
|
-
options[:current] = true
|
76
|
-
loader.sideload(options: options)
|
77
|
-
sign_package(app_name_version: "key_"+dev_id, password: password, stage: options[:stage])
|
78
|
-
@logger.unknown("Keyed PKG: #{File.join(@config.out[:folder], @config.out[:file])}")
|
79
|
-
}
|
64
|
+
config_copy = @config.dup
|
65
|
+
config_copy.root_dir = ""
|
66
|
+
config_copy.in[:folder] = File.dirname(__FILE__)
|
67
|
+
config_copy.in[:file] = "key_template.zip"
|
68
|
+
loader = Loader.new(config: config_copy)
|
69
|
+
options[:in] = true
|
70
|
+
loader.sideload(options: options)
|
71
|
+
sign_package(app_name_version: "key_"+dev_id, password: password, stage: options[:stage])
|
72
|
+
@logger.unknown("Keyed PKG: #{File.join(@config.out[:folder], @config.out[:file])}")
|
80
73
|
end
|
81
74
|
|
82
75
|
# Sets the key on the roku device
|
@@ -10,7 +10,7 @@
|
|
10
10
|
"message": "Found DoesExist check. Try using invalid check on dot reference"
|
11
11
|
},
|
12
12
|
{
|
13
|
-
"regex": "
|
13
|
+
"regex": "\\w+\\[\"[^\"]+\"\\]",
|
14
14
|
"severity": "warning",
|
15
15
|
"message": "Found AA String reference. Try switching to dot reference"
|
16
16
|
},
|
@@ -7,7 +7,7 @@
|
|
7
7
|
# you may not use this file except in compliance with the License.
|
8
8
|
# You may obtain a copy of the License at
|
9
9
|
#
|
10
|
-
#
|
10
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
11
11
|
#
|
12
12
|
# Unless required by applicable law or agreed to in writing, software
|
13
13
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
@@ -80,7 +80,8 @@ case "`uname`" in
|
|
80
80
|
;;
|
81
81
|
esac
|
82
82
|
|
83
|
-
CLASSPATH=$APP_HOME/lib/sca-cmd.jar
|
83
|
+
CLASSPATH=$APP_HOME/lib/sca-cmd.jar:$APP_HOME/lib/sca-library.jar:$APP_HOME/lib/commons-cli-1.4.jar:$APP_HOME/lib/jackson-module-jaxb-annotations-2.12.2.jar:$APP_HOME/lib/jackson-databind-2.12.2.jar:$APP_HOME/lib/jackson-annotations-2.12.2.jar:$APP_HOME/lib/jackson-core-2.12.2.jar:$APP_HOME/lib/jackson-dataformat-xml-2.12.2.jar:$APP_HOME/lib/commons-io-2.8.0.jar:$APP_HOME/lib/commons-lang3-3.12.0.jar:$APP_HOME/lib/commons-compress-1.20.jar:$APP_HOME/lib/woodstox-core-6.2.4.jar:$APP_HOME/lib/stax2-api-4.2.1.jar:$APP_HOME/lib/jakarta.xml.bind-api-2.3.2.jar:$APP_HOME/lib/jakarta.activation-api-1.2.1.jar
|
84
|
+
|
84
85
|
|
85
86
|
# Determine the Java command to use to start the JVM.
|
86
87
|
if [ -n "$JAVA_HOME" ] ; then
|
@@ -125,10 +126,11 @@ if $darwin; then
|
|
125
126
|
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
|
126
127
|
fi
|
127
128
|
|
128
|
-
# For Cygwin, switch paths to Windows format before running java
|
129
|
-
if $cygwin ; then
|
129
|
+
# For Cygwin or MSYS, switch paths to Windows format before running java
|
130
|
+
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
|
130
131
|
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
131
132
|
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
133
|
+
|
132
134
|
JAVACMD=`cygpath --unix "$JAVACMD"`
|
133
135
|
|
134
136
|
# We build the pattern for arguments to be converted via cygpath
|
@@ -154,19 +156,19 @@ if $cygwin ; then
|
|
154
156
|
else
|
155
157
|
eval `echo args$i`="\"$arg\""
|
156
158
|
fi
|
157
|
-
i
|
159
|
+
i=`expr $i + 1`
|
158
160
|
done
|
159
161
|
case $i in
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
162
|
+
0) set -- ;;
|
163
|
+
1) set -- "$args0" ;;
|
164
|
+
2) set -- "$args0" "$args1" ;;
|
165
|
+
3) set -- "$args0" "$args1" "$args2" ;;
|
166
|
+
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
|
167
|
+
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
|
168
|
+
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
|
169
|
+
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
|
170
|
+
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
|
171
|
+
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
|
170
172
|
esac
|
171
173
|
fi
|
172
174
|
|
@@ -175,14 +177,9 @@ save () {
|
|
175
177
|
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
|
176
178
|
echo " "
|
177
179
|
}
|
178
|
-
APP_ARGS
|
180
|
+
APP_ARGS=`save "$@"`
|
179
181
|
|
180
182
|
# Collect all arguments for the java command, following the shell quoting and substitution rules
|
181
183
|
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $SCA_CMD_OPTS -classpath "\"$CLASSPATH\"" com.roku.sca.cmd.CommandLineInterface "$APP_ARGS"
|
182
184
|
|
183
|
-
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
|
184
|
-
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
|
185
|
-
cd "$(dirname "$0")"
|
186
|
-
fi
|
187
|
-
|
188
185
|
exec "$JAVACMD" "$@"
|
@@ -5,7 +5,7 @@
|
|
5
5
|
@rem you may not use this file except in compliance with the License.
|
6
6
|
@rem You may obtain a copy of the License at
|
7
7
|
@rem
|
8
|
-
@rem
|
8
|
+
@rem https://www.apache.org/licenses/LICENSE-2.0
|
9
9
|
@rem
|
10
10
|
@rem Unless required by applicable law or agreed to in writing, software
|
11
11
|
@rem distributed under the License is distributed on an "AS IS" BASIS,
|
@@ -29,6 +29,9 @@ if "%DIRNAME%" == "" set DIRNAME=.
|
|
29
29
|
set APP_BASE_NAME=%~n0
|
30
30
|
set APP_HOME=%DIRNAME%..
|
31
31
|
|
32
|
+
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
|
33
|
+
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
|
34
|
+
|
32
35
|
@rem Add default JVM options here. You can also use JAVA_OPTS and SCA_CMD_OPTS to pass JVM options to this script.
|
33
36
|
set DEFAULT_JVM_OPTS=
|
34
37
|
|
@@ -37,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome
|
|
37
40
|
|
38
41
|
set JAVA_EXE=java.exe
|
39
42
|
%JAVA_EXE% -version >NUL 2>&1
|
40
|
-
if "%ERRORLEVEL%" == "0" goto
|
43
|
+
if "%ERRORLEVEL%" == "0" goto execute
|
41
44
|
|
42
45
|
echo.
|
43
46
|
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
@@ -51,7 +54,7 @@ goto fail
|
|
51
54
|
set JAVA_HOME=%JAVA_HOME:"=%
|
52
55
|
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
53
56
|
|
54
|
-
if exist "%JAVA_EXE%" goto
|
57
|
+
if exist "%JAVA_EXE%" goto execute
|
55
58
|
|
56
59
|
echo.
|
57
60
|
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
@@ -61,28 +64,14 @@ echo location of your Java installation.
|
|
61
64
|
|
62
65
|
goto fail
|
63
66
|
|
64
|
-
:init
|
65
|
-
@rem Get command-line arguments, handling Windows variants
|
66
|
-
|
67
|
-
if not "%OS%" == "Windows_NT" goto win9xME_args
|
68
|
-
|
69
|
-
:win9xME_args
|
70
|
-
@rem Slurp the command line arguments.
|
71
|
-
set CMD_LINE_ARGS=
|
72
|
-
set _SKIP=2
|
73
|
-
|
74
|
-
:win9xME_args_slurp
|
75
|
-
if "x%~1" == "x" goto execute
|
76
|
-
|
77
|
-
set CMD_LINE_ARGS=%*
|
78
|
-
|
79
67
|
:execute
|
80
68
|
@rem Setup the command line
|
81
69
|
|
82
|
-
set CLASSPATH=%APP_HOME%\lib\sca-cmd.jar
|
70
|
+
set CLASSPATH=%APP_HOME%\lib\sca-cmd.jar;%APP_HOME%\lib\sca-library.jar;%APP_HOME%\lib\commons-cli-1.4.jar;%APP_HOME%\lib\jackson-module-jaxb-annotations-2.12.2.jar;%APP_HOME%\lib\jackson-databind-2.12.2.jar;%APP_HOME%\lib\jackson-annotations-2.12.2.jar;%APP_HOME%\lib\jackson-core-2.12.2.jar;%APP_HOME%\lib\jackson-dataformat-xml-2.12.2.jar;%APP_HOME%\lib\commons-io-2.8.0.jar;%APP_HOME%\lib\commons-lang3-3.12.0.jar;%APP_HOME%\lib\commons-compress-1.20.jar;%APP_HOME%\lib\woodstox-core-6.2.4.jar;%APP_HOME%\lib\stax2-api-4.2.1.jar;%APP_HOME%\lib\jakarta.xml.bind-api-2.3.2.jar;%APP_HOME%\lib\jakarta.activation-api-1.2.1.jar
|
71
|
+
|
83
72
|
|
84
73
|
@rem Execute sca-cmd
|
85
|
-
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %SCA_CMD_OPTS% -classpath "%CLASSPATH%" com.roku.sca.cmd.CommandLineInterface
|
74
|
+
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %SCA_CMD_OPTS% -classpath "%CLASSPATH%" com.roku.sca.cmd.CommandLineInterface %*
|
86
75
|
|
87
76
|
:end
|
88
77
|
@rem End local scope for the variables with windows NT shell
|
Binary file
|
data/lib/roku_builder/version.rb
CHANGED
@@ -106,7 +106,7 @@ module RokuBuilder
|
|
106
106
|
warnings = test_file(text: "function test() as String 'IGNORE-WARNING\n? \"test\"\nend function")
|
107
107
|
assert_equal 0, warnings.count
|
108
108
|
end
|
109
|
-
def
|
109
|
+
def test_performance_for_each_loop_title_case
|
110
110
|
warnings = test_file(text: "For each button in buttons\n ? button\nEND FOR")
|
111
111
|
assert_equal 0, warnings.count
|
112
112
|
end
|
@@ -148,6 +148,7 @@ module RokuBuilder
|
|
148
148
|
end
|
149
149
|
|
150
150
|
logger.verify
|
151
|
+
warnings
|
151
152
|
end
|
152
153
|
|
153
154
|
def test(quiet=true)
|
@@ -32,14 +32,13 @@ module RokuBuilder
|
|
32
32
|
end
|
33
33
|
def test_options_parse
|
34
34
|
parser = Minitest::Mock.new()
|
35
|
-
options_hash = {}
|
36
35
|
options = Options.allocate
|
37
36
|
parser.expect(:banner=, nil, [String])
|
38
37
|
parser.expect(:parse!, nil)
|
39
38
|
OptionParser.stub(:new, parser) do
|
40
39
|
options.stub(:add_plugin_options, nil) do
|
41
40
|
options.stub(:validate_parser, nil) do
|
42
|
-
|
41
|
+
options.send(:parse)
|
43
42
|
end
|
44
43
|
end
|
45
44
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: roku_builder
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.22.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- greeneca
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-06-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubyzip
|
@@ -490,6 +490,7 @@ files:
|
|
490
490
|
- lib/roku_builder/plugins/indentation_inspector.rb
|
491
491
|
- lib/roku_builder/plugins/inspector.rb
|
492
492
|
- lib/roku_builder/plugins/inspector_config.json
|
493
|
+
- lib/roku_builder/plugins/key_template.zip
|
493
494
|
- lib/roku_builder/plugins/line_inspector.rb
|
494
495
|
- lib/roku_builder/plugins/linker.rb
|
495
496
|
- lib/roku_builder/plugins/loader.rb
|
@@ -631,7 +632,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
631
632
|
- !ruby/object:Gem::Version
|
632
633
|
version: '0'
|
633
634
|
requirements: []
|
634
|
-
rubygems_version: 3.
|
635
|
+
rubygems_version: 3.0.8
|
635
636
|
signing_key:
|
636
637
|
specification_version: 4
|
637
638
|
summary: Build Tool for Roku Apps
|