File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed
multiversion/src/main/scala/multiversion/commands Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -56,6 +56,7 @@ import multiversion.resolvers.Sha256
56
56
@ CommandName (" export" )
57
57
case class ExportCommand (
58
58
lint : Boolean = true ,
59
+ inputPath : Path = Paths .get(" 3rdparty.yaml" ),
59
60
outputPath : Path = Paths .get(" /tmp" , " jvm_deps.bzl" ),
60
61
cache : Option [Path ] = None ,
61
62
@ Inline
@@ -165,13 +166,15 @@ case class ExportCommand(
165
166
166
167
private def parseThirdpartyConfig (): Result [ThirdpartyConfig ] = {
167
168
val configPath =
168
- app.env.workingDirectory.resolve(" 3rdparty.yaml " )
169
+ app.env.workingDirectory.resolve(inputPath )
169
170
if (! Files .isRegularFile(configPath)) {
170
171
ErrorResult (
171
172
Diagnostic .error(
172
173
s " no such file: $configPath\n\t To fix this problem, change your working directory or create this file "
173
174
)
174
175
)
176
+ } else if (configPath.getFileName.toString.endsWith(" .json" )) {
177
+ ThirdpartyConfig .parseJson(Input .path(configPath))
175
178
} else {
176
179
ThirdpartyConfig .parseYaml(Input .path(configPath))
177
180
}
Original file line number Diff line number Diff line change @@ -120,7 +120,7 @@ load("@maven//:jvm_deps.bzl", "load_jvm_deps")
120
120
load_jvm_deps()
121
121
```
122
122
123
- ### YAML
123
+ ### YAML or JSON
124
124
125
125
If you prefer to configure the dependencies in one file, create ` 3rdparty.yaml `
126
126
at the root of monorepo instead
@@ -131,6 +131,13 @@ runt the following inside the `multiversion-example/` directory:
131
131
$ multiversion export --output-path=3rdparty/jvm_deps.bzl
132
132
```
133
133
134
+ You can also specify a different path or format for the input configuration using
135
+ ` --input-path ` :
136
+
137
+ ``` sh
138
+ $ multiversion export --input-path=config/3rdparty.json --output-path=3rdparty/jvm_deps.bzl
139
+ ```
140
+
134
141
### Pants
135
142
136
143
``` sh
You can’t perform that action at this time.
0 commit comments