Skip to content

Commit 2fb41fc

Browse files
authored
Add switch for defining mta.yaml filename (#1154)
Co-authored-by: Jiang, Yu-tao <>
1 parent bb94ccf commit 2fb41fc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+362
-269
lines changed

cmd/assembly.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ const (
1313
)
1414

1515
var assembleCmdSrc string
16+
var assembleCmdMtaYamlFilename string
1617
var assembleCmdTrg string
1718
var assembleCmdExtensions []string
1819
var assembleCmdMtarName string
@@ -25,7 +26,7 @@ var assembleCommand = &cobra.Command{
2526
Long: "Generates an MTA archive according to the MTA deployment descriptor (mtad.yaml)",
2627
Args: cobra.NoArgs,
2728
RunE: func(cmd *cobra.Command, args []string) error {
28-
err := artifacts.Assembly(assembleCmdSrc, assembleCmdTrg, assembleCmdExtensions, defaultPlatform, assembleCmdMtarName, assembleCmdParallel, os.Getwd)
29+
err := artifacts.Assembly(assembleCmdSrc, assembleCmdMtaYamlFilename, assembleCmdTrg, assembleCmdExtensions, defaultPlatform, assembleCmdMtarName, assembleCmdParallel, os.Getwd)
2930
logError(err)
3031
return err
3132
},
@@ -36,6 +37,8 @@ var assembleCommand = &cobra.Command{
3637
func init() {
3738
assembleCommand.Flags().StringVarP(&assembleCmdSrc,
3839
"source", "s", "", "The path to the MTA project; the current path is set as default")
40+
assembleCommand.Flags().StringVarP(&assembleCmdMtaYamlFilename,
41+
"filename", "f", "", "The mta yaml filename of the MTA project; the mta.yaml is set as default")
3942
assembleCommand.Flags().StringVarP(&assembleCmdTrg,
4043
"target", "t", "", `The path to the folder in which the MTAR file is created; the path to the "mta_archives" subfolder of the current folder is set as default`)
4144
assembleCommand.Flags().StringSliceVarP(&assembleCmdExtensions, "extensions", "e", nil,

cmd/cmd.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,12 @@ import (
1212
)
1313

1414
var cleanupCmdSrc string
15+
var cleanupCmdMtaYamlFilename string
1516
var cleanupCmdTrg string
1617
var cleanupCmdDesc string
1718

1819
var validateCmdSrc string
20+
var validateCmdMtaYamlFilename string
1921
var validateCmdDesc string
2022
var validateCmdExtensions []string
2123
var validateCmdMode string
@@ -45,6 +47,8 @@ func init() {
4547
// set flags of cleanup command
4648
cleanupCmd.Flags().StringVarP(&cleanupCmdSrc, "source", "s", "",
4749
"The path to the MTA project; the current path is set as default")
50+
cleanupCmd.Flags().StringVarP(&cleanupCmdMtaYamlFilename, "filename", "f", "",
51+
"The mta yaml filename of the MTA project; the mta.yaml is set as default")
4852
cleanupCmd.Flags().StringVarP(&cleanupCmdTrg, "target", "t", "",
4953
"The path to the folder in which the temporary artifacts were created; the current path is set as default")
5054
cleanupCmd.Flags().StringVarP(&cleanupCmdDesc, "desc", "d", "",
@@ -54,6 +58,8 @@ func init() {
5458
// set flags of validation command
5559
validateCmd.Flags().StringVarP(&validateCmdSrc, "source", "s", "",
5660
"The path to the MTA project; the current path is set as default")
61+
validateCmd.Flags().StringVarP(&validateCmdMtaYamlFilename, "filename", "f", "",
62+
"The mta yaml filename of the MTA project; the mta.yaml is set as default")
5763
validateCmd.Flags().StringVarP(&validateCmdMode, "mode", "m", "",
5864
`The validation mode; supported values: "schema", "semantic" (default)`)
5965
validateCmd.Flags().StringVarP(&validateCmdDesc, "desc", "d", "",
@@ -114,7 +120,7 @@ var cleanupCmd = &cobra.Command{
114120
Args: cobra.NoArgs,
115121
RunE: func(cmd *cobra.Command, args []string) error {
116122
// Remove temp folder
117-
err := artifacts.ExecuteCleanup(cleanupCmdSrc, cleanupCmdTrg, cleanupCmdDesc, os.Getwd)
123+
err := artifacts.ExecuteCleanup(cleanupCmdSrc, cleanupCmdMtaYamlFilename, cleanupCmdTrg, cleanupCmdDesc, os.Getwd)
118124
logError(err)
119125
return err
120126
},
@@ -130,7 +136,7 @@ var validateCmd = &cobra.Command{
130136
Long: "MBT validation",
131137
Args: cobra.NoArgs,
132138
RunE: func(cmd *cobra.Command, args []string) error {
133-
err := artifacts.ExecuteValidation(validateCmdSrc, validateCmdDesc, validateCmdExtensions, validateCmdMode, validateCmdStrict, validateCmdExclude, os.Getwd)
139+
err := artifacts.ExecuteValidation(validateCmdSrc, validateCmdMtaYamlFilename, validateCmdDesc, validateCmdExtensions, validateCmdMode, validateCmdStrict, validateCmdExclude, os.Getwd)
134140
logError(err)
135141
return err
136142
},

cmd/gen.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,15 @@ import (
1010

1111
// meta command flags
1212
var metaCmdSrc string
13+
var metaCmdMtaYamlFilename string
1314
var metaCmdTrg string
1415
var metaCmdDesc string
1516
var metaCmdExtensions []string
1617
var metaCmdPlatform string
1718

1819
// mtar command flags
1920
var mtarCmdSrc string
21+
var mtarCmdMtaYamlFilename string
2022
var mtarCmdTrg string
2123
var mtarCmdDesc string
2224
var mtarCmdTrgProvided string
@@ -29,6 +31,8 @@ func init() {
2931
// set flags of meta command
3032
metaCmd.Flags().StringVarP(&metaCmdSrc, "source", "s", "",
3133
"The path to the MTA project; the current path is set as default")
34+
metaCmd.Flags().StringVarP(&metaCmdMtaYamlFilename, "filename", "f", "",
35+
"The mta yaml filename of the MTA project; the mta.yaml is set as default")
3236
metaCmd.Flags().StringVarP(&metaCmdTrg, "target", "t", "",
3337
"The path to the folder in which a temporary folder with generated metadata is created; the current path is set as default")
3438
metaCmd.Flags().StringVarP(&metaCmdDesc, "desc", "d", "",
@@ -42,6 +46,8 @@ func init() {
4246
// set flags of mtar command
4347
mtarCmd.Flags().StringVarP(&mtarCmdSrc, "source", "s", "",
4448
"The path to the MTA project; the current path is set as default")
49+
mtarCmd.Flags().StringVarP(&mtarCmdMtaYamlFilename, "filename", "f", "",
50+
"The mta yaml filename of the MTA project; the mta.yaml is set as default")
4551
mtarCmd.Flags().StringVarP(&mtarCmdTrg, "target", "t", "",
4652
`The path to the folder in which the MTAR file is created; the path to the "mta_archives" subfolder of the current folder is set as default`)
4753
mtarCmd.Flags().StringVarP(&mtarCmdDesc, "desc", "d", "",
@@ -64,7 +70,7 @@ var metaCmd = &cobra.Command{
6470
Long: "Generates META-INF folder with manifest and MTAD files",
6571
Args: cobra.NoArgs,
6672
RunE: func(cmd *cobra.Command, args []string) error {
67-
err := artifacts.ExecuteGenMeta(metaCmdSrc, metaCmdTrg, metaCmdDesc, metaCmdExtensions, metaCmdPlatform, os.Getwd)
73+
err := artifacts.ExecuteGenMeta(metaCmdSrc, metaCmdMtaYamlFilename, metaCmdTrg, metaCmdDesc, metaCmdExtensions, metaCmdPlatform, os.Getwd)
6874
logError(err)
6975
return err
7076
},
@@ -80,7 +86,7 @@ var mtarCmd = &cobra.Command{
8086
Long: "Generates MTA archive from the folder with all artifacts",
8187
Args: cobra.NoArgs,
8288
RunE: func(cmd *cobra.Command, args []string) error {
83-
err := artifacts.ExecuteGenMtar(mtarCmdSrc, mtarCmdTrg, mtarCmdTrgProvided, mtarCmdDesc, mtarCmdExtensions, mtarCmdMtarName, os.Getwd)
89+
err := artifacts.ExecuteGenMtar(mtarCmdSrc, mtarCmdMtaYamlFilename, mtarCmdTrg, mtarCmdTrgProvided, mtarCmdDesc, mtarCmdExtensions, mtarCmdMtarName, os.Getwd)
8490
logError(err)
8591
return err
8692
},

cmd/init.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,15 @@ const (
1818

1919
// flags of init command
2020
var initCmdSrc string
21+
var initCmdMtaYamlFilename string
2122
var initCmdTrg string
2223
var initCmdExtensions []string
2324
var initCmdMode string
2425

2526
// flags of build command
2627
var mbtCmdCLI string
2728
var buildCmdSrc string
29+
var buildCmdMtaYamlFilename string
2830
var buildCmdTrg string
2931
var buildCmdExtensions []string
3032
var buildCmdMtar = "*"
@@ -39,6 +41,7 @@ var buildCmdSBomFilePath string
3941
func init() {
4042
// set flags for init command
4143
initCmd.Flags().StringVarP(&initCmdSrc, "source", "s", "", "The path to the MTA project; the current path is set as default")
44+
initCmd.Flags().StringVarP(&initCmdMtaYamlFilename, "filename", "f", "", "The mta yaml filename of the MTA project; the mta.yaml is set as default")
4245
initCmd.Flags().StringVarP(&initCmdTrg, "target", "t", "", "The path to the folder in which the Makefile is generated; the current path is set as default")
4346
initCmd.Flags().StringSliceVarP(&initCmdExtensions, "extensions", "e", nil, "The MTA extension descriptors")
4447
initCmd.Flags().StringVarP(&initCmdMode, "mode", "m", "", `The mode of the Makefile generation; supported values: "default" and "verbose"`)
@@ -47,6 +50,7 @@ func init() {
4750

4851
// set flags of build command
4952
buildCmd.Flags().StringVarP(&buildCmdSrc, "source", "s", "", "The path to the MTA project; the current path is set as default")
53+
buildCmd.Flags().StringVarP(&buildCmdMtaYamlFilename, "filename", "f", "", "The mta yaml filename of the MTA project; the mta.yaml is set as default")
5054
buildCmd.Flags().StringVarP(&buildCmdTrg, "target", "t", "", `The path to the folder in which the MTAR file is created; the path to the "mta_archives" subfolder of the current folder is set as default`)
5155
buildCmd.Flags().StringSliceVarP(&buildCmdExtensions, "extensions", "e", nil, "The MTA extension descriptors")
5256
buildCmd.Flags().StringVarP(&buildCmdMtar, "mtar", "", "", "The file name of the generated archive file")
@@ -69,7 +73,7 @@ var initCmd = &cobra.Command{
6973
Args: cobra.NoArgs,
7074
Run: func(cmd *cobra.Command, args []string) {
7175
// Generate build script
72-
err := tpl.ExecuteMake(initCmdSrc, initCmdTrg, initCmdExtensions, makefile, initCmdMode, os.Getwd, true)
76+
err := tpl.ExecuteMake(initCmdSrc, initCmdMtaYamlFilename, initCmdTrg, initCmdExtensions, makefile, initCmdMode, os.Getwd, true)
7377
logError(err)
7478
},
7579
}
@@ -89,7 +93,7 @@ var buildCmd = &cobra.Command{
8993
// However, in some environments we might want to always use the default mbt from the path. This can be set by using environment variable MBT_USE_DEFAULT.
9094
useDefaultMbt := os.Getenv("MBT_USE_DEFAULT") == "true"
9195
// Note: we can only use the non-default mbt (i.e. the current executable name) from inside the command itself because if this function runs from other places like tests it won't point to the MBT
92-
err := artifacts.ExecBuild(makefileTmp, buildCmdSrc, buildCmdTrg, buildCmdExtensions, buildCmdMode, buildCmdMtar, buildCmdPlatform, buildCmdStrict, buildCmdJobs, buildCmdOutputSync, os.Getwd, exec.Execute, useDefaultMbt, buildCmdKeepMakefile, buildCmdSBomFilePath)
96+
err := artifacts.ExecBuild(makefileTmp, buildCmdSrc, buildCmdMtaYamlFilename, buildCmdTrg, buildCmdExtensions, buildCmdMode, buildCmdMtar, buildCmdPlatform, buildCmdStrict, buildCmdJobs, buildCmdOutputSync, os.Getwd, exec.Execute, useDefaultMbt, buildCmdKeepMakefile, buildCmdSBomFilePath)
9397
// output err info to stdout
9498
logError(err)
9599
return err

cmd/merge.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
)
1010

1111
var mergeCmdSrc string
12+
var mergeCmdMtaYamlFilename string
1213
var mergeCmdTrg string
1314
var mergeCmdExtensions []string
1415
var mergeCmdName string
@@ -20,7 +21,7 @@ var mergeCmd = &cobra.Command{
2021
Long: `Merges the "mta.yaml" file with the MTA extension descriptors`,
2122
Args: cobra.NoArgs,
2223
RunE: func(cmd *cobra.Command, args []string) error {
23-
err := artifacts.ExecuteMerge(mergeCmdSrc, mergeCmdTrg, mergeCmdExtensions, mergeCmdName, os.Getwd)
24+
err := artifacts.ExecuteMerge(mergeCmdSrc, mergeCmdMtaYamlFilename, mergeCmdTrg, mergeCmdExtensions, mergeCmdName, os.Getwd)
2425
return err
2526
},
2627
Hidden: true,
@@ -31,6 +32,8 @@ func init() {
3132
// set flag of merge command
3233
mergeCmd.Flags().StringVarP(&mergeCmdSrc, "source", "s", "",
3334
"The path to the MTA project; the current path is set as default")
35+
mergeCmd.Flags().StringVarP(&mergeCmdMtaYamlFilename, "filename", "f", "",
36+
"The mta yaml filename of the MTA project; the mta.yaml is set as default")
3437
mergeCmd.Flags().StringVarP(&mergeCmdTrg, "target", "t",
3538
"", "The path to the folder in which the merged file is generated")
3639
mergeCmd.Flags().StringSliceVarP(&mergeCmdExtensions, "extensions", "e", nil,

cmd/module.go

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,23 @@ import (
1010

1111
// flags of pack command
1212
var packCmdSrc string
13+
var packCmdMtaYamlFilename string
1314
var packCmdTrg string
1415
var packCmdExtensions []string
1516
var packCmdModule string
1617
var packCmdPlatform string
1718

1819
// flags of Makefile build command
1920
var buildModuleCmdSrc string
21+
var buildModuleCmdMtaYamlFilename string
2022
var buildModuleCmdTrg string
2123
var buildModuleCmdExtensions []string
2224
var buildModuleCmdModule string
2325
var buildModuleCmdPlatform string
2426

2527
// flags of stand alone build command
2628
var soloBuildModuleCmdSrc string
29+
var soloBuildModuleCmdMtaYamlFilename string
2730
var soloBuildModuleCmdTrg string
2831
var soloBuildModuleCmdExtensions []string
2932
var soloBuildModuleCmdModules []string
@@ -36,6 +39,8 @@ func init() {
3639
// sets the flags of of the command pack module
3740
packModuleCmd.Flags().StringVarP(&packCmdSrc, "source", "s", "",
3841
"The path to the MTA project; the current path is is set as default")
42+
packModuleCmd.Flags().StringVarP(&packCmdMtaYamlFilename, "filename", "f", "",
43+
"The mta yaml filename of MTA project; the mta.yaml is is set as default")
3944
packModuleCmd.Flags().StringVarP(&packCmdTrg, "target", "t", "",
4045
"The path to the folder in which the temporary artifacts of the module pack are created; the current path is is set as default")
4146
packModuleCmd.Flags().StringSliceVarP(&packCmdExtensions, "extensions", "e", nil,
@@ -48,6 +53,8 @@ func init() {
4853
// sets the flags of the Makefile command build module
4954
buildModuleCmd.Flags().StringVarP(&buildModuleCmdSrc, "source", "s", "",
5055
"The path to the MTA project; the current path is set as default")
56+
buildModuleCmd.Flags().StringVarP(&buildModuleCmdMtaYamlFilename, "filename", "f", "",
57+
"The mta yaml filename of MTA project; the mta.yaml is is set as default")
5158
buildModuleCmd.Flags().StringVarP(&buildModuleCmdTrg, "target", "t", "",
5259
"The path to the folder in which the module build results are created; the <source folder>/.<project name>_mta_build_tmp/<module name> path is set as default")
5360
buildModuleCmd.Flags().StringSliceVarP(&buildModuleCmdExtensions, "extensions", "e", nil,
@@ -60,6 +67,8 @@ func init() {
6067
// sets the flags of the solo Makefile command build module
6168
soloBuildModuleCmd.Flags().StringVarP(&soloBuildModuleCmdSrc, "source", "s", "",
6269
"The path to the MTA project; the current path is set as default")
70+
soloBuildModuleCmd.Flags().StringVarP(&soloBuildModuleCmdMtaYamlFilename, "filename", "f", "",
71+
"The mta yaml filename of the MTA project; the mta.ymal is set as default")
6372
soloBuildModuleCmd.Flags().StringVarP(&soloBuildModuleCmdTrg, "target", "t", "",
6473
"The path to the folder in which the module build results are created; the <current folder>/.<project name>_mta_build_tmp/<module name> path is set as default")
6574
soloBuildModuleCmd.Flags().StringSliceVarP(&soloBuildModuleCmdExtensions, "extensions", "e", nil,
@@ -81,7 +90,7 @@ var soloBuildModuleCmd = &cobra.Command{
8190
Long: "Builds specified modules according to configurations in the MTA development descriptor (mta.yaml)",
8291
Args: cobra.MaximumNArgs(4),
8392
RunE: func(cmd *cobra.Command, args []string) error {
84-
err := artifacts.ExecuteSoloBuild(soloBuildModuleCmdSrc, soloBuildModuleCmdTrg, soloBuildModuleCmdExtensions,
93+
err := artifacts.ExecuteSoloBuild(soloBuildModuleCmdSrc, soloBuildModuleCmdMtaYamlFilename, soloBuildModuleCmdTrg, soloBuildModuleCmdExtensions,
8594
soloBuildModuleCmdModules, soloBuildModuleCmdAllDependencies, soloBuildModuleCmdMtadGen, soloBuildModuleCmdPlatform,
8695
os.Getwd)
8796
logError(err)
@@ -98,7 +107,7 @@ var buildModuleCmd = &cobra.Command{
98107
Long: "Builds module according to configurations in the MTA development descriptor (mta.yaml) and archives its artifacts",
99108
Args: cobra.NoArgs,
100109
RunE: func(cmd *cobra.Command, args []string) error {
101-
err := artifacts.ExecuteBuild(buildModuleCmdSrc, buildModuleCmdTrg, buildModuleCmdExtensions, buildModuleCmdModule, buildModuleCmdPlatform, os.Getwd)
110+
err := artifacts.ExecuteBuild(buildModuleCmdSrc, buildModuleCmdMtaYamlFilename, buildModuleCmdTrg, buildModuleCmdExtensions, buildModuleCmdModule, buildModuleCmdPlatform, os.Getwd)
102111
logError(err)
103112
return err
104113
},
@@ -117,7 +126,7 @@ var packModuleCmd = &cobra.Command{
117126
Long: "Packs the module artifacts after the build process",
118127
Args: cobra.NoArgs,
119128
RunE: func(cmd *cobra.Command, args []string) error {
120-
err := artifacts.ExecutePack(packCmdSrc, packCmdTrg, packCmdExtensions, packCmdModule, packCmdPlatform, os.Getwd)
129+
err := artifacts.ExecutePack(packCmdSrc, packCmdMtaYamlFilename, packCmdTrg, packCmdExtensions, packCmdModule, packCmdPlatform, os.Getwd)
121130
logError(err)
122131
return err
123132
},

cmd/mtad.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010

1111
// mtad gen - command flags
1212
var mtadGenCmdSrc string
13+
var mtadGenCmdMtaYamlFilename string
1314
var mtadGenCmdTrg string
1415
var mtadGenCmdExtensions []string
1516
var mtadGenCmdPlatform string
@@ -21,7 +22,7 @@ var mtadGenCmd = &cobra.Command{
2122
Long: "Generates a deployment descriptor ('mtad.yaml') file from the 'mta.yaml' file",
2223
Args: cobra.NoArgs,
2324
RunE: func(cmd *cobra.Command, args []string) error {
24-
err := artifacts.ExecuteMtadGen(mtadGenCmdSrc, mtadGenCmdTrg, mtadGenCmdExtensions, mtadGenCmdPlatform, os.Getwd)
25+
err := artifacts.ExecuteMtadGen(mtadGenCmdSrc, mtadGenCmdMtaYamlFilename, mtadGenCmdTrg, mtadGenCmdExtensions, mtadGenCmdPlatform, os.Getwd)
2526
logError(err)
2627
return err
2728
},
@@ -33,6 +34,8 @@ func init() {
3334
// set flags of mtad gen command
3435
mtadGenCmd.Flags().StringVarP(&mtadGenCmdSrc, "source", "s", "",
3536
"The path to the MTA project; the current path is set as default")
37+
mtadGenCmd.Flags().StringVarP(&mtadGenCmdMtaYamlFilename, "filename", "f", "",
38+
"The mta yaml filename of MTA project; the mta.yaml is is set as default")
3639
mtadGenCmd.Flags().StringVarP(&mtadGenCmdTrg, "target", "t",
3740
"", "The path to the folder in which the 'mtad.yaml' file is generated; the current path is set as default")
3841
mtadGenCmd.Flags().StringSliceVarP(&mtadGenCmdExtensions, "extensions", "e", nil,

cmd/project.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
)
1010

1111
var projectBuildCmdSrc string
12+
var projectBuildCmdMtaYamlFilename string
1213
var projectBuildCmdTrg string
1314
var projectBuildCmdDesc string
1415
var projectBuildCmdExtensions []string
@@ -17,6 +18,8 @@ var projectBuildCmdPhase string
1718
func init() {
1819
projectBuildCmd.Flags().StringVarP(&projectBuildCmdSrc,
1920
"source", "s", "", "The path to the MTA project; the current path is set as default")
21+
projectBuildCmd.Flags().StringVarP(&projectBuildCmdMtaYamlFilename,
22+
"filename", "f", "", "The mta yaml filename of MTA project; the mta.yaml is set as default")
2023
projectBuildCmd.Flags().StringVarP(&projectBuildCmdTrg,
2124
"target", "t", "", "The path to the folder in which the temporary artifacts of the project build are created; the current path is set as default")
2225
projectBuildCmd.Flags().StringVarP(&projectBuildCmdDesc,
@@ -33,7 +36,7 @@ var projectBuildCmd = &cobra.Command{
3336
Short: "Run the MTA project pre and post build commands",
3437
Args: cobra.NoArgs,
3538
RunE: func(cmd *cobra.Command, args []string) error {
36-
err := artifacts.ExecuteProjectBuild(projectBuildCmdSrc, projectBuildCmdTrg, projectBuildCmdDesc, projectBuildCmdExtensions, projectBuildCmdPhase, os.Getwd)
39+
err := artifacts.ExecuteProjectBuild(projectBuildCmdSrc, projectBuildCmdMtaYamlFilename, projectBuildCmdTrg, projectBuildCmdDesc, projectBuildCmdExtensions, projectBuildCmdPhase, os.Getwd)
3740
logError(err)
3841
return err
3942
},

cmd/provide.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,16 @@ import (
99
)
1010

1111
var provideModuleCmdSrc string
12+
var provideModuleCmdMtaYamlFileName string
1213
var provideModuleCmdDesc string
1314
var provideModuleCmdExtensions []string
1415

1516
// init - inits flags of provide module command
1617
func init() {
1718
provideModuleCmd.Flags().StringVarP(&provideModuleCmdSrc, "source", "s",
1819
"", "The path to the MTA project; the current path is set as the default")
20+
provideModuleCmd.Flags().StringVarP(&provideModuleCmdMtaYamlFileName, "filename", "f",
21+
"", "The path to the MTA project; the current path is set as the default")
1922
provideModuleCmd.Flags().StringVarP(&provideModuleCmdDesc, "desc", "d", "",
2023
`The MTA descriptor; supported values: "dev" (development descriptor, default value) and "dep" (deployment descriptor)`)
2124
provideModuleCmd.Flags().StringSliceVarP(&provideModuleCmdExtensions, "extensions", "e", nil,
@@ -29,7 +32,7 @@ var provideModuleCmd = &cobra.Command{
2932
Long: "Provides list of MTA project modules sorted by their dependencies",
3033
Args: cobra.NoArgs,
3134
RunE: func(cmd *cobra.Command, args []string) error {
32-
err := buildops.ProvideModules(provideModuleCmdSrc, provideModuleCmdDesc, provideModuleCmdExtensions, os.Getwd)
35+
err := buildops.ProvideModules(provideModuleCmdSrc, provideModuleCmdMtaYamlFileName, provideModuleCmdDesc, provideModuleCmdExtensions, os.Getwd)
3336
logError(err)
3437
return err
3538
},

internal/archive/archive_msg.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ const (
1616
// InitLocFailedOnWorkDirMsg - message raised on getting working directory when initializing location
1717
InitLocFailedOnWorkDirMsg = `could not get working directory`
1818

19+
InvalidMtaYamlFilenameMsg = `the "%s" is not a valid mta yaml file name;`
20+
1921
// InvalidDescMsg - invalid descriptor
2022
InvalidDescMsg = `the "%s" descriptor is invalid; expected one of the following values: Dev, Dep`
2123

0 commit comments

Comments
 (0)