forked from cloudfoundry/java-buildpack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathargs.go
More file actions
15 lines (14 loc) · 649 Bytes
/
Copy pathargs.go
File metadata and controls
15 lines (14 loc) · 649 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
package javaexec
// BuildArgs assembles the full argv for execing the JVM. The resulting slice is
// [java, <tokenized JAVA_OPTS...>, <trusted args...>], mirroring the order of
// the previous `exec java $JAVA_OPTS <trusted>` start command. trusted args are
// produced by the buildpack (classpath, -jar/-cp, main class) and are passed
// through unchanged; only JAVA_OPTS is tokenized.
func BuildArgs(java, javaOpts string, trusted []string) []string {
opts := TokenizeJavaOpts(javaOpts)
argv := make([]string, 0, 1+len(opts)+len(trusted))
argv = append(argv, java)
argv = append(argv, opts...)
argv = append(argv, trusted...)
return argv
}