From 54f6daf04ba6464fe406227402b03983aa950f5e Mon Sep 17 00:00:00 2001 From: tal-sapan Date: Sun, 17 Nov 2019 17:35:37 +0200 Subject: [PATCH] Support using verbose makefile in mbt build + allow to set number of jobs (#577) * Support using verbose makefile in mbt build + allow to set number of jobs * Add message when starting and finishing module build --- cmd/cmd_test.go | 12 +--- cmd/init.go | 33 +++++---- cmd/init_test.go | 6 +- cmd/module.go | 22 +++--- cmd/module_test.go | 12 ++-- integration/cloud_mta_build_tool_test.go | 70 +++++++++++++++---- .../moduledep/client2/client_package.json | 34 +++++++++ integration/testdata/moduledep/mta.yaml | 10 ++- internal/artifacts/artifacts_msg.go | 1 + internal/artifacts/module_arch.go | 1 + internal/artifacts/project.go | 35 +++++++--- internal/artifacts/project_test.go | 38 +++++++++- internal/proc/cores.go | 19 ----- internal/proc/cores_test.go | 12 ---- internal/proc/proc_suite_test.go | 13 ---- internal/tpl/base_pre_default.go | 2 +- internal/tpl/base_pre_default.txt | 4 -- internal/tpl/base_pre_verbose.go | 2 +- internal/tpl/base_pre_verbose.txt | 3 - internal/tpl/make_verbose.go | 2 +- internal/tpl/make_verbose.txt | 2 + internal/tpl/makefile.go | 9 ++- internal/tpl/makefile_test.go | 35 ++++------ .../{ExpectedMakeFileMac => ExpectedMakeFile} | 5 +- internal/tpl/testdata/ExpectedMakeFileLinux | 61 ---------------- internal/tpl/testdata/ExpectedMakeFileWindows | 61 ---------------- internal/tpl/testdata/WrongMakeTmpl.txt | 5 -- 27 files changed, 232 insertions(+), 277 deletions(-) create mode 100644 integration/testdata/moduledep/client2/client_package.json delete mode 100644 internal/proc/cores.go delete mode 100644 internal/proc/cores_test.go delete mode 100644 internal/proc/proc_suite_test.go rename internal/tpl/testdata/{ExpectedMakeFileMac => ExpectedMakeFile} (93%) delete mode 100644 internal/tpl/testdata/ExpectedMakeFileLinux delete mode 100644 internal/tpl/testdata/ExpectedMakeFileWindows diff --git a/cmd/cmd_test.go b/cmd/cmd_test.go index 20255debe..669539732 100644 --- a/cmd/cmd_test.go +++ b/cmd/cmd_test.go @@ -1,32 +1,26 @@ package commands import ( - dir "github.com/SAP/cloud-mta-build-tool/internal/archive" "os" "path/filepath" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" + dir "github.com/SAP/cloud-mta-build-tool/internal/archive" "github.com/SAP/cloud-mta-build-tool/internal/logs" ) var _ = Describe("Commands", func() { BeforeEach(func() { - mtadCmdTrg = getTestPath("result") - metaCmdTrg = getTestPath("result") - mtarCmdTrg = getTestPath("result") - packCmdTrg = getTestPath("result") - buildCmdTrg = getTestPath("result") cleanupCmdTrg = getTestPath("result") logs.Logger = logs.NewLogger() - err := dir.CreateDirIfNotExist(mtadCmdTrg) - Ω(err).Should(Succeed()) + Ω(dir.CreateDirIfNotExist(cleanupCmdTrg)).Should(Succeed()) }) AfterEach(func() { - os.RemoveAll(mtadCmdTrg) + Ω(os.RemoveAll(cleanupCmdTrg)).Should(Succeed()) }) var _ = Describe("cleanup command", func() { diff --git a/cmd/init.go b/cmd/init.go index 7775f5044..f4fa211ff 100644 --- a/cmd/init.go +++ b/cmd/init.go @@ -1,6 +1,7 @@ package commands import ( + "fmt" "os" "time" @@ -22,12 +23,14 @@ var initCmdExtensions []string var initCmdMode string // flags of build command -var buildProjectCmdSrc string -var buildProjectCmdTrg string -var buildProjectCmdExtensions []string -var buildProjectCmdMtar = "*" -var buildProjectCmdPlatform string -var buildProjectCmdStrict bool +var buildCmdSrc string +var buildCmdTrg string +var buildCmdExtensions []string +var buildCmdMtar = "*" +var buildCmdPlatform string +var buildCmdStrict bool +var buildCmdMode string +var buildCmdJobs int func init() { // set flags for init command @@ -39,12 +42,16 @@ func init() { initCmd.Flags().BoolP("help", "h", false, `Displays detailed information about the "init" command`) // set flags of build command - buildCmd.Flags().StringVarP(&buildProjectCmdSrc, "source", "s", "", "The path to the MTA project; the current path is set as the default") - buildCmd.Flags().StringVarP(&buildProjectCmdTrg, "target", "t", "", "The path to the results folder; the current path is set as the default") - buildCmd.Flags().StringSliceVarP(&buildProjectCmdExtensions, "extensions", "e", nil, "The MTA extension descriptors") - buildCmd.Flags().StringVarP(&buildProjectCmdMtar, "mtar", "", "", "The file name of the generated archive file") - buildCmd.Flags().StringVarP(&buildProjectCmdPlatform, "platform", "p", "cf", `The deployment platform; supported platforms: "cf", "xsa", "neo"`) - buildCmd.Flags().BoolVarP(&buildProjectCmdStrict, "strict", "", true, `If set to true, duplicated fields and fields not defined in the "mta.yaml" schema are reported as errors; if set to false, they are reported as warnings`) + buildCmd.Flags().StringVarP(&buildCmdSrc, "source", "s", "", "The path to the MTA project; the current path is set as the default") + buildCmd.Flags().StringVarP(&buildCmdTrg, "target", "t", "", "The path to the results folder; the current path is set as the default") + buildCmd.Flags().StringSliceVarP(&buildCmdExtensions, "extensions", "e", nil, "The MTA extension descriptors") + buildCmd.Flags().StringVarP(&buildCmdMtar, "mtar", "", "", "The file name of the generated archive file") + buildCmd.Flags().StringVarP(&buildCmdPlatform, "platform", "p", "cf", `The deployment platform; supported platforms: "cf", "xsa", "neo"`) + buildCmd.Flags().BoolVarP(&buildCmdStrict, "strict", "", true, `If set to true, duplicated fields and fields not defined in the "mta.yaml" schema are reported as errors; if set to false, they are reported as warnings`) + buildCmd.Flags().StringVarP(&buildCmdMode, "mode", "m", "", `(beta) The mode of the Makefile generation; supported values: "default" and "verbose"`) + _ = buildCmd.Flags().MarkHidden("mode") + buildCmd.Flags().IntVarP(&buildCmdJobs, "jobs", "j", 0, fmt.Sprintf(`The number of Make recipes to be executed simultaneously when building the project; if 0 or less, the number of available CPUs (limited to %d) is used. Used only in verbose mode.`, artifacts.MaxMakeParallel)) + _ = buildCmd.Flags().MarkHidden("jobs") buildCmd.Flags().BoolP("help", "h", false, `Displays detailed information about the "build" command`) } @@ -71,7 +78,7 @@ var buildCmd = &cobra.Command{ makefileTmp := "Makefile_" + time.Now().Format("20060102150405") + ".mta" // Generate build script // 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 - err := artifacts.ExecBuild(makefileTmp, buildProjectCmdSrc, buildProjectCmdTrg, buildProjectCmdExtensions, "", buildProjectCmdMtar, buildProjectCmdPlatform, buildProjectCmdStrict, os.Getwd, exec.Execute, false) + err := artifacts.ExecBuild(makefileTmp, buildCmdSrc, buildCmdTrg, buildCmdExtensions, buildCmdMode, buildCmdMtar, buildCmdPlatform, buildCmdStrict, buildCmdJobs, os.Getwd, exec.Execute, false) return err }, SilenceUsage: true, diff --git a/cmd/init_test.go b/cmd/init_test.go index 577ada06b..07c8c7797 100644 --- a/cmd/init_test.go +++ b/cmd/init_test.go @@ -42,9 +42,9 @@ var _ = Describe("Build", func() { } }) It("Failure - wrong platform", func() { - buildProjectCmdSrc = getTestPath("mta") - buildProjectCmdTrg = getTestPath("result") - buildProjectCmdPlatform = "xxx" + buildCmdSrc = getTestPath("mta") + buildCmdTrg = getTestPath("result") + buildCmdPlatform = "xxx" err := buildCmd.RunE(nil, []string{}) Ω(err).Should(HaveOccurred()) }) diff --git a/cmd/module.go b/cmd/module.go index 491c59131..d43f40019 100644 --- a/cmd/module.go +++ b/cmd/module.go @@ -16,11 +16,11 @@ var packCmdModule string var packCmdPlatform string // flags of build command -var buildCmdSrc string -var buildCmdTrg string -var buildCmdExtensions []string -var buildCmdModule string -var buildCmdPlatform string +var buildModuleCmdSrc string +var buildModuleCmdTrg string +var buildModuleCmdExtensions []string +var buildModuleCmdModule string +var buildModuleCmdPlatform string func init() { @@ -37,15 +37,15 @@ func init() { `The deployment platform; supported platforms: "cf", "xsa", "neo"`) // sets the flags of the command build module - buildModuleCmd.Flags().StringVarP(&buildCmdSrc, "source", "s", "", + buildModuleCmd.Flags().StringVarP(&buildModuleCmdSrc, "source", "s", "", "The path to the MTA project; the current path is set as the default") - buildModuleCmd.Flags().StringVarP(&buildCmdTrg, "target", "t", "", + buildModuleCmd.Flags().StringVarP(&buildModuleCmdTrg, "target", "t", "", "The path to the results folder; the current path is set as the default") - buildModuleCmd.Flags().StringSliceVarP(&buildCmdExtensions, "extensions", "e", nil, + buildModuleCmd.Flags().StringSliceVarP(&buildModuleCmdExtensions, "extensions", "e", nil, "The MTA extension descriptors") - buildModuleCmd.Flags().StringVarP(&buildCmdModule, "module", "m", "", + buildModuleCmd.Flags().StringVarP(&buildModuleCmdModule, "module", "m", "", "The name of the module") - buildModuleCmd.Flags().StringVarP(&buildCmdPlatform, "platform", "p", "cf", + buildModuleCmd.Flags().StringVarP(&buildModuleCmdPlatform, "platform", "p", "cf", `The deployment platform; supported platforms: "cf", "xsa", "neo"`) } @@ -56,7 +56,7 @@ var buildModuleCmd = &cobra.Command{ Long: "Builds module and archives its artifacts", Args: cobra.NoArgs, RunE: func(cmd *cobra.Command, args []string) error { - err := artifacts.ExecuteBuild(buildCmdSrc, buildCmdTrg, buildCmdExtensions, buildCmdModule, buildCmdPlatform, os.Getwd) + err := artifacts.ExecuteBuild(buildModuleCmdSrc, buildModuleCmdTrg, buildModuleCmdExtensions, buildModuleCmdModule, buildModuleCmdPlatform, os.Getwd) logError(err) return err }, diff --git a/cmd/module_test.go b/cmd/module_test.go index 4cc5dc0e1..894ca8069 100644 --- a/cmd/module_test.go +++ b/cmd/module_test.go @@ -23,7 +23,7 @@ var _ = Describe("Commands", func() { metaCmdTrg = getTestPath("result") mtarCmdTrg = getTestPath("result") packCmdTrg = getTestPath("result") - buildCmdTrg = getTestPath("result") + buildModuleCmdTrg = getTestPath("result") cleanupCmdTrg = getTestPath("result") logs.Logger = logs.NewLogger() err := os.Mkdir(mtadCmdTrg, os.ModePerm) @@ -98,12 +98,12 @@ builders: }) It("build Command", func() { - buildCmdModule = "node-js" - buildCmdSrc = getTestPath("mta") - buildCmdPlatform = "cf" - ep := dir.Loc{SourcePath: buildCmdSrc, TargetPath: buildCmdTrg} + buildModuleCmdModule = "node-js" + buildModuleCmdSrc = getTestPath("mta") + buildModuleCmdPlatform = "cf" + ep := dir.Loc{SourcePath: buildModuleCmdSrc, TargetPath: buildModuleCmdTrg} Ω(buildModuleCmd.RunE(nil, []string{})).Should(Succeed()) - Ω(ep.GetTargetModuleZipPath(buildCmdModule)).Should(BeAnExistingFile()) + Ω(ep.GetTargetModuleZipPath(buildModuleCmdModule)).Should(BeAnExistingFile()) }) }) }) diff --git a/integration/cloud_mta_build_tool_test.go b/integration/cloud_mta_build_tool_test.go index a97f9f8da..ad73c3990 100644 --- a/integration/cloud_mta_build_tool_test.go +++ b/integration/cloud_mta_build_tool_test.go @@ -18,6 +18,7 @@ import ( "time" . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/extensions/table" . "github.com/onsi/gomega" dir "github.com/SAP/cloud-mta-build-tool/internal/archive" @@ -375,27 +376,60 @@ modules: Ω(filepath.Join(dir, "testdata", "mta_demo", "mta_archives", demoArchiveName)).Should(BeAnExistingFile()) }) - It("Generate Verbose Makefile with module dependencies", func() { + Describe("cleanup after tests", func() { dir, _ := os.Getwd() path := filepath.Join(dir, "testdata", "moduledep") archivePath := filepath.Join(path, "mta_archives", "f1_0.0.1.mtar") tempZipPath := filepath.Join(path, "mta_archives", "data.zip") - Ω(os.RemoveAll(filepath.Join(path, "Makefile.mta"))).Should(Succeed()) - Ω(os.RemoveAll(archivePath)).Should(Succeed()) + AfterEach(func() { + Ω(os.RemoveAll(filepath.Join(path, "Makefile.mta"))).Should(Succeed()) + Ω(os.RemoveAll(filepath.Join(path, "mta_archives"))).Should(Succeed()) + Ω(os.RemoveAll(filepath.Join(path, "public", "client"))).Should(Succeed()) + Ω(os.RemoveAll(filepath.Join(path, "public", "client2"))).Should(Succeed()) + }) + + It("Generate Verbose Makefile with module dependencies", func() { + bin := filepath.FromSlash(binPath) + cmdOut, errString, _ := execute(bin, "init -m=verbose", path) + Ω(errString).Should(Equal("")) + Ω(cmdOut).ShouldNot(BeNil()) + // Check the MakeFile was generated + Ω(filepath.Join(path, "Makefile.mta")).Should(BeAnExistingFile()) + + // Generate mtar + bin = filepath.FromSlash("make") + execute(bin, "-f Makefile.mta p=cf", path) + // Check the archive was generated + Ω(archivePath).Should(BeAnExistingFile()) + validateMtaArchiveContents([]string{"module_with_dep/", "module_with_dep/data.zip"}, archivePath) + + // Extract data.zip and check its content + err := extractFileFromZip(archivePath, "module_with_dep/data.zip", tempZipPath) + Ω(err).Should(Succeed()) + validateArchiveContents([]string{"package.json", "client/", "client/client_package.json", "client2/", "client2/client_package.json"}, tempZipPath) + }) + }) + }) + + Describe("cleanup after tests", func() { + dir, _ := os.Getwd() + path := filepath.Join(dir, "testdata", "moduledep") + archivePath := filepath.Join(path, "mta_archives", "f1_0.0.1.mtar") + tempZipPath := filepath.Join(path, "mta_archives", "data.zip") + + AfterEach(func() { + Ω(os.RemoveAll(filepath.Join(path, "mta_archives"))).Should(Succeed()) Ω(os.RemoveAll(filepath.Join(path, "public", "client"))).Should(Succeed()) - Ω(os.RemoveAll(tempZipPath)).Should(Succeed()) + Ω(os.RemoveAll(filepath.Join(path, "public", "client2"))).Should(Succeed()) + }) + DescribeTable("Build MTA with module dependencies", func(additionalBuildOpts []string) { bin := filepath.FromSlash(binPath) - cmdOut, errString, _ := execute(bin, "init -m=verbose", path) + cmdOut, errString, _ := executeWithArgs(bin, path, append([]string{"build"}, additionalBuildOpts...)...) Ω(errString).Should(Equal("")) Ω(cmdOut).ShouldNot(BeNil()) - // Check the MakeFile was generated - Ω(filepath.Join(path, "Makefile.mta")).Should(BeAnExistingFile()) - // Generate mtar - bin = filepath.FromSlash("make") - execute(bin, "-f Makefile.mta p=cf", path) // Check the archive was generated Ω(archivePath).Should(BeAnExistingFile()) validateMtaArchiveContents([]string{"module_with_dep/", "module_with_dep/data.zip"}, archivePath) @@ -403,8 +437,12 @@ modules: // Extract data.zip and check its content err := extractFileFromZip(archivePath, "module_with_dep/data.zip", tempZipPath) Ω(err).Should(Succeed()) - validateArchiveContents([]string{"package.json", "client/", "client/client_package.json"}, tempZipPath) - }) + validateArchiveContents([]string{"package.json", "client/", "client/client_package.json", "client2/", "client2/client_package.json"}, tempZipPath) + }, + Entry("Non-verbose build", []string{}), + Entry("Parallel verbose build", []string{"--mode=verbose"}), + Entry("Serial verbose build", []string{"--mode=verbose", "--jobs=1"}), + ) }) var _ = Describe("MBT gen commands", func() { @@ -731,8 +769,12 @@ func executeEverySecond(bin string, args string, path string) (string, error str // Execute commands and get outputs func execute(bin string, args string, path string) (output string, error string, cmd *exec.Cmd) { + return executeWithArgs(bin, path, strings.Split(args, " ")...) +} + +func executeWithArgs(bin string, path string, args ...string) (output string, error string, cmd *exec.Cmd) { // Provide list of commands - cmd = exec.Command(bin, strings.Split(args, " ")...) + cmd = exec.Command(bin, args...) // bin path cmd.Dir = path // std out @@ -751,4 +793,4 @@ func execute(bin string, args string, path string) (output string, error string, fmt.Println(err) } return stdoutBuf.String(), stdErrBuf.String(), cmd -} +} \ No newline at end of file diff --git a/integration/testdata/moduledep/client2/client_package.json b/integration/testdata/moduledep/client2/client_package.json new file mode 100644 index 000000000..d00a2b3d5 --- /dev/null +++ b/integration/testdata/moduledep/client2/client_package.json @@ -0,0 +1,34 @@ +{ + "name": "f1.client", + "title": "f1", + "version": "0.0.1", + "description": "", + "scripts": { + "postinstall": "node ./scripts/bundle.js && npm run lint", + "lint": "node ./node_modules/eslint/bin/eslint . --ext=.js,.json" + }, + "devDependencies": { + "eslint": "4.12.1", + "@sap/eslint-plugin-webide-feature": "1.3.15", + "@sap-webide/webide-client-tools": "latest" + }, + "bundledPlugins": { + "p1": "file:src/p1" + }, + "files": [ + "i18n", + "src", + "config-preload.js", + "config-preload.json", + "package.json" + ], + "webidePreloads": { + "js": [ + "config-preload.js", + "i18n/config-preload.js" + ], + "config": [ + "config-preload.json" + ] + } +} diff --git a/integration/testdata/moduledep/mta.yaml b/integration/testdata/moduledep/mta.yaml index 41ace10a9..a605ebb6b 100644 --- a/integration/testdata/moduledep/mta.yaml +++ b/integration/testdata/moduledep/mta.yaml @@ -12,10 +12,18 @@ modules: - name: m2 artifacts: ["*"] target-path: "client" + - name: m3 + artifacts: ["*"] + target-path: "client2" - name: m2 type: html5 path: client build-parameters: builder: zip supported-platforms: [] - + - name: m3 + type: html5 + path: client2 + build-parameters: + builder: zip + supported-platforms: [] diff --git a/internal/artifacts/artifacts_msg.go b/internal/artifacts/artifacts_msg.go index 6bbc41826..609cc0c60 100644 --- a/internal/artifacts/artifacts_msg.go +++ b/internal/artifacts/artifacts_msg.go @@ -34,6 +34,7 @@ const ( genMTARArchMsg = `could not generate the MTA archive when archiving` buildMsg = `building the "%s" module...` + buildFinishedMsg = `finished building the "%s" module` buildFailedMsg = `could not build the "%s" module` buildFailedOnCommandsMsg = `could not get commands for the "%s" module` buildFailedOnDepsMsg = `could not process dependencies for the "%s" module` diff --git a/internal/artifacts/module_arch.go b/internal/artifacts/module_arch.go index 18fe0120b..7cef25a36 100644 --- a/internal/artifacts/module_arch.go +++ b/internal/artifacts/module_arch.go @@ -36,6 +36,7 @@ func ExecuteBuild(source, target string, extensions []string, moduleName, platfo if err != nil { return err } + logs.Logger.Infof(buildFinishedMsg, moduleName) return nil } diff --git a/internal/artifacts/project.go b/internal/artifacts/project.go index 939002891..716ec6406 100644 --- a/internal/artifacts/project.go +++ b/internal/artifacts/project.go @@ -4,6 +4,7 @@ import ( "fmt" "os" "path/filepath" + "runtime" "strconv" "github.com/pkg/errors" @@ -18,22 +19,23 @@ import ( const ( copyInParallel = false + // Maximum number of parallel makefile jobs if the parameter is not set by the user + MaxMakeParallel = 8 ) // ExecBuild - Execute MTA project build -func ExecBuild(makefileTmp, buildProjectCmdSrc, buildProjectCmdTrg string, extensions []string, buildProjectCmdMode, buildProjectCmdMtar, buildProjectCmdPlatform string, buildProjectCmdStrict bool, wdGetter func() (string, error), wdExec func([][]string, bool) error, useDefaultMbt bool) error { +func ExecBuild(makefileTmp, source, target string, extensions []string, mode, mtar, platform string, strict bool, jobs int, wdGetter func() (string, error), wdExec func([][]string, bool) error, useDefaultMbt bool) error { // Generate build script - err := tpl.ExecuteMake(buildProjectCmdSrc, "", extensions, makefileTmp, buildProjectCmdMode, wdGetter, useDefaultMbt) + err := tpl.ExecuteMake(source, "", extensions, makefileTmp, mode, wdGetter, useDefaultMbt) if err != nil { return err } - if buildProjectCmdTrg == "" { - err = wdExec([][]string{{buildProjectCmdSrc, "make", "-f", makefileTmp, "p=" + buildProjectCmdPlatform, "mtar=" + buildProjectCmdMtar, "strict=" + strconv.FormatBool(buildProjectCmdStrict), "mode=" + buildProjectCmdMode}}, false) - } else { - err = wdExec([][]string{{buildProjectCmdSrc, "make", "-f", makefileTmp, "p=" + buildProjectCmdPlatform, "mtar=" + buildProjectCmdMtar, `t="` + buildProjectCmdTrg + `"`, "strict=" + strconv.FormatBool(buildProjectCmdStrict), "mode=" + buildProjectCmdMode}}, false) - } + + cmdParams := createMakeCommand(makefileTmp, source, target, mode, mtar, platform, strict, jobs, runtime.NumCPU) + err = wdExec([][]string{cmdParams}, false) + // Remove temporary Makefile - removeError := os.Remove(filepath.Join(buildProjectCmdSrc, filepath.FromSlash(makefileTmp))) + removeError := os.Remove(filepath.Join(source, filepath.FromSlash(makefileTmp))) if removeError != nil { removeError = errors.Wrapf(removeError, removeFailedMsg, makefileTmp) } @@ -47,6 +49,23 @@ func ExecBuild(makefileTmp, buildProjectCmdSrc, buildProjectCmdTrg string, exten return removeError } +func createMakeCommand(makefileName, source, target, mode, mtar, platform string, strict bool, jobs int, numCPUGetter func() int) []string { + cmdParams := []string{source, "make", "-f", makefileName, "p=" + platform, "mtar=" + mtar, "strict=" + strconv.FormatBool(strict), "mode=" + mode} + if target != "" { + cmdParams = append(cmdParams, `t="`+target+`"`) + } + if tpl.IsVerboseMode(mode) { + if jobs <= 0 { + jobs = numCPUGetter() + if jobs > MaxMakeParallel { + jobs = MaxMakeParallel + } + } + cmdParams = append(cmdParams, fmt.Sprintf("-j%d", jobs)) + } + return cmdParams +} + // ExecuteProjectBuild - execute pre or post phase of project build func ExecuteProjectBuild(source, target, descriptor string, extensions []string, phase string, getWd func() (string, error)) error { if phase != "pre" && phase != "post" { diff --git a/internal/artifacts/project_test.go b/internal/artifacts/project_test.go index 95d6e4634..45efab34a 100644 --- a/internal/artifacts/project_test.go +++ b/internal/artifacts/project_test.go @@ -7,6 +7,7 @@ import ( "path/filepath" . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/extensions/table" . "github.com/onsi/gomega" "github.com/SAP/cloud-mta-build-tool/internal/archive" @@ -52,14 +53,14 @@ var _ = Describe("Project", func() { Ω(os.RemoveAll(getTestPath("result"))).Should(Succeed()) }) It("Sanity", func() { - err := ExecBuild("Makefile_tmp.mta", getTestPath("mta_with_zipped_module"), getResultPath(), nil, "", "", "cf", true, os.Getwd, func(strings [][]string, b bool) error { + err := ExecBuild("Makefile_tmp.mta", getTestPath("mta_with_zipped_module"), getResultPath(), nil, "", "", "cf", true, 0, os.Getwd, func(strings [][]string, b bool) error { return nil }, true) Ω(err).Should(Succeed()) Ω(filepath.Join(getResultPath(), "Makefile_tmp.mta")).ShouldNot(BeAnExistingFile()) }) It("Wrong - no platform", func() { - err := ExecBuild("Makefile_tmp.mta", getTestPath("mta_with_zipped_module"), getResultPath(), nil, "", "", "", true, os.Getwd, func(strings [][]string, b bool) error { + err := ExecBuild("Makefile_tmp.mta", getTestPath("mta_with_zipped_module"), getResultPath(), nil, "", "", "", true, 0, os.Getwd, func(strings [][]string, b bool) error { return fmt.Errorf("failure") }, true) Ω(err).Should(HaveOccurred()) @@ -216,4 +217,37 @@ builders: }) }) + var _ = DescribeTable("createMakeCommand", func(target, mode string, strict bool, jobs int, cpus int, additionalExpectedArgs []string) { + command := createMakeCommand("Makefile_tmp", "./src", target, mode, "result.mtar", "cf", strict, jobs, func() int { + return cpus + }) + Ω(len(command)).To(Equal(8+len(additionalExpectedArgs)), "number of command arguments") + // The first arguments must be in this order + Ω(command[0]).To(Equal("./src")) + Ω(command[1]).To(Equal("make")) + Ω(command[2]).To(Equal("-f")) + Ω(command[3]).To(Equal("Makefile_tmp")) + + Ω(command).To(ContainElement("p=cf")) + Ω(command).To(ContainElement("mtar=result.mtar")) + Ω(command).To(ContainElement(fmt.Sprintf("strict=%v", strict))) + Ω(command).To(ContainElement(fmt.Sprintf("mode=%s", mode))) + + for _, arg := range additionalExpectedArgs { + Ω(command).To(ContainElement(arg)) + } + }, + Entry("non-verbose without target", "", "", true, 0, 2, nil), + Entry("non-verbose with target", "./trg", "", false, 0, 2, []string{`t="./trg"`}), + Entry("non-verbose with specified jobs", "", "", true, 2, 4, nil), + Entry("verbose without target and without specified jobs, with less than the max number of CPUs", "", "verbose", false, 0, 2, []string{"-j2"}), + Entry("verbose with target and without specified jobs, with more than the max number of CPUs", "./trg", "verbose", true, 0, MaxMakeParallel+10, []string{`t="./trg"`, fmt.Sprintf("-j%d", MaxMakeParallel)}), + Entry("verbose with specified jobs less than the number of CPUs", "", "verbose", false, 3, 5, []string{"-j3"}), + Entry("verbose with specified jobs less than the max number of CPUs", "", "verbose", false, 3, 20, []string{"-j3"}), + Entry("verbose with specified jobs more than the number of CPUs", "", "v", true, 3, 1, []string{"-j3"}), + Entry("verbose with specified jobs more than the max number of CPUs and less than the number of CPUs", "", "verbose", false, 20, 25, []string{"-j20"}), + Entry("verbose with specified jobs more than the max number of CPUs and number of CPUs", "", "v", false, 20, 15, []string{"-j20"}), + Entry("verbose with negative specified jobs", "", "verbose", true, -1, 3, []string{"-j3"}), + Entry("verbose with negative specified jobs and more than the max number of CPUs", "", "verbose", true, -1, MaxMakeParallel+5, []string{fmt.Sprintf("-j%d", MaxMakeParallel)}), + ) }) diff --git a/internal/proc/cores.go b/internal/proc/cores.go deleted file mode 100644 index e8819be82..000000000 --- a/internal/proc/cores.go +++ /dev/null @@ -1,19 +0,0 @@ -package proc - -import "runtime" - -// Proc - platform dependent commands and flags -type Proc struct { - NPROCS string - MAKEFLAGS string -} - -// OsCore - Get available cores according to the running OS -func OsCore() Proc { - osProcMap := map[string]Proc{ - "linux": {`NPROCS = $(shell grep -c 'processor' /proc/cpuinfo)`, `MAKEFLAGS += -j`}, - "darwin": {`NPROCS = $(sysctl -n hw.ncpu)`, `MAKEFLAGS += -j`}, - "windows": {`NPROCS = $(shell echo %NUMBER_OF_PROCESSORS%)`, `MAKEFLAGS += -j`}, - } - return osProcMap[runtime.GOOS] -} diff --git a/internal/proc/cores_test.go b/internal/proc/cores_test.go deleted file mode 100644 index 1aca52471..000000000 --- a/internal/proc/cores_test.go +++ /dev/null @@ -1,12 +0,0 @@ -package proc - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" -) - -var _ = Describe("Proc", func() { - It("OsCore", func() { - Ω(OsCore().MAKEFLAGS).Should(Equal("MAKEFLAGS += -j")) - }) -}) diff --git a/internal/proc/proc_suite_test.go b/internal/proc/proc_suite_test.go deleted file mode 100644 index c19a0ea3a..000000000 --- a/internal/proc/proc_suite_test.go +++ /dev/null @@ -1,13 +0,0 @@ -package proc_test - -import ( - "testing" - - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" -) - -func TestProc(t *testing.T) { - RegisterFailHandler(Fail) - RunSpecs(t, "Proc Suite") -} diff --git a/internal/tpl/base_pre_default.go b/internal/tpl/base_pre_default.go index a0c5de1f6..fca6aa385 100644 --- a/internal/tpl/base_pre_default.go +++ b/internal/tpl/base_pre_default.go @@ -1,4 +1,4 @@ package tpl // basePreDefault - do not edit -var basePreDefault = []byte{0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x20, 0x3a, 0x3d, 0x20, 0x24, 0x28, 0x73, 0x68, 0x65, 0x6c, 0x6c, 0x20, 0x24, 0x28, 0x4d, 0x42, 0x54, 0x29, 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x20, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x20, 0x2d, 0x64, 0x3d, 0x64, 0x65, 0x76, 0x20, 0x7b, 0x7b, 0x2d, 0x20, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x41, 0x72, 0x67, 0x20, 0x22, 0x2d, 0x65, 0x22, 0x7d, 0x7d, 0x29, 0xa, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x20, 0x3a, 0x3d, 0x20, 0x24, 0x28, 0x73, 0x75, 0x62, 0x73, 0x74, 0x20, 0x5d, 0x2c, 0x2c, 0x24, 0x28, 0x73, 0x75, 0x62, 0x73, 0x74, 0x20, 0x5b, 0x2c, 0x2c, 0x24, 0x28, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x29, 0x29, 0x29, 0xa, 0x23, 0x20, 0x4c, 0x69, 0x73, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x61, 0x6c, 0x6c, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x65, 0x63, 0x69, 0x70, 0x65, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x62, 0x65, 0x20, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x64, 0x20, 0x64, 0x75, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x74, 0x68, 0x65, 0x20, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x20, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0xa, 0x2e, 0x50, 0x48, 0x4f, 0x4e, 0x59, 0x3a, 0x20, 0x61, 0x6c, 0x6c, 0x20, 0x70, 0x72, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x20, 0x70, 0x72, 0x65, 0x5f, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x20, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x20, 0x24, 0x28, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x29, 0x20, 0x70, 0x6f, 0x73, 0x74, 0x5f, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x20, 0x6d, 0x65, 0x74, 0x61, 0x20, 0x6d, 0x74, 0x61, 0x72, 0x20, 0x63, 0x6c, 0x65, 0x61, 0x6e, 0x75, 0x70, 0xa, 0x23, 0x20, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x20, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x20, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x20, 0x61, 0x6c, 0x6c, 0xa, 0x61, 0x6c, 0x6c, 0x3a, 0x20, 0x70, 0x72, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x20, 0x70, 0x72, 0x65, 0x5f, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x20, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x20, 0x24, 0x28, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x29, 0x20, 0x70, 0x6f, 0x73, 0x74, 0x5f, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x20, 0x6d, 0x65, 0x74, 0x61, 0x20, 0x6d, 0x74, 0x61, 0x72, 0x20, 0x63, 0x6c, 0x65, 0x61, 0x6e, 0x75, 0x70, 0xa, 0x63, 0x6f, 0x72, 0x65, 0x73, 0x3a, 0xa, 0x23, 0x20, 0x44, 0x65, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x65, 0x20, 0x4f, 0x53, 0x20, 0x63, 0x6f, 0x72, 0x65, 0x73, 0xa, 0x7b, 0x7b, 0x22, 0x5c, 0x74, 0x22, 0x7d, 0x7d, 0x7b, 0x7b, 0x20, 0x4f, 0x73, 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x4e, 0x50, 0x52, 0x4f, 0x43, 0x53, 0x20, 0x20, 0x7d, 0x7d, 0xa, 0x7b, 0x7b, 0x22, 0x5c, 0x74, 0x22, 0x7d, 0x7d, 0x7b, 0x7b, 0x20, 0x4f, 0x73, 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x4d, 0x41, 0x4b, 0x45, 0x46, 0x4c, 0x41, 0x47, 0x53, 0x20, 0x20, 0x7d, 0x7d, 0xa, 0x23, 0x20, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x20, 0x6d, 0x74, 0x61, 0x2e, 0x79, 0x61, 0x6d, 0x6c, 0xa, 0x70, 0x72, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x3a, 0xa, 0x7b, 0x7b, 0x22, 0x5c, 0x74, 0x22, 0x7d, 0x7d, 0x40, 0x24, 0x28, 0x4d, 0x42, 0x54, 0x29, 0x20, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x20, 0x2d, 0x72, 0x3d, 0x24, 0x7b, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x7d, 0x20, 0x2d, 0x78, 0x3d, 0x22, 0x70, 0x61, 0x74, 0x68, 0x73, 0x22, 0x20, 0x7b, 0x7b, 0x2d, 0x20, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x41, 0x72, 0x67, 0x20, 0x22, 0x2d, 0x65, 0x22, 0x7d, 0x7d, 0xa, 0x70, 0x72, 0x65, 0x5f, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x3a, 0x20, 0x70, 0x72, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0xa, 0x7b, 0x7b, 0x22, 0x5c, 0x74, 0x22, 0x7d, 0x7d, 0x40, 0x24, 0x28, 0x4d, 0x42, 0x54, 0x29, 0x20, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x20, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x20, 0x2d, 0x70, 0x3d, 0x70, 0x72, 0x65, 0x20, 0x7b, 0x7b, 0x2d, 0x20, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x41, 0x72, 0x67, 0x20, 0x22, 0x2d, 0x65, 0x22, 0x7d, 0x7d, 0xa, 0xa, 0xa} +var basePreDefault = []byte{0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x20, 0x3a, 0x3d, 0x20, 0x24, 0x28, 0x73, 0x68, 0x65, 0x6c, 0x6c, 0x20, 0x24, 0x28, 0x4d, 0x42, 0x54, 0x29, 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x20, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x20, 0x2d, 0x64, 0x3d, 0x64, 0x65, 0x76, 0x20, 0x7b, 0x7b, 0x2d, 0x20, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x41, 0x72, 0x67, 0x20, 0x22, 0x2d, 0x65, 0x22, 0x7d, 0x7d, 0x29, 0xa, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x20, 0x3a, 0x3d, 0x20, 0x24, 0x28, 0x73, 0x75, 0x62, 0x73, 0x74, 0x20, 0x5d, 0x2c, 0x2c, 0x24, 0x28, 0x73, 0x75, 0x62, 0x73, 0x74, 0x20, 0x5b, 0x2c, 0x2c, 0x24, 0x28, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x29, 0x29, 0x29, 0xa, 0x23, 0x20, 0x4c, 0x69, 0x73, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x61, 0x6c, 0x6c, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x65, 0x63, 0x69, 0x70, 0x65, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x62, 0x65, 0x20, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x64, 0x20, 0x64, 0x75, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x74, 0x68, 0x65, 0x20, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x20, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0xa, 0x2e, 0x50, 0x48, 0x4f, 0x4e, 0x59, 0x3a, 0x20, 0x61, 0x6c, 0x6c, 0x20, 0x70, 0x72, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x20, 0x70, 0x72, 0x65, 0x5f, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x20, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x20, 0x24, 0x28, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x29, 0x20, 0x70, 0x6f, 0x73, 0x74, 0x5f, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x20, 0x6d, 0x65, 0x74, 0x61, 0x20, 0x6d, 0x74, 0x61, 0x72, 0x20, 0x63, 0x6c, 0x65, 0x61, 0x6e, 0x75, 0x70, 0xa, 0x23, 0x20, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x20, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x20, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x20, 0x61, 0x6c, 0x6c, 0xa, 0x61, 0x6c, 0x6c, 0x3a, 0x20, 0x70, 0x72, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x20, 0x70, 0x72, 0x65, 0x5f, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x20, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x20, 0x24, 0x28, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x29, 0x20, 0x70, 0x6f, 0x73, 0x74, 0x5f, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x20, 0x6d, 0x65, 0x74, 0x61, 0x20, 0x6d, 0x74, 0x61, 0x72, 0x20, 0x63, 0x6c, 0x65, 0x61, 0x6e, 0x75, 0x70, 0xa, 0x23, 0x20, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x20, 0x6d, 0x74, 0x61, 0x2e, 0x79, 0x61, 0x6d, 0x6c, 0xa, 0x70, 0x72, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x3a, 0xa, 0x7b, 0x7b, 0x22, 0x5c, 0x74, 0x22, 0x7d, 0x7d, 0x40, 0x24, 0x28, 0x4d, 0x42, 0x54, 0x29, 0x20, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x20, 0x2d, 0x72, 0x3d, 0x24, 0x7b, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x7d, 0x20, 0x2d, 0x78, 0x3d, 0x22, 0x70, 0x61, 0x74, 0x68, 0x73, 0x22, 0x20, 0x7b, 0x7b, 0x2d, 0x20, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x41, 0x72, 0x67, 0x20, 0x22, 0x2d, 0x65, 0x22, 0x7d, 0x7d, 0xa, 0x70, 0x72, 0x65, 0x5f, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x3a, 0x20, 0x70, 0x72, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0xa, 0x7b, 0x7b, 0x22, 0x5c, 0x74, 0x22, 0x7d, 0x7d, 0x40, 0x24, 0x28, 0x4d, 0x42, 0x54, 0x29, 0x20, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x20, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x20, 0x2d, 0x70, 0x3d, 0x70, 0x72, 0x65, 0x20, 0x7b, 0x7b, 0x2d, 0x20, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x41, 0x72, 0x67, 0x20, 0x22, 0x2d, 0x65, 0x22, 0x7d, 0x7d, 0xa, 0xa, 0xa} diff --git a/internal/tpl/base_pre_default.txt b/internal/tpl/base_pre_default.txt index 688f41e31..9dd44d26c 100644 --- a/internal/tpl/base_pre_default.txt +++ b/internal/tpl/base_pre_default.txt @@ -4,10 +4,6 @@ modules := $(subst ],,$(subst [,,$(modules))) .PHONY: all pre_validate pre_build validate $(modules) post_build meta mtar cleanup # Default target compile all all: pre_validate pre_build validate $(modules) post_build meta mtar cleanup -cores: -# Determine OS cores -{{"\t"}}{{ OsCore.NPROCS }} -{{"\t"}}{{ OsCore.MAKEFLAGS }} # Validate mta.yaml pre_validate: {{"\t"}}@$(MBT) validate -r=${strict} -x="paths" {{- ExtensionsArg "-e"}} diff --git a/internal/tpl/base_pre_verbose.go b/internal/tpl/base_pre_verbose.go index 852717f17..7105529aa 100644 --- a/internal/tpl/base_pre_verbose.go +++ b/internal/tpl/base_pre_verbose.go @@ -1,4 +1,4 @@ package tpl // basePreVerbose - do not edit -var basePreVerbose = []byte{0x23, 0x20, 0x44, 0x65, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x65, 0x20, 0x4f, 0x53, 0x20, 0x63, 0x6f, 0x72, 0x65, 0x73, 0xa, 0x7b, 0x7b, 0x20, 0x4f, 0x73, 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x4e, 0x50, 0x52, 0x4f, 0x43, 0x53, 0x20, 0x20, 0x7d, 0x7d, 0xa, 0x7b, 0x7b, 0x20, 0x4f, 0x73, 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x4d, 0x41, 0x4b, 0x45, 0x46, 0x4c, 0x41, 0x47, 0x53, 0x20, 0x20, 0x7d, 0x7d, 0xa, 0x23, 0x20, 0x4c, 0x69, 0x73, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x61, 0x6c, 0x6c, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x65, 0x63, 0x69, 0x70, 0x65, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x62, 0x65, 0x20, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x64, 0x20, 0x64, 0x75, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x74, 0x68, 0x65, 0x20, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x20, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0xa, 0x2e, 0x50, 0x48, 0x4f, 0x4e, 0x59, 0x3a, 0x20, 0x70, 0x72, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x20, 0x70, 0x72, 0x65, 0x5f, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x20, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x20, 0x7b, 0x7b, 0x2d, 0x20, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x20, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x7d, 0x7d, 0x20, 0x7b, 0x7b, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x7d, 0x7d, 0x7b, 0x7b, 0x65, 0x6e, 0x64, 0x7d, 0x7d, 0x20, 0x6d, 0x65, 0x74, 0x61, 0x20, 0x6d, 0x74, 0x61, 0x72, 0x20, 0x63, 0x6c, 0x65, 0x61, 0x6e, 0x75, 0x70, 0xa, 0x23, 0x20, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x20, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x20, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x20, 0x61, 0x6c, 0x6c, 0xa, 0x61, 0x6c, 0x6c, 0x3a, 0x20, 0x70, 0x72, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x20, 0x70, 0x72, 0x65, 0x5f, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x20, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x20, 0x7b, 0x7b, 0x2d, 0x20, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x20, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x7d, 0x7d, 0x20, 0x7b, 0x7b, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x7d, 0x7d, 0x7b, 0x7b, 0x65, 0x6e, 0x64, 0x7d, 0x7d, 0x20, 0x6d, 0x65, 0x74, 0x61, 0x20, 0x6d, 0x74, 0x61, 0x72, 0x20, 0x63, 0x6c, 0x65, 0x61, 0x6e, 0x75, 0x70, 0xa, 0x23, 0x20, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x20, 0x6d, 0x74, 0x61, 0x2e, 0x79, 0x61, 0x6d, 0x6c, 0xa, 0x70, 0x72, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x3a, 0xa, 0x7b, 0x7b, 0x22, 0x5c, 0x74, 0x22, 0x7d, 0x7d, 0x40, 0x24, 0x28, 0x4d, 0x42, 0x54, 0x29, 0x20, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x20, 0x2d, 0x72, 0x3d, 0x24, 0x7b, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x7d, 0x20, 0x2d, 0x78, 0x3d, 0x22, 0x70, 0x61, 0x74, 0x68, 0x73, 0x22, 0x20, 0x7b, 0x7b, 0x2d, 0x20, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x41, 0x72, 0x67, 0x20, 0x22, 0x2d, 0x65, 0x22, 0x7d, 0x7d, 0xa, 0xa, 0x70, 0x72, 0x65, 0x5f, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x3a, 0x20, 0x70, 0x72, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0xa, 0x7b, 0x7b, 0x22, 0x5c, 0x74, 0x22, 0x7d, 0x7d, 0x40, 0x24, 0x28, 0x4d, 0x42, 0x54, 0x29, 0x20, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x20, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x20, 0x2d, 0x70, 0x3d, 0x70, 0x72, 0x65, 0x20, 0x7b, 0x7b, 0x2d, 0x20, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x41, 0x72, 0x67, 0x20, 0x22, 0x2d, 0x65, 0x22, 0x7d, 0x7d, 0xa, 0xa, 0x23, 0x20, 0x53, 0x65, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x20, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x20, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x20, 0x70, 0x61, 0x74, 0x68, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x6c, 0x20, 0x6d, 0x74, 0x61, 0x20, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0xa, 0x20, 0x20, 0x50, 0x52, 0x4f, 0x4a, 0x5f, 0x44, 0x49, 0x52, 0x20, 0x3a, 0x3d, 0x20, 0x24, 0x28, 0x43, 0x55, 0x52, 0x44, 0x49, 0x52, 0x29, 0xa} +var basePreVerbose = []byte{0x23, 0x20, 0x4c, 0x69, 0x73, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x61, 0x6c, 0x6c, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x65, 0x63, 0x69, 0x70, 0x65, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x62, 0x65, 0x20, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x64, 0x20, 0x64, 0x75, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x74, 0x68, 0x65, 0x20, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x20, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0xa, 0x2e, 0x50, 0x48, 0x4f, 0x4e, 0x59, 0x3a, 0x20, 0x70, 0x72, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x20, 0x70, 0x72, 0x65, 0x5f, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x20, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x20, 0x7b, 0x7b, 0x2d, 0x20, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x20, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x7d, 0x7d, 0x20, 0x7b, 0x7b, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x7d, 0x7d, 0x7b, 0x7b, 0x65, 0x6e, 0x64, 0x7d, 0x7d, 0x20, 0x6d, 0x65, 0x74, 0x61, 0x20, 0x6d, 0x74, 0x61, 0x72, 0x20, 0x63, 0x6c, 0x65, 0x61, 0x6e, 0x75, 0x70, 0xa, 0x23, 0x20, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x20, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x20, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x20, 0x61, 0x6c, 0x6c, 0xa, 0x61, 0x6c, 0x6c, 0x3a, 0x20, 0x70, 0x72, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x20, 0x70, 0x72, 0x65, 0x5f, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x20, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x20, 0x7b, 0x7b, 0x2d, 0x20, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x20, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x7d, 0x7d, 0x20, 0x7b, 0x7b, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x7d, 0x7d, 0x7b, 0x7b, 0x65, 0x6e, 0x64, 0x7d, 0x7d, 0x20, 0x6d, 0x65, 0x74, 0x61, 0x20, 0x6d, 0x74, 0x61, 0x72, 0x20, 0x63, 0x6c, 0x65, 0x61, 0x6e, 0x75, 0x70, 0xa, 0x23, 0x20, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x20, 0x6d, 0x74, 0x61, 0x2e, 0x79, 0x61, 0x6d, 0x6c, 0xa, 0x70, 0x72, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x3a, 0xa, 0x7b, 0x7b, 0x22, 0x5c, 0x74, 0x22, 0x7d, 0x7d, 0x40, 0x24, 0x28, 0x4d, 0x42, 0x54, 0x29, 0x20, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x20, 0x2d, 0x72, 0x3d, 0x24, 0x7b, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x7d, 0x20, 0x2d, 0x78, 0x3d, 0x22, 0x70, 0x61, 0x74, 0x68, 0x73, 0x22, 0x20, 0x7b, 0x7b, 0x2d, 0x20, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x41, 0x72, 0x67, 0x20, 0x22, 0x2d, 0x65, 0x22, 0x7d, 0x7d, 0xa, 0xa, 0x70, 0x72, 0x65, 0x5f, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x3a, 0x20, 0x70, 0x72, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0xa, 0x7b, 0x7b, 0x22, 0x5c, 0x74, 0x22, 0x7d, 0x7d, 0x40, 0x24, 0x28, 0x4d, 0x42, 0x54, 0x29, 0x20, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x20, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x20, 0x2d, 0x70, 0x3d, 0x70, 0x72, 0x65, 0x20, 0x7b, 0x7b, 0x2d, 0x20, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x41, 0x72, 0x67, 0x20, 0x22, 0x2d, 0x65, 0x22, 0x7d, 0x7d, 0xa, 0xa, 0x23, 0x20, 0x53, 0x65, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x20, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x20, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x20, 0x70, 0x61, 0x74, 0x68, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x6c, 0x20, 0x6d, 0x74, 0x61, 0x20, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0xa, 0x20, 0x20, 0x50, 0x52, 0x4f, 0x4a, 0x5f, 0x44, 0x49, 0x52, 0x20, 0x3a, 0x3d, 0x20, 0x24, 0x28, 0x43, 0x55, 0x52, 0x44, 0x49, 0x52, 0x29, 0xa} diff --git a/internal/tpl/base_pre_verbose.txt b/internal/tpl/base_pre_verbose.txt index ad35cb7ef..2cc638f87 100644 --- a/internal/tpl/base_pre_verbose.txt +++ b/internal/tpl/base_pre_verbose.txt @@ -1,6 +1,3 @@ -# Determine OS cores -{{ OsCore.NPROCS }} -{{ OsCore.MAKEFLAGS }} # List of all the recipes to be executed during the build process .PHONY: pre_validate pre_build validate {{- range .File.Modules}} {{.Name}}{{end}} meta mtar cleanup # Default target compile all diff --git a/internal/tpl/make_verbose.go b/internal/tpl/make_verbose.go index 0008c20b2..2b8ecc8b6 100644 --- a/internal/tpl/make_verbose.go +++ b/internal/tpl/make_verbose.go @@ -1,4 +1,4 @@ package tpl // makeVerbose - do not edit -var makeVerbose = []byte{0x23, 0x20, 0x4c, 0x69, 0x73, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0xa, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x20, 0x3d, 0x20, 0x7b, 0x7b, 0x2d, 0x20, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x20, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x7d, 0x7d, 0x20, 0x7b, 0x7b, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x7d, 0x7d, 0x7b, 0x7b, 0x65, 0x6e, 0x64, 0x7d, 0x7d, 0xa, 0xa, 0x23, 0x20, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x20, 0x61, 0x6c, 0x6c, 0x20, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x20, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x73, 0xa, 0x7b, 0x7b, 0x2d, 0x20, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x20, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x7d, 0x7d, 0xa, 0x23, 0x20, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x20, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x20, 0x7b, 0x7b, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x7d, 0x7d, 0xa, 0x7b, 0x7b, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x7d, 0x7d, 0x3a, 0x20, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x20, 0x7b, 0x7b, 0x2d, 0x20, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x20, 0x24, 0x2e, 0x47, 0x65, 0x74, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x44, 0x65, 0x70, 0x73, 0x20, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x7d, 0x7d, 0x20, 0x7b, 0x7b, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x7d, 0x7d, 0x7b, 0x7b, 0x65, 0x6e, 0x64, 0x7d, 0x7d, 0xa, 0x7b, 0x7b, 0x2d, 0x20, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x20, 0x24, 0x2e, 0x47, 0x65, 0x74, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x44, 0x65, 0x70, 0x73, 0x20, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x7d, 0x7d, 0x7b, 0x7b, 0x22, 0x5c, 0x6e, 0x5c, 0x74, 0x22, 0x7d, 0x7d, 0x40, 0x24, 0x28, 0x4d, 0x42, 0x54, 0x29, 0x20, 0x63, 0x70, 0x20, 0x2d, 0x73, 0x3d, 0x7b, 0x7b, 0x24, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x61, 0x74, 0x68, 0x41, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x2e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x50, 0x61, 0x74, 0x68, 0x7d, 0x7d, 0x20, 0x2d, 0x74, 0x3d, 0x7b, 0x7b, 0x24, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x61, 0x74, 0x68, 0x41, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x50, 0x61, 0x74, 0x68, 0x7d, 0x7d, 0x20, 0x7b, 0x7b, 0x2d, 0x20, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x20, 0x2e, 0x50, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x73, 0x7d, 0x7d, 0x20, 0x2d, 0x70, 0x3d, 0x7b, 0x7b, 0x24, 0x2e, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x74, 0x54, 0x6f, 0x53, 0x68, 0x65, 0x6c, 0x6c, 0x41, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x2e, 0x7d, 0x7d, 0x7b, 0x7b, 0x65, 0x6e, 0x64, 0x7d, 0x7d, 0x7b, 0x7b, 0x65, 0x6e, 0x64, 0x7d, 0x7d, 0xa, 0x7b, 0x7b, 0x22, 0x5c, 0x74, 0x22, 0x7d, 0x7d, 0x40, 0x24, 0x28, 0x4d, 0x42, 0x54, 0x29, 0x20, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x20, 0x2d, 0x64, 0x3d, 0x22, 0x24, 0x28, 0x50, 0x52, 0x4f, 0x4a, 0x5f, 0x44, 0x49, 0x52, 0x29, 0x2f, 0x7b, 0x7b, 0x2e, 0x50, 0x61, 0x74, 0x68, 0x7d, 0x7d, 0x22, 0x20, 0x7b, 0x7b, 0x2d, 0x20, 0x69, 0x66, 0x20, 0x2e, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x7d, 0x7d, 0x20, 0x2d, 0x74, 0x3d, 0x7b, 0x7b, 0x24, 0x2e, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x74, 0x54, 0x6f, 0x53, 0x68, 0x65, 0x6c, 0x6c, 0x41, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x2e, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x7d, 0x7d, 0x7b, 0x7b, 0x65, 0x6e, 0x64, 0x7d, 0x7d, 0x20, 0x7b, 0x7b, 0x2d, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x24, 0x63, 0x6d, 0x64, 0x73, 0x20, 0x3a, 0x3d, 0x20, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x20, 0x2e, 0x7d, 0x7d, 0x7b, 0x7b, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x20, 0x24, 0x69, 0x2c, 0x20, 0x24, 0x63, 0x6d, 0x64, 0x3a, 0x3d, 0x24, 0x63, 0x6d, 0x64, 0x73, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x7d, 0x7d, 0x20, 0x2d, 0x63, 0x3d, 0x7b, 0x7b, 0x24, 0x2e, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x74, 0x54, 0x6f, 0x53, 0x68, 0x65, 0x6c, 0x6c, 0x41, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x2e, 0x7d, 0x7d, 0x7b, 0x7b, 0x65, 0x6e, 0x64, 0x7d, 0x7d, 0x7b, 0x7b, 0x65, 0x6e, 0x64, 0x7d, 0x7d, 0xa, 0x23, 0x20, 0x50, 0x61, 0x63, 0x6b, 0x20, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x20, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x20, 0x61, 0x72, 0x74, 0x69, 0x66, 0x61, 0x63, 0x74, 0x73, 0xa, 0x7b, 0x7b, 0x22, 0x5c, 0x74, 0x22, 0x7d, 0x7d, 0x40, 0x24, 0x28, 0x4d, 0x42, 0x54, 0x29, 0x20, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x20, 0x70, 0x61, 0x63, 0x6b, 0x20, 0x2d, 0x6d, 0x3d, 0x7b, 0x7b, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x7d, 0x7d, 0x20, 0x2d, 0x70, 0x3d, 0x24, 0x7b, 0x70, 0x7d, 0x20, 0x2d, 0x74, 0x3d, 0x24, 0x7b, 0x74, 0x7d, 0x20, 0x7b, 0x7b, 0x2d, 0x20, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x41, 0x72, 0x67, 0x20, 0x22, 0x2d, 0x65, 0x22, 0x7d, 0x7d, 0xa, 0x7b, 0x7b, 0x65, 0x6e, 0x64, 0x7d, 0x7d, 0xa} +var makeVerbose = []byte{0x23, 0x20, 0x4c, 0x69, 0x73, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0xa, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x20, 0x3d, 0x20, 0x7b, 0x7b, 0x2d, 0x20, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x20, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x7d, 0x7d, 0x20, 0x7b, 0x7b, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x7d, 0x7d, 0x7b, 0x7b, 0x65, 0x6e, 0x64, 0x7d, 0x7d, 0xa, 0xa, 0x23, 0x20, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x20, 0x61, 0x6c, 0x6c, 0x20, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x20, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x73, 0xa, 0x7b, 0x7b, 0x2d, 0x20, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x20, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x7d, 0x7d, 0xa, 0x23, 0x20, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x20, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x20, 0x7b, 0x7b, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x7d, 0x7d, 0xa, 0x7b, 0x7b, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x7d, 0x7d, 0x3a, 0x20, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x20, 0x7b, 0x7b, 0x2d, 0x20, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x20, 0x24, 0x2e, 0x47, 0x65, 0x74, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x44, 0x65, 0x70, 0x73, 0x20, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x7d, 0x7d, 0x20, 0x7b, 0x7b, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x7d, 0x7d, 0x7b, 0x7b, 0x65, 0x6e, 0x64, 0x7d, 0x7d, 0xa, 0x7b, 0x7b, 0x22, 0x5c, 0x74, 0x22, 0x7d, 0x7d, 0x40, 0x65, 0x63, 0x68, 0x6f, 0x20, 0x27, 0x49, 0x4e, 0x46, 0x4f, 0x20, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x69, 0x6e, 0x67, 0x20, 0x74, 0x68, 0x65, 0x20, 0x22, 0x7b, 0x7b, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x7d, 0x7d, 0x22, 0x20, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x2e, 0x2e, 0x27, 0xa, 0x7b, 0x7b, 0x2d, 0x20, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x20, 0x24, 0x2e, 0x47, 0x65, 0x74, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x44, 0x65, 0x70, 0x73, 0x20, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x7d, 0x7d, 0x7b, 0x7b, 0x22, 0x5c, 0x6e, 0x5c, 0x74, 0x22, 0x7d, 0x7d, 0x40, 0x24, 0x28, 0x4d, 0x42, 0x54, 0x29, 0x20, 0x63, 0x70, 0x20, 0x2d, 0x73, 0x3d, 0x7b, 0x7b, 0x24, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x61, 0x74, 0x68, 0x41, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x2e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x50, 0x61, 0x74, 0x68, 0x7d, 0x7d, 0x20, 0x2d, 0x74, 0x3d, 0x7b, 0x7b, 0x24, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x61, 0x74, 0x68, 0x41, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x50, 0x61, 0x74, 0x68, 0x7d, 0x7d, 0x20, 0x7b, 0x7b, 0x2d, 0x20, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x20, 0x2e, 0x50, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x73, 0x7d, 0x7d, 0x20, 0x2d, 0x70, 0x3d, 0x7b, 0x7b, 0x24, 0x2e, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x74, 0x54, 0x6f, 0x53, 0x68, 0x65, 0x6c, 0x6c, 0x41, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x2e, 0x7d, 0x7d, 0x7b, 0x7b, 0x65, 0x6e, 0x64, 0x7d, 0x7d, 0x7b, 0x7b, 0x65, 0x6e, 0x64, 0x7d, 0x7d, 0xa, 0x7b, 0x7b, 0x22, 0x5c, 0x74, 0x22, 0x7d, 0x7d, 0x40, 0x24, 0x28, 0x4d, 0x42, 0x54, 0x29, 0x20, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x20, 0x2d, 0x64, 0x3d, 0x22, 0x24, 0x28, 0x50, 0x52, 0x4f, 0x4a, 0x5f, 0x44, 0x49, 0x52, 0x29, 0x2f, 0x7b, 0x7b, 0x2e, 0x50, 0x61, 0x74, 0x68, 0x7d, 0x7d, 0x22, 0x20, 0x7b, 0x7b, 0x2d, 0x20, 0x69, 0x66, 0x20, 0x2e, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x7d, 0x7d, 0x20, 0x2d, 0x74, 0x3d, 0x7b, 0x7b, 0x24, 0x2e, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x74, 0x54, 0x6f, 0x53, 0x68, 0x65, 0x6c, 0x6c, 0x41, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x2e, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x7d, 0x7d, 0x7b, 0x7b, 0x65, 0x6e, 0x64, 0x7d, 0x7d, 0x20, 0x7b, 0x7b, 0x2d, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x24, 0x63, 0x6d, 0x64, 0x73, 0x20, 0x3a, 0x3d, 0x20, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x20, 0x2e, 0x7d, 0x7d, 0x7b, 0x7b, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x20, 0x24, 0x69, 0x2c, 0x20, 0x24, 0x63, 0x6d, 0x64, 0x3a, 0x3d, 0x24, 0x63, 0x6d, 0x64, 0x73, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x7d, 0x7d, 0x20, 0x2d, 0x63, 0x3d, 0x7b, 0x7b, 0x24, 0x2e, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x74, 0x54, 0x6f, 0x53, 0x68, 0x65, 0x6c, 0x6c, 0x41, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x2e, 0x7d, 0x7d, 0x7b, 0x7b, 0x65, 0x6e, 0x64, 0x7d, 0x7d, 0x7b, 0x7b, 0x65, 0x6e, 0x64, 0x7d, 0x7d, 0xa, 0x23, 0x20, 0x50, 0x61, 0x63, 0x6b, 0x20, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x20, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x20, 0x61, 0x72, 0x74, 0x69, 0x66, 0x61, 0x63, 0x74, 0x73, 0xa, 0x7b, 0x7b, 0x22, 0x5c, 0x74, 0x22, 0x7d, 0x7d, 0x40, 0x24, 0x28, 0x4d, 0x42, 0x54, 0x29, 0x20, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x20, 0x70, 0x61, 0x63, 0x6b, 0x20, 0x2d, 0x6d, 0x3d, 0x7b, 0x7b, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x7d, 0x7d, 0x20, 0x2d, 0x70, 0x3d, 0x24, 0x7b, 0x70, 0x7d, 0x20, 0x2d, 0x74, 0x3d, 0x24, 0x7b, 0x74, 0x7d, 0x20, 0x7b, 0x7b, 0x2d, 0x20, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x41, 0x72, 0x67, 0x20, 0x22, 0x2d, 0x65, 0x22, 0x7d, 0x7d, 0xa, 0x7b, 0x7b, 0x22, 0x5c, 0x74, 0x22, 0x7d, 0x7d, 0x40, 0x65, 0x63, 0x68, 0x6f, 0x20, 0x27, 0x49, 0x4e, 0x46, 0x4f, 0x20, 0x66, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, 0x20, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x69, 0x6e, 0x67, 0x20, 0x74, 0x68, 0x65, 0x20, 0x22, 0x7b, 0x7b, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x7d, 0x7d, 0x22, 0x20, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x27, 0xa, 0x7b, 0x7b, 0x65, 0x6e, 0x64, 0x7d, 0x7d, 0xa} diff --git a/internal/tpl/make_verbose.txt b/internal/tpl/make_verbose.txt index 291240772..d2eb8597d 100644 --- a/internal/tpl/make_verbose.txt +++ b/internal/tpl/make_verbose.txt @@ -5,8 +5,10 @@ modules = {{- range .File.Modules}} {{.Name}}{{end}} {{- range .File.Modules}} # build module {{.Name}} {{.Name}}: validate {{- range $.GetModuleDeps .Name}} {{.Name}}{{end}} +{{"\t"}}@echo 'INFO building the "{{.Name}}" module...' {{- range $.GetModuleDeps .Name}}{{"\n\t"}}@$(MBT) cp -s={{$.GetPathArgument .SourcePath}} -t={{$.GetPathArgument .TargetPath}} {{- range .Patterns}} -p={{$.ConvertToShellArgument .}}{{end}}{{end}} {{"\t"}}@$(MBT) execute -d="$(PROJ_DIR)/{{.Path}}" {{- if .BuildParams.timeout}} -t={{$.ConvertToShellArgument .BuildParams.timeout}}{{end}} {{- with $cmds := CommandProvider .}}{{range $i, $cmd:=$cmds.Command}} -c={{$.ConvertToShellArgument .}}{{end}}{{end}} # Pack module build artifacts {{"\t"}}@$(MBT) module pack -m={{.Name}} -p=${p} -t=${t} {{- ExtensionsArg "-e"}} +{{"\t"}}@echo 'INFO finished building the "{{.Name}}" module' {{end}} diff --git a/internal/tpl/makefile.go b/internal/tpl/makefile.go index 9963120e0..97db1cc8c 100644 --- a/internal/tpl/makefile.go +++ b/internal/tpl/makefile.go @@ -14,7 +14,6 @@ import ( "github.com/SAP/cloud-mta-build-tool/internal/buildops" "github.com/SAP/cloud-mta-build-tool/internal/commands" "github.com/SAP/cloud-mta-build-tool/internal/logs" - "github.com/SAP/cloud-mta-build-tool/internal/proc" "github.com/SAP/cloud-mta-build-tool/internal/version" "github.com/SAP/cloud-mta/mta" ) @@ -191,7 +190,6 @@ func mapTpl(templateContent []byte, BasePreContent []byte, BasePostContent []byt cmds, _, err := commands.CommandProvider(modules) return cmds, err }, - "OsCore": proc.OsCore, "Version": version.GetVersion, "MbtPath": func() string { return getMbtPath(useDefaultMbt) @@ -208,10 +206,15 @@ func mapTpl(templateContent []byte, BasePreContent []byte, BasePostContent []byt return template.New("makeTemplate").Funcs(funcMap).Parse(fullTemplateStr) } +// IsVerboseMode returns true if the mode of the makefile template should be verbose +func IsVerboseMode(mode string) bool { + return (mode == "verbose") || (mode == "v") +} + // Get template (default/verbose) according to the CLI flags func getTplCfg(mode string, isDep bool) (tplCfg, error) { tpl := tplCfg{} - if (mode == "verbose") || (mode == "v") { + if IsVerboseMode(mode) { tpl.tplContent = makeVerbose tpl.preContent = basePreVerbose tpl.postContent = basePost diff --git a/internal/tpl/makefile_test.go b/internal/tpl/makefile_test.go index da88d7427..281073dda 100644 --- a/internal/tpl/makefile_test.go +++ b/internal/tpl/makefile_test.go @@ -5,7 +5,6 @@ import ( "io/ioutil" "os" "path/filepath" - "runtime" "strings" . "github.com/onsi/ginkgo" @@ -45,27 +44,15 @@ func escapeProjPath(parts ...string) string { var _ = Describe("Makefile", func() { var ( - tpl = tplCfg{tplContent: makeVerbose, relPath: "", preContent: basePreVerbose, postContent: basePost, depDesc: "dev"} - makeFileName = "MakeFileTest.mta" - wd, _ = os.Getwd() - expectedMakePath = func() string { - var filename string - switch runtime.GOOS { - case "linux": - filename = "ExpectedMakeFileLinux" - case "darwin": - filename = "ExpectedMakeFileMac" - default: - filename = "ExpectedMakeFileWindows" - } - return filepath.Join(wd, "testdata", filename) - }() - makeFileFullPath = func() string { - return filepath.Join(wd, "testdata", makeFileName) - }() - expectedMakeFileContent = getMakeFileContent(expectedMakePath) + tpl = tplCfg{tplContent: makeVerbose, relPath: "", preContent: basePreVerbose, postContent: basePost, depDesc: "dev"} + makeFileName = "MakeFileTest.mta" ) + wd, _ := os.Getwd() + expectedMakePath := filepath.Join(wd, "testdata", "ExpectedMakeFile") + expectedMakeFileContent := getMakeFileContent(expectedMakePath) + makeFileFullPath := filepath.Join(wd, "testdata", makeFileName) + Describe("MakeFile Generation", func() { BeforeEach(func() { version.VersionConfig = []byte(` @@ -146,7 +133,8 @@ makefile_version: 0.0.0 makefileContent := getMakeFileContent(makeFileFullPath) expectedModuleGen := fmt.Sprintf(`%s: validate - @%s`, moduleName, expectedModuleCommandsGen) + @echo 'INFO building the "%s" module...' + @%s`, moduleName, moduleName, expectedModuleCommandsGen) Ω(makefileContent).Should(ContainSubstring(removeSpecialSymbols([]byte(expectedModuleGen)))) }, Entry("module with one command", "one_command.yaml", "one_command", `$(MBT) execute -d="$(PROJ_DIR)/one_command" -c=yarn`), @@ -169,8 +157,9 @@ makefile_version: 0.0.0 Ω(makeFileFullPath).Should(BeAnExistingFile()) makefileContent := getMakeFileContent(makeFileFullPath) - expectedModuleGen := fmt.Sprintf(`%s: validate %s%s - @$(MBT) execute -d="$(PROJ_DIR)/%s"`, moduleName, expectedModuleDepNames, expectedModuleDepCopyCommands, modulePath) + expectedModuleGen := fmt.Sprintf(`%s: validate %s + @echo 'INFO building the "%s" module...'%s + @$(MBT) execute -d="$(PROJ_DIR)/%s"`, moduleName, expectedModuleDepNames, moduleName, expectedModuleDepCopyCommands, modulePath) Ω(makefileContent).Should(ContainSubstring(removeSpecialSymbols([]byte(expectedModuleGen)))) }, Entry("dependency with artifacts", "dep_with_patterns.yaml", "module1", "public", `dep`, fmt.Sprintf(` diff --git a/internal/tpl/testdata/ExpectedMakeFileMac b/internal/tpl/testdata/ExpectedMakeFile similarity index 93% rename from internal/tpl/testdata/ExpectedMakeFileMac rename to internal/tpl/testdata/ExpectedMakeFile index 3c464b64b..25dae91d8 100644 --- a/internal/tpl/testdata/ExpectedMakeFileMac +++ b/internal/tpl/testdata/ExpectedMakeFile @@ -15,9 +15,6 @@ endif ifndef mtar mtar="*" endif -# Determine OS cores -NPROCS = $(sysctl -n hw.ncpu) -MAKEFLAGS += -j # List of all the recipes to be executed during the build process .PHONY: pre_validate pre_build validate ui meta mtar cleanup # Default target compile all @@ -37,9 +34,11 @@ modules = ui # Execute all modules builds # build module ui ui: validate + @echo 'INFO building the "ui" module...' @$(MBT) execute -d="$(PROJ_DIR)/ui" -c='npm install' -c=grunt # Pack module build artifacts @$(MBT) module pack -m=ui -p=${p} -t=${t} + @echo 'INFO finished building the "ui" module' # Create META-INF folder with MANIFEST.MF & mtad.yaml meta: $(modules) post_build diff --git a/internal/tpl/testdata/ExpectedMakeFileLinux b/internal/tpl/testdata/ExpectedMakeFileLinux deleted file mode 100644 index 0dc7e6847..000000000 --- a/internal/tpl/testdata/ExpectedMakeFileLinux +++ /dev/null @@ -1,61 +0,0 @@ -# Generated with Cloud MTA Build Tool version 0.0.0 -version=0.0.0 -MBT=mbt -ifndef p -$(error platform flag is expected. e.g. use make -f makefile.mta p=cf) -endif -target_provided=true -ifndef t -t="$(CURDIR)" -target_provided=false -endif -ifndef strict -strict=true -endif -ifndef mtar -mtar="*" -endif -# Determine OS cores -NPROCS = $(shell grep -c 'processor' /proc/cpuinfo) -MAKEFLAGS += -j -# List of all the recipes to be executed during the build process -.PHONY: pre_validate pre_build validate ui meta mtar cleanup -# Default target compile all -all: pre_validate pre_build validate ui meta mtar cleanup -# Validate mta.yaml -pre_validate: - @$(MBT) validate -r=${strict} -x="paths" - -pre_build: pre_validate - @$(MBT) project build -p=pre - -# Set the current project repository path for general mta process - PROJ_DIR := $(CURDIR) -# List of modules -modules = ui - -# Execute all modules builds -# build module ui -ui: validate - @$(MBT) execute -d="$(PROJ_DIR)/ui" -c='npm install' -c=grunt -# Pack module build artifacts - @$(MBT) module pack -m=ui -p=${p} -t=${t} - -# Create META-INF folder with MANIFEST.MF & mtad.yaml -meta: $(modules) post_build - @$(MBT) gen meta -p=${p} -t=${t} - -post_build: $(modules) - @$(MBT) project build -p=post -t=${t} - -# Validate mta.yaml -validate: pre_build - @$(MBT) validate -r=${strict} - -# Pack as MTAR artifact -mtar: $(modules) meta - @$(MBT) gen mtar -t=${t} --mtar=${mtar} --target_provided=${target_provided} - -cleanup: mtar -# Remove tmp folder - @$(MBT) clean -t=${t} \ No newline at end of file diff --git a/internal/tpl/testdata/ExpectedMakeFileWindows b/internal/tpl/testdata/ExpectedMakeFileWindows deleted file mode 100644 index c834fae8b..000000000 --- a/internal/tpl/testdata/ExpectedMakeFileWindows +++ /dev/null @@ -1,61 +0,0 @@ -# Generated with Cloud MTA Build Tool version 0.0.0 -version=0.0.0 -MBT=mbt -ifndef p -$(error platform flag is expected. e.g. use make -f makefile.mta p=cf) -endif -target_provided=true -ifndef t -t="$(CURDIR)" -target_provided=false -endif -ifndef strict -strict=true -endif -ifndef mtar -mtar="*" -endif -# Determine OS cores -NPROCS = $(shell echo %NUMBER_OF_PROCESSORS%) -MAKEFLAGS += -j -# List of all the recipes to be executed during the build process -.PHONY: pre_validate pre_build validate ui meta mtar cleanup -# Default target compile all -all: pre_validate pre_build validate ui meta mtar cleanup -# Validate mta.yaml -pre_validate: - @$(MBT) validate -r=${strict} -x="paths" - -pre_build: pre_validate - @$(MBT) project build -p=pre - -# Set the current project repository path for general mta process - PROJ_DIR := $(CURDIR) -# List of modules -modules = ui - -# Execute all modules builds -# build module ui -ui: validate - @$(MBT) execute -d="$(PROJ_DIR)/ui" -c='npm install' -c=grunt -# Pack module build artifacts - @$(MBT) module pack -m=ui -p=${p} -t=${t} - -# Create META-INF folder with MANIFEST.MF & mtad.yaml -meta: $(modules) post_build - @$(MBT) gen meta -p=${p} -t=${t} - -post_build: $(modules) - @$(MBT) project build -p=post -t=${t} - -# Validate mta.yaml -validate: pre_build - @$(MBT) validate -r=${strict} - -# Pack as MTAR artifact -mtar: $(modules) meta - @$(MBT) gen mtar -t=${t} --mtar=${mtar} --target_provided=${target_provided} - -cleanup: mtar -# Remove tmp folder - @$(MBT) clean -t=${t} \ No newline at end of file diff --git a/internal/tpl/testdata/WrongMakeTmpl.txt b/internal/tpl/testdata/WrongMakeTmpl.txt index 770a63a33..d3bebaf37 100644 --- a/internal/tpl/testdata/WrongMakeTmpl.txt +++ b/internal/tpl/testdata/WrongMakeTmpl.txt @@ -1,10 +1,5 @@ # Create folder for build artifacts MTR_DIR := $(shell $(MBT) execute prepare) -# Determine OS cores -{{- range OsCore }} -{{ .NPROCS }} -{{ .MAKEFLAGS }} -{{- end}} # List of all the recipes to be executed .PHONY: cores {{- range .File.Modules}} {{.Name}}{{end}} meta mtar cleanup # Default target compile all