roku_builder 4.21.6 → 4.22.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bcd83884e0acc2164d90915b4949c8a8b8334ee072ed45ca3c82e1f823b77d3f
4
- data.tar.gz: 8f48403dd9bba7982c0cde10a2667f85d3da88244401fa17fd4b1d8675cb4709
3
+ metadata.gz: ff75b5fd7976aa19af20672846c724440f9c00cfdfddcf516e3c9fc736df31b3
4
+ data.tar.gz: a7dc6e1bbd189831f75c87ea616d92164c58e2271aca276fd881760a0a3d72c0
5
5
  SHA512:
6
- metadata.gz: e5397243a045a1d8bac3dbc06381513e7a34b5e74bdb00d7e8cfd2eaf4bb89f520e8b01c1c25bae531551d1cce2a1273dec0b7d84f5877b2b61741e54e59f1a8
7
- data.tar.gz: d368e046903392039969c8a3ba0b339755fd6a707126f792403143c8b2d835dfa4156f8464d19bf733e6ff76241ccf4b1efe695a85bd745f2126bfa1abf54af5
6
+ metadata.gz: 0f80b706f07170642bb5fb2a754ecccd42d66e672ff355c94c353480edfb75b18aca8a78e3c13e40835bb6160a9622984aea331794a37e4fb75fbf70abd1345d
7
+ data.tar.gz: 4f6f9697af2923ddac05ccb67d1f4f17f095730a87126acb0d61325ef0bca2fe7a1a38a34b480da85cac8c0b5b149df692f94489cb85a5ced588d53c714e7478
@@ -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
@@ -61,10 +64,11 @@ module RokuBuilder
61
64
 
62
65
  def run_sca_tool(path:, ssai:)
63
66
  if OS.unix?
64
- command = File.join(File.dirname(__FILE__), "sca-cmd", "bin", "sca-cmd")
67
+ command = "export JAVA_HOME='JDK 11'; " + File.join(File.dirname(__FILE__), "sca-cmd", "bin", "sca-cmd")
65
68
  else
66
69
  command = File.join(File.dirname(__FILE__), "sca-cmd", "bin", "sca-cmd.bat")
67
70
  end
71
+ @logger.debug("Command: '#{command}'")
68
72
  results = `#{command} #{path}`.split("\n")
69
73
  process_sca_results(results, ssai)
70
74
  end
@@ -41,18 +41,26 @@ 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
- to_check = no_comments
45
- to_check = file if line_inspector[:include_comments]
46
- match = nil
47
- if line_inspector[:case_sensitive]
48
- match = /#{line_inspector[:regex]}/.match(to_check)
49
- else
50
- match = /#{line_inspector[:regex]}/i.match(to_check)
51
- end
52
- if match
53
- line_number = to_check[0..match.begin(0)].split("\n", -1).count - 1
54
- unless lines_to_ignore.include?(line_number)
55
- add_warning(inspector: line_inspector, file: file_path, line: line_number, match: match)
44
+ unless line_inspector[:disabled]
45
+ to_check = no_comments
46
+ to_check = file if line_inspector[:include_comments]
47
+ match = nil
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
63
+ end
56
64
  end
57
65
  end
58
66
  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
- Dir.mktmpdir { |dir|
65
- config_copy = @config.dup
66
- config_copy.root_dir = dir
67
- Manifest.generate({config: config_copy, attributes: {}})
68
- Dir.mkdir(File.join(dir, "source"))
69
- File.open(File.join(dir, "source", "main.brs"), "w") do |io|
70
- io.puts "sub main()"
71
- io.puts " print \"Load\""
72
- io.puts "end sub"
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
@@ -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
- # http://www.apache.org/licenses/LICENSE-2.0
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=$((i+1))
159
+ i=`expr $i + 1`
158
160
  done
159
161
  case $i in
160
- (0) set -- ;;
161
- (1) set -- "$args0" ;;
162
- (2) set -- "$args0" "$args1" ;;
163
- (3) set -- "$args0" "$args1" "$args2" ;;
164
- (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
165
- (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
166
- (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
167
- (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
168
- (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
169
- (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
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=$(save "$@")
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 http://www.apache.org/licenses/LICENSE-2.0
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 init
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 init
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 %CMD_LINE_ARGS%
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
@@ -2,5 +2,5 @@
2
2
 
3
3
  module RokuBuilder
4
4
  # Version of the RokuBuilder Gem
5
- VERSION = "4.21.6"
5
+ VERSION = "4.22.5"
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.21.6
4
+ version: 4.22.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - greeneca
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-01-22 00:00:00.000000000 Z
11
+ date: 2021-06-11 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