roku_builder 4.29.9 → 4.30.2
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/config_parser.rb +3 -0
- data/lib/roku_builder/plugins/analyzer.rb +8 -5
- data/lib/roku_builder/plugins/loader.rb +1 -0
- data/lib/roku_builder/plugins/navigator.rb +1 -0
- data/lib/roku_builder/plugins/packager.rb +12 -1
- data/lib/roku_builder/plugins/rokuapi.rb +20 -9
- data/lib/roku_builder/plugins/sca-cmd/README.md +1 -1
- data/lib/roku_builder/plugins/sca-cmd/bin/sca-cmd +29 -14
- data/lib/roku_builder/plugins/sca-cmd/bin/sca-cmd.bat +20 -17
- data/lib/roku_builder/plugins/sca-cmd/lib/sca-cmd.jar +0 -0
- data/lib/roku_builder/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d871e3265c4e99eb44d7e898cac907db092436392aaa2122e9604f6ef1dc9d97
|
4
|
+
data.tar.gz: 9f71d6ac3de1adbc170600f73aa5c51a01d75a96e66f131f4a60ebced26bff3f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1c9181918890fbc93df02698d7b7f317d765485b368029ac344d299d1f66919ca5822426b94899c3eea7ce28eea5060db24816491ef47722324a6c1c197b85f5
|
7
|
+
data.tar.gz: 0352cc27c7bb4f728d4c66674b7b2032a5ac3cac0fddb1829c243e3cc645620c7428d2df6187bf2d8e385ef6e19d9088d5eb55b897682dbb100393fb654e8737
|
@@ -18,11 +18,14 @@ module RokuBuilder
|
|
18
18
|
options[:analyze] = true
|
19
19
|
end
|
20
20
|
parser.separator "Options:"
|
21
|
-
parser.on("--
|
21
|
+
parser.on("--include-libraries", "Include libraries in analyze") do
|
22
22
|
options[:include_libraries] = true
|
23
23
|
end
|
24
|
-
parser.on("--sca
|
25
|
-
options[:
|
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,7 +43,7 @@ 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|
|
@@ -104,7 +107,7 @@ module RokuBuilder
|
|
104
107
|
end
|
105
108
|
libraries = @config.project[:libraries]
|
106
109
|
libraries ||= []
|
107
|
-
if @sca_warning[:path] and libraries.any_is_start?(@sca_warning[:path].gsub(/pkg:/, "")) and not @options[:
|
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]
|
108
111
|
return false
|
109
112
|
end
|
110
113
|
if linter_config[:ignore_warnings]
|
@@ -152,6 +152,7 @@ module RokuBuilder
|
|
152
152
|
|
153
153
|
def file_path(type)
|
154
154
|
file = @config.send(type)[:file]
|
155
|
+
file ||= @config.send(type)[:default_file]
|
155
156
|
file ||= Manifest.new(config: @config).build_version
|
156
157
|
file ||= SecureRandom.uuid
|
157
158
|
file = file+".zip" unless file.end_with?(".zip")
|
@@ -28,6 +28,13 @@ module RokuBuilder
|
|
28
28
|
parser.on("--inspect-package", "Inspect package after packaging") do
|
29
29
|
options[:inspect_package] = true
|
30
30
|
end
|
31
|
+
parser.on("--password PASSWORD", "Password of the current key") do |password|
|
32
|
+
options[:package_password] = password
|
33
|
+
end
|
34
|
+
parser.on("--dev-id DEV_ID", "Dev ID of the current key") do |dev_id|
|
35
|
+
options[:package_dev_id] = dev_id
|
36
|
+
end
|
37
|
+
|
31
38
|
end
|
32
39
|
|
33
40
|
def self.dependencies
|
@@ -55,7 +62,11 @@ module RokuBuilder
|
|
55
62
|
end
|
56
63
|
|
57
64
|
def genkey(options:)
|
58
|
-
password
|
65
|
+
password = options[:package_password]
|
66
|
+
dev_id = options[:package_dev_id]
|
67
|
+
unless password and dev_id
|
68
|
+
password, dev_id = generate_new_key()
|
69
|
+
end
|
59
70
|
@logger.unknown("Password: "+password)
|
60
71
|
@logger.info("DevID: "+dev_id)
|
61
72
|
|
@@ -35,7 +35,10 @@ module RokuBuilder
|
|
35
35
|
end
|
36
36
|
parser.on("--no-publish", 'Prevent the channel from being automatically published when submitted') do
|
37
37
|
options[:no_publish] = true
|
38
|
-
end
|
38
|
+
end
|
39
|
+
parser.on("--minimum-firmware-version VERSION", 'The minimum firmware version to use for the channel') do |version|
|
40
|
+
options[:minimum_firmware_version] = version
|
41
|
+
end
|
39
42
|
end
|
40
43
|
|
41
44
|
def self.dependencies
|
@@ -44,6 +47,9 @@ module RokuBuilder
|
|
44
47
|
|
45
48
|
def submit(options:)
|
46
49
|
raise RokuBuilder::InvalidOptions, "Missing channel id" unless options[:channel_id]
|
50
|
+
raise RokuBuilder::InvalidOptions, "Missing api key" unless options[:api_key]
|
51
|
+
raise RokuBuilder::InvalidOptions, "Missing package" unless options[:in]
|
52
|
+
raise RokuBuilder::InvalidOptions, "Missing minimum firmware version" unless options[:minimum_firmware_version]
|
47
53
|
@logger.info "Submit to channel #{options[:channel_id]}"
|
48
54
|
@api_key = options[:api_key]
|
49
55
|
@no_publish = !!options[:no_publish]
|
@@ -51,7 +57,7 @@ module RokuBuilder
|
|
51
57
|
if response.first["channelState"] == "Unpublished"
|
52
58
|
response = update_channel_version(options[:channel_id], get_package(options), response.last["id"])
|
53
59
|
else
|
54
|
-
response = create_channel_version(options[:channel_id], get_package(options))
|
60
|
+
response = create_channel_version(options[:channel_id], get_package(options), options[:minimum_firmware_version])
|
55
61
|
end
|
56
62
|
raise RokuBuilder::ExecutionError, "Request failed: #{response.reason_phrase}" unless response.success?
|
57
63
|
JSON.parse(response.body)
|
@@ -59,6 +65,7 @@ module RokuBuilder
|
|
59
65
|
|
60
66
|
def publish(options:)
|
61
67
|
raise RokuBuilder::InvalidOptions, "Missing channel id" unless options[:channel_id]
|
68
|
+
raise RokuBuilder::INvalidOptions, "Missing api key" unless options[:api_key]
|
62
69
|
@logger.info "Publish to channel #{options[:channel_id]}"
|
63
70
|
@api_key = options[:api_key]
|
64
71
|
response = get_channel_versions(options[:channel_id])
|
@@ -90,14 +97,15 @@ module RokuBuilder
|
|
90
97
|
end
|
91
98
|
sorted
|
92
99
|
end
|
93
|
-
|
94
|
-
def create_channel_version(channel, package)
|
100
|
+
|
101
|
+
def create_channel_version(channel, package, version)
|
95
102
|
path = "/external/channels/#{channel}/versions"
|
103
|
+
body = {"minimumFirmwareVersionTextShort" => version}
|
96
104
|
params = nil
|
97
105
|
unless @no_publish
|
98
106
|
params = {"state" => "Published"}
|
99
107
|
end
|
100
|
-
api_post(path, path, package, params)
|
108
|
+
api_post(path, path, package, params, body)
|
101
109
|
end
|
102
110
|
|
103
111
|
def update_channel_version(channel, package, version)
|
@@ -117,13 +125,14 @@ module RokuBuilder
|
|
117
125
|
connection('GET', path, nil).get(api_path+path)
|
118
126
|
end
|
119
127
|
|
120
|
-
def api_post(path, token_path, package=nil, params = nil)
|
121
|
-
body
|
128
|
+
def api_post(path, token_path, package=nil, params = nil, body = nil)
|
129
|
+
body ||= {}
|
122
130
|
if package
|
123
|
-
body
|
131
|
+
body.merge!({
|
124
132
|
"appFileBase64Encoded" => Base64.encode64(package.read)
|
125
|
-
}
|
133
|
+
})
|
126
134
|
end
|
135
|
+
body = body.to_json
|
127
136
|
connection('POST', token_path, body, params).post(api_path+path) do |request|
|
128
137
|
if params
|
129
138
|
request.params = params
|
@@ -141,6 +150,7 @@ module RokuBuilder
|
|
141
150
|
response = connection('PATCH', token_path, body).patch(api_path+path) do |request|
|
142
151
|
request.body = body
|
143
152
|
end
|
153
|
+
response
|
144
154
|
end
|
145
155
|
|
146
156
|
def connection(method, path, body, params = nil)
|
@@ -152,6 +162,7 @@ module RokuBuilder
|
|
152
162
|
}) do |f|
|
153
163
|
f.adapter Faraday.default_adapter
|
154
164
|
end
|
165
|
+
connection
|
155
166
|
end
|
156
167
|
|
157
168
|
def get_jwt_token(api_key, service_urn, method, path, body = nil, params = nil)
|
@@ -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/
|
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
|
-
|
84
|
-
|
85
|
-
APP_NAME="sca-cmd"
|
83
|
+
# This is normally unused
|
84
|
+
# shellcheck disable=SC2034
|
86
85
|
APP_BASE_NAME=${0##*/}
|
87
|
-
|
88
|
-
|
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-
|
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
|
-
|
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
|
-
|
197
|
-
#
|
198
|
-
|
199
|
-
|
200
|
-
#
|
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%"
|
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%"
|
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
|
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-
|
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
|
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
|
-
|
84
|
-
|
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
|
Binary file
|
data/lib/roku_builder/version.rb
CHANGED
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.30.2
|
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: 2025-02-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubyzip
|