roku_builder 4.29.8 → 4.30.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 82d24a2f934584b2ddf6531d7f087aab02a8e6fbb30b95c611a825f9dae45f1d
4
- data.tar.gz: 727d3649d936ff4a0ac96bed9c5b53f0e2b1ecdea043130f8e622a05a3b12868
3
+ metadata.gz: a83d3f8dadf3d591574ab78a796d1493829f5d9e70fd711b38a259489cab9698
4
+ data.tar.gz: fe9726c50b42c16fcaea595af4de34eaae69e6b4475e816a3f325e8b4f40753a
5
5
  SHA512:
6
- metadata.gz: bd3c416558b52d1b852e6e4101cd1a702fbf1de6c3b125b53d429e6d7e365a8453236c4498a16f9b0afc1a1b233b3fac897346736a2359921a820a14a834718f
7
- data.tar.gz: 0ebeaae1a028abfe252177528cdb295ad7a0655959c218d59b8b6f910768f58ef950d0df3be17d7169d57553f18f262e97b2f32d1ebc401fd1a0c447a3c34c19
6
+ metadata.gz: 1b9a7f32a3f82c82baad657d458440084c65943c6a462c8e6a742058082cb67f0538d406cc45d80608023ffe1679a749940aed41824d2a5b5ab4a0f94b0a6f94
7
+ data.tar.gz: b8355e7a6a93b16e45f1e96ca699d22f0f32f9f7cde59a8cde50a1428310ee9b06823a4ef187f4da5c4c81e1a1327a4b823681ef900d9a3b4492daadd51a27ab
@@ -18,11 +18,14 @@ module RokuBuilder
18
18
  options[:analyze] = true
19
19
  end
20
20
  parser.separator "Options:"
21
- parser.on("--inclide-libraries", "Include libraries in analyze") do
21
+ parser.on("--include-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
24
+ parser.on("--include-libraries-sca", "Include libraries in roku Static Code Aanlysis") do
25
+ options[:include_libraries_sca] = true
26
+ end
27
+ parser.on("--skip-sca", "Skip Roku Static Code Analysis") do |command|
28
+ options[:skip_sca] = command
26
29
  end
27
30
  end
28
31
 
@@ -40,10 +43,11 @@ module RokuBuilder
40
43
  loader = Loader.new(config: @config)
41
44
  Dir.mktmpdir do |dir|
42
45
  loader.copy(options: options, path: dir)
43
- run_sca_tool(path: dir, linter_config: linter_config)
46
+ run_sca_tool(path: dir, linter_config: linter_config) unless options[:skip_sca]
44
47
  libraries = @config.project[:libraries]
45
48
  libraries ||= []
46
49
  Dir.glob(File.join(dir, "**", "*")).each do |file_path|
50
+ #byebug if file_path.include?("adTuningChannelComponent.brs")
47
51
  file = file_path.dup; file.slice!(dir)
48
52
  unless libraries.any_is_start?(file) and not @options[:include_libraries]
49
53
  if File.file?(file_path) and file_path.end_with?(".brs", ".xml")
@@ -73,6 +77,7 @@ module RokuBuilder
73
77
  end
74
78
  @logger.debug("Command: '#{command}'")
75
79
  results = `#{command} #{path} 2>#{stderr}`.split("\n")
80
+ @logger.debug("Results: '#{results}'")
76
81
  process_sca_results(results, linter_config)
77
82
  end
78
83
 
@@ -102,7 +107,7 @@ module RokuBuilder
102
107
  end
103
108
  libraries = @config.project[:libraries]
104
109
  libraries ||= []
105
- if @sca_warning[:path] and libraries.any_is_start?(@sca_warning[:path].gsub(/pkg:/, "")) and not @options[:include_libraries]
110
+ if @sca_warning[:path] and libraries.any_is_start?(@sca_warning[:path].gsub(/pkg:/, "")) and not @options[:include_libraries_sca] and not linter_config[:sca_libraries]
106
111
  return false
107
112
  end
108
113
  if linter_config[:ignore_warnings]
@@ -18,7 +18,7 @@ module RokuBuilder
18
18
  lines_to_ignore = []
19
19
  file.readlines.each_with_index do |line, line_number|
20
20
  full_line = line.dup
21
- line.gsub!(/'.*/, "") if file_path.end_with?(".brs")
21
+ line.gsub!(/'[^"]*("[^"]*"[^"\n]*)*$/, "\n") if file_path.end_with?(".brs")
22
22
  if file_path.end_with?(".xml")
23
23
  if in_xml_comment
24
24
  if line.gsub!(/.*-->/, "")
@@ -41,6 +41,7 @@ module RokuBuilder
41
41
  no_comments = file_no_comments.join("")
42
42
  file = full_file.join("")
43
43
  @inspector_config.each do |line_inspector|
44
+ next if line_inspector[:skip_xml] and file_path.end_with?(".xml")
44
45
  unless line_inspector[:disabled]
45
46
  to_check = no_comments
46
47
  to_check = file if line_inspector[:include_comments]
@@ -67,6 +68,7 @@ module RokuBuilder
67
68
  if (not line_inspector[:pass_if_match] and match) or (line_inspector[:pass_if_match] and not match)
68
69
  error_match = match
69
70
  if match
71
+
70
72
  line_number = to_check[0..match.begin(0)+start].split("\n", -1).count - 1
71
73
  start = match.end(0) + start
72
74
  else
@@ -217,7 +217,7 @@ module RokuBuilder
217
217
  def copy_channel_files(content)
218
218
  content[:source_files].each do |entity|
219
219
  begin
220
- FileUtils.copy_entry(File.join(@config.parsed[:root_dir], entity), File.join(@target, entity))
220
+ FileUtils.copy_entry(File.join(build_dir, entity), File.join(@target, entity))
221
221
  rescue Errno::ENOENT
222
222
  @logger.warn "Missing Entry: #{entity}"
223
223
  end
@@ -33,7 +33,7 @@ Example:
33
33
 
34
34
  Available `SEVERITY_LEVEL` values are: `info`, `warning` and `error`:
35
35
 
36
- - `info` - print all of the logs
36
+ - `info` - print all the logs
37
37
  - `warning` - print warnings and errors
38
38
  - `error` - print errors only
39
39
 
@@ -55,7 +55,7 @@
55
55
  # Darwin, MinGW, and NonStop.
56
56
  #
57
57
  # (3) This script is generated from the Groovy template
58
- # https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
58
+ # https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
59
59
  # within the Gradle project.
60
60
  #
61
61
  # You can find Gradle at https://github.com/gradle/gradle/.
@@ -80,13 +80,11 @@ do
80
80
  esac
81
81
  done
82
82
 
83
- APP_HOME=$( cd "${APP_HOME:-./}.." && pwd -P ) || exit
84
-
85
- APP_NAME="sca-cmd"
83
+ # This is normally unused
84
+ # shellcheck disable=SC2034
86
85
  APP_BASE_NAME=${0##*/}
87
-
88
- # Add default JVM options here. You can also use JAVA_OPTS and SCA_CMD_OPTS to pass JVM options to this script.
89
- DEFAULT_JVM_OPTS=""
86
+ # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
87
+ APP_HOME=$( cd "${APP_HOME:-./}.." > /dev/null && pwd -P ) || exit
90
88
 
91
89
  # Use the maximum available, or set MAX_FD != -1 to use that value.
92
90
  MAX_FD=maximum
@@ -114,7 +112,7 @@ case "$( uname )" in #(
114
112
  NONSTOP* ) nonstop=true ;;
115
113
  esac
116
114
 
117
- CLASSPATH=$APP_HOME/lib/sca-cmd.jar:$APP_HOME/lib/sca-library.jar:$APP_HOME/lib/utils-4.0.0.jar:$APP_HOME/lib/configuration-4.0.0.jar:$APP_HOME/lib/compress-4.0.0.jar:$APP_HOME/lib/io-4.0.0.jar:$APP_HOME/lib/imaging-4.0.0.jar:$APP_HOME/lib/manifest-4.0.0.jar:$APP_HOME/lib/commons-cli-1.5.0.jar:$APP_HOME/lib/jackson-databind-2.13.3.jar:$APP_HOME/lib/jackson-core-2.13.3.jar:$APP_HOME/lib/jackson-annotations-2.13.3.jar:$APP_HOME/lib/jackson-dataformat-xml-2.13.3.jar:$APP_HOME/lib/commons-lang3-3.12.0.jar:$APP_HOME/lib/woodstox-core-6.2.7.jar:$APP_HOME/lib/stax2-api-4.2.1.jar:$APP_HOME/lib/commons-compress-1.21.jar:$APP_HOME/lib/commons-io-2.11.0.jar
115
+ CLASSPATH=$APP_HOME/lib/sca-cmd.jar:$APP_HOME/lib/sca-library.jar:$APP_HOME/lib/utils-6.1.0.jar:$APP_HOME/lib/configuration-6.1.0.jar:$APP_HOME/lib/compress-6.2.0.jar:$APP_HOME/lib/imaging-6.1.0.jar:$APP_HOME/lib/manifest-6.2.2.jar:$APP_HOME/lib/io-6.1.0.jar:$APP_HOME/lib/commons-cli-1.8.0.jar:$APP_HOME/lib/java-jwt-4.4.0.jar:$APP_HOME/lib/jackson-databind-2.17.1.jar:$APP_HOME/lib/jackson-core-2.17.1.jar:$APP_HOME/lib/jackson-annotations-2.17.1.jar:$APP_HOME/lib/jackson-dataformat-xml-2.17.1.jar:$APP_HOME/lib/commons-compress-1.26.2.jar:$APP_HOME/lib/commons-codec-1.17.0.jar:$APP_HOME/lib/commons-lang3-3.14.0.jar:$APP_HOME/lib/jelf-0.9.0.jar:$APP_HOME/lib/woodstox-core-6.6.2.jar:$APP_HOME/lib/stax2-api-4.2.2.jar:$APP_HOME/lib/commons-io-2.16.1.jar
118
116
 
119
117
 
120
118
  # Determine the Java command to use to start the JVM.
@@ -133,22 +131,29 @@ location of your Java installation."
133
131
  fi
134
132
  else
135
133
  JAVACMD=java
136
- which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
134
+ if ! command -v java >/dev/null 2>&1
135
+ then
136
+ die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
137
137
 
138
138
  Please set the JAVA_HOME variable in your environment to match the
139
139
  location of your Java installation."
140
+ fi
140
141
  fi
141
142
 
142
143
  # Increase the maximum file descriptors if we can.
143
144
  if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
144
145
  case $MAX_FD in #(
145
146
  max*)
147
+ # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
148
+ # shellcheck disable=SC2039,SC3045
146
149
  MAX_FD=$( ulimit -H -n ) ||
147
150
  warn "Could not query maximum file descriptor limit"
148
151
  esac
149
152
  case $MAX_FD in #(
150
153
  '' | soft) :;; #(
151
154
  *)
155
+ # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
156
+ # shellcheck disable=SC2039,SC3045
152
157
  ulimit -n "$MAX_FD" ||
153
158
  warn "Could not set maximum file descriptor limit to $MAX_FD"
154
159
  esac
@@ -193,17 +198,27 @@ if "$cygwin" || "$msys" ; then
193
198
  done
194
199
  fi
195
200
 
196
- # Collect all arguments for the java command;
197
- # * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $SCA_CMD_OPTS can contain fragments of
198
- # shell script including quotes and variable substitutions, so put them in
199
- # double quotes to make sure that they get re-expanded; and
200
- # * put everything else in single quotes, so that it's not re-expanded.
201
+
202
+ # Add default JVM options here. You can also use JAVA_OPTS and SCA_CMD_OPTS to pass JVM options to this script.
203
+ DEFAULT_JVM_OPTS=""
204
+
205
+ # Collect all arguments for the java command:
206
+ # * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
207
+ # and any embedded shellness will be escaped.
208
+ # * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
209
+ # treated as '${Hostname}' itself on the command line.
201
210
 
202
211
  set -- \
203
212
  -classpath "$CLASSPATH" \
204
213
  com.roku.sca.cmd.CommandLineInterface \
205
214
  "$@"
206
215
 
216
+ # Stop when "xargs" is not available.
217
+ if ! command -v xargs >/dev/null 2>&1
218
+ then
219
+ die "xargs is not available"
220
+ fi
221
+
207
222
  # Use "xargs" to parse quoted args.
208
223
  #
209
224
  # With -n1 it outputs one arg per line, with the quotes and backslashes removed.
@@ -14,7 +14,7 @@
14
14
  @rem limitations under the License.
15
15
  @rem
16
16
 
17
- @if "%DEBUG%" == "" @echo off
17
+ @if "%DEBUG%"=="" @echo off
18
18
  @rem ##########################################################################
19
19
  @rem
20
20
  @rem sca-cmd startup script for Windows
@@ -25,7 +25,8 @@
25
25
  if "%OS%"=="Windows_NT" setlocal
26
26
 
27
27
  set DIRNAME=%~dp0
28
- if "%DIRNAME%" == "" set DIRNAME=.
28
+ if "%DIRNAME%"=="" set DIRNAME=.
29
+ @rem This is normally unused
29
30
  set APP_BASE_NAME=%~n0
30
31
  set APP_HOME=%DIRNAME%..
31
32
 
@@ -40,13 +41,13 @@ if defined JAVA_HOME goto findJavaFromJavaHome
40
41
 
41
42
  set JAVA_EXE=java.exe
42
43
  %JAVA_EXE% -version >NUL 2>&1
43
- if "%ERRORLEVEL%" == "0" goto execute
44
+ if %ERRORLEVEL% equ 0 goto execute
44
45
 
45
- echo.
46
- echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
47
- echo.
48
- echo Please set the JAVA_HOME variable in your environment to match the
49
- echo location of your Java installation.
46
+ echo. 1>&2
47
+ echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
48
+ echo. 1>&2
49
+ echo Please set the JAVA_HOME variable in your environment to match the 1>&2
50
+ echo location of your Java installation. 1>&2
50
51
 
51
52
  goto fail
52
53
 
@@ -56,18 +57,18 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe
56
57
 
57
58
  if exist "%JAVA_EXE%" goto execute
58
59
 
59
- echo.
60
- echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
61
- echo.
62
- echo Please set the JAVA_HOME variable in your environment to match the
63
- echo location of your Java installation.
60
+ echo. 1>&2
61
+ echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
62
+ echo. 1>&2
63
+ echo Please set the JAVA_HOME variable in your environment to match the 1>&2
64
+ echo location of your Java installation. 1>&2
64
65
 
65
66
  goto fail
66
67
 
67
68
  :execute
68
69
  @rem Setup the command line
69
70
 
70
- set CLASSPATH=%APP_HOME%\lib\sca-cmd.jar;%APP_HOME%\lib\sca-library.jar;%APP_HOME%\lib\utils-4.0.0.jar;%APP_HOME%\lib\configuration-4.0.0.jar;%APP_HOME%\lib\compress-4.0.0.jar;%APP_HOME%\lib\io-4.0.0.jar;%APP_HOME%\lib\imaging-4.0.0.jar;%APP_HOME%\lib\manifest-4.0.0.jar;%APP_HOME%\lib\commons-cli-1.5.0.jar;%APP_HOME%\lib\jackson-databind-2.13.3.jar;%APP_HOME%\lib\jackson-core-2.13.3.jar;%APP_HOME%\lib\jackson-annotations-2.13.3.jar;%APP_HOME%\lib\jackson-dataformat-xml-2.13.3.jar;%APP_HOME%\lib\commons-lang3-3.12.0.jar;%APP_HOME%\lib\woodstox-core-6.2.7.jar;%APP_HOME%\lib\stax2-api-4.2.1.jar;%APP_HOME%\lib\commons-compress-1.21.jar;%APP_HOME%\lib\commons-io-2.11.0.jar
71
+ set CLASSPATH=%APP_HOME%\lib\sca-cmd.jar;%APP_HOME%\lib\sca-library.jar;%APP_HOME%\lib\utils-6.1.0.jar;%APP_HOME%\lib\configuration-6.1.0.jar;%APP_HOME%\lib\compress-6.2.0.jar;%APP_HOME%\lib\imaging-6.1.0.jar;%APP_HOME%\lib\manifest-6.2.2.jar;%APP_HOME%\lib\io-6.1.0.jar;%APP_HOME%\lib\commons-cli-1.8.0.jar;%APP_HOME%\lib\java-jwt-4.4.0.jar;%APP_HOME%\lib\jackson-databind-2.17.1.jar;%APP_HOME%\lib\jackson-core-2.17.1.jar;%APP_HOME%\lib\jackson-annotations-2.17.1.jar;%APP_HOME%\lib\jackson-dataformat-xml-2.17.1.jar;%APP_HOME%\lib\commons-compress-1.26.2.jar;%APP_HOME%\lib\commons-codec-1.17.0.jar;%APP_HOME%\lib\commons-lang3-3.14.0.jar;%APP_HOME%\lib\jelf-0.9.0.jar;%APP_HOME%\lib\woodstox-core-6.6.2.jar;%APP_HOME%\lib\stax2-api-4.2.2.jar;%APP_HOME%\lib\commons-io-2.16.1.jar
71
72
 
72
73
 
73
74
  @rem Execute sca-cmd
@@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\lib\sca-cmd.jar;%APP_HOME%\lib\sca-library.jar;%APP_HOM
75
76
 
76
77
  :end
77
78
  @rem End local scope for the variables with windows NT shell
78
- if "%ERRORLEVEL%"=="0" goto mainEnd
79
+ if %ERRORLEVEL% equ 0 goto mainEnd
79
80
 
80
81
  :fail
81
82
  rem Set variable SCA_CMD_EXIT_CONSOLE if you need the _script_ return code instead of
82
83
  rem the _cmd.exe /c_ return code!
83
- if not "" == "%SCA_CMD_EXIT_CONSOLE%" exit 1
84
- exit /b 1
84
+ set EXIT_CODE=%ERRORLEVEL%
85
+ if %EXIT_CODE% equ 0 set EXIT_CODE=1
86
+ if not ""=="%SCA_CMD_EXIT_CONSOLE%" exit %EXIT_CODE%
87
+ exit /b %EXIT_CODE%
85
88
 
86
89
  :mainEnd
87
90
  if "%OS%"=="Windows_NT" endlocal
@@ -2,5 +2,5 @@
2
2
 
3
3
  module RokuBuilder
4
4
  # Version of the RokuBuilder Gem
5
- VERSION = "4.29.8"
5
+ VERSION = "4.30.0"
6
6
  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.29.8
4
+ version: 4.30.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - greeneca
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-11-15 00:00:00.000000000 Z
11
+ date: 2024-12-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubyzip