Skip to content

Commit

Permalink
messages fixes (#716)
Browse files Browse the repository at this point in the history
* build module with multiple modules and dependencies - not final

* logs added

* added dependencies processing

* fix linter

* code review fixes

* small fix

* code review fixes

* fix linter

* code review fixes

* more code review fixes

* code review fixes

* fixes after Natalia's review

* message fix
  • Loading branch information
allaVolkov authored Mar 25, 2020
1 parent fdada29 commit dfbb2e4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions cmd/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ func init() {
// soloBuildModuleCmd - Build module command used stand alone
var soloBuildModuleCmd = &cobra.Command{
Use: "module-build",
Short: "Builds module according to configurations in the MTA development descriptor (mta.yaml)",
Long: "Builds module according to configurations in the MTA development descriptor (mta.yaml)",
Short: "Builds specified modules according to configurations in the MTA development descriptor (mta.yaml)",
Long: "Builds specified modules according to configurations in the MTA development descriptor (mta.yaml)",
Args: cobra.MaximumNArgs(4),
RunE: func(cmd *cobra.Command, args []string) error {
err := artifacts.ExecuteSoloBuild(soloBuildModuleCmdSrc, soloBuildModuleCmdTrg, soloBuildModuleCmdExtensions, soloBuildModuleCmdModules, soloBuildModuleCmdAllDependencies, os.Getwd)
Expand Down
4 changes: 2 additions & 2 deletions internal/artifacts/artifacts_msg.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ const (
buildFinishedMsg = `finished building the "%s" module`
multiBuildFinishedMsg = `the build of the selected modules is complete`
buildFailedMsg = `could not build the "%s" module`
multiBuildWithPathsConflictMsg = `could not save the build results of modules "%s" and "%s" in the "%s" target folder because of conflicting naming; use the "build-artifact-name" build parameter to create a unique name for each module`
multiBuildFailedMsg = `could not build the modules selected`
multiBuildWithPathsConflictMsg = `could not save the build results of modules "%s" and "%s" in the specified target folder (%s) because of conflicting naming (%s); use the "build-artifact-name" build parameter to create a unique name for each module's build result or use the default target folder`
multiBuildFailedMsg = `could not build the selected modules`
buildFailedOnCommandsMsg = `could not get commands for the "%s" module`
buildFailedOnDepsMsg = `could not process dependencies for the "%s" module`
buildResultMsg = `the build results of the "%s" module will be packaged and saved in the "%s" folder`
Expand Down
10 changes: 5 additions & 5 deletions internal/artifacts/module_arch.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,10 @@ func ExecuteSoloBuild(source, target string, extensions []string, modulesNames [

sortedModules := sortModules(allModulesSorted, selectedModulesWithDependenciesMap)

if allDependencies && len(modulesNames) > 1 {
logs.Logger.Infof(buildWithDependenciesMsg, "'"+strings.Join(sortedModules, `',' `)+"'")
} else if len(modulesNames) > 1 {
logs.Logger.Infof(multiBuildMsg, "'"+strings.Join(sortedModules, `',' `)+"'")
if allDependencies && len(sortedModules) > 1 {
logs.Logger.Infof(buildWithDependenciesMsg, `"`+strings.Join(sortedModules, `","`)+`"`)
} else if len(sortedModules) > 1 {
logs.Logger.Infof(multiBuildMsg, `"`+strings.Join(sortedModules, `", "`)+`"`)
}

err = buildModules(sourceDir, target, extensions, sortedModules, selectedModulesMap, wdGetter)
Expand Down Expand Up @@ -230,7 +230,7 @@ func checkBuildResultsConflicts(mtaObj *mta.MTA, source, target string, extensio
}
moduleName, pathInUse := resultPathModuleNameMap[targetArtifact]
if pathInUse {
return errors.Errorf(multiBuildWithPathsConflictMsg, module.Name, moduleName, targetArtifact)
return errors.Errorf(multiBuildWithPathsConflictMsg, module.Name, moduleName, moduleLoc.GetTarget(), filepath.Base(targetArtifact))
}
resultPathModuleNameMap[targetArtifact] = module.Name
}
Expand Down

0 comments on commit dfbb2e4

Please sign in to comment.