Skip to content

Commit

Permalink
feat: add stub binary for java run environment for tengo-sdk tests
Browse files Browse the repository at this point in the history
  • Loading branch information
DenKoren committed Aug 22, 2024
1 parent 960f829 commit 83df7d9
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 1 deletion.
13 changes: 12 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@milaboratory/small-binaries",
"version": "1.6.4",
"version": "1.7.0",
"description": "Small cross-platform binaries, like 'sleep' or 'hello-world', suitable for test needs",
"scripts": {
"cleanup": "rm -rf ./pkg-*.tgz && rm -rf ./build/ && rm -rf ./dist/",
Expand Down Expand Up @@ -55,6 +55,17 @@
"read-file-to-stdout-with-sleep": { "cmd": [ "{pkg}/main" ] }
}
}
},
"runenv-java-stub": {
"environment": {
"registry": { "name": "milaboratories" },
"name": "common/runenv-java-stub",
"version": "1.0.0",
"type": "java",
"root": "./nonexistent/",
"binDir": ".",
"entrypointName": "runenv-java-stub"
}
}
}
},
Expand Down
20 changes: 20 additions & 0 deletions runenv-java-stub.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package main

import (
"fmt"
"os"
"strings"
)

func main() {
if len(os.Args) == 1 {
fmt.Fprintf(os.Stdout, "run environment was started with no command and arguments")
}

cmdToRun := make([]string, 0, len(os.Args))
for _, arg := range cmdToRun {
cmdToRun = append(cmdToRun, fmt.Sprintf("%q", arg))
}

fmt.Fprint(os.Stdout, strings.Join(cmdToRun, " "))
}
1 change: 1 addition & 0 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ build_binaries() {

rm -rf "${script_dir}/${BUILD_DIR}"

build_binaries "runenv-java-stub"
build_binaries "hello-world"
build_binaries "guided-command"
build_binaries "sleep"
Expand Down
1 change: 1 addition & 0 deletions scripts/publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ publish_packages() {
publish_package "${_bin_name}" "macosx" "aarch64"
}

publish_binaries "runenv-java-stub"
publish_packages "hello-world"
publish_packages "guided-command"
publish_packages "sleep"
Expand Down

0 comments on commit 83df7d9

Please sign in to comment.