-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added example script integrated with commons
- Loading branch information
Michal Bogacz
committed
Oct 21, 2024
1 parent
a4b0583
commit c4263ea
Showing
6 changed files
with
68 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
scala_binary( | ||
name = "manualInit", | ||
main_class = "projects.scripts.src.main.scala.com.org.manual_init.ManualInit", | ||
visibility = ["//visibility:public"], | ||
deps = [ | ||
"//projects/scripts/src/main/scala/com/org/manual_init:manualInit", | ||
], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Scripts | ||
|
||
Scripts can depend on any part of monorepo. In this example they depend on `commons` | ||
You need in script part of service? Access to DB with real code repository? It can be easily done. | ||
|
||
File [BUILD.bazel](BUILD.bazel) can contain many `scala_binary` to easier reference additional scrips. | ||
Structure of scripts might look strange, but it shows that Bazel does not restrict your decision on how you organize code. |
8 changes: 8 additions & 0 deletions
8
projects/scripts/src/main/scala/com/org/manual_init/BUILD.bazel
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
scala_library( | ||
name = "manualInit", | ||
srcs = glob(["**/*.scala"]), | ||
visibility = ["//visibility:public"], | ||
deps = [ | ||
"//projects/commons/init-log/src/main:init-log", | ||
], | ||
) |
11 changes: 11 additions & 0 deletions
11
projects/scripts/src/main/scala/com/org/manual_init/ManualInit.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package projects.scripts.src.main.scala.com.org.manual_init | ||
|
||
import com.org.initlog.Init | ||
|
||
object ManualInit { | ||
|
||
def main(args: Array[String]): Unit = { | ||
println(s"SCRIPT> Starting with args: ${args.mkString("(", ", ", ")")}") | ||
println(s"SCRIPT> Message from service init: ${Init.message}") | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
projects/scripts/src/main/scala/com/org/manual_init/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Example script | ||
Shows how easy can be integration with other parts of monorepo | ||
|
||
This example script also shows how to pass args | ||
```bash | ||
bazel run //projects/scripts:manualInit -- myArg1 myArg2 | ||
``` |