diff --git a/README.md b/README.md index 3ca2566..a8c5cb3 100644 --- a/README.md +++ b/README.md @@ -72,9 +72,8 @@ Explore the self documenting `examples` folder. There are multiple ways including: -* Place shared scripts in `bin` folder (remember that `CWD/bin` is always added to the `PATH`) -* If the scripts are complex, you can write them in python or other languages of your choice -* If multiple projects need to share the same scripts, then use a common mixin folder (remember that for mixin ymls - the same `CWD/bin` is added to PATH, same env files are loaded, etc, refer [[Task Execution Environment]]) +* Place shared scripts in `bin` folder (remember that `CWD/bin` is always added to the `PATH`). If the scripts are complex, you can write them in any scripting language of your choice +* If multiple projects need to share the same scripts, then use a common mixin folder (remember that for mixin ymls - the same `CWD/bin` is added to PATH, same env files are loaded, etc, refer Task Execution Environment above) For example, @@ -89,7 +88,11 @@ For example, ### Why use myke instead of... -* `maven` is a lifecycle reactor that does a lot of things (compilation/scm/release/lifecycle/build/etc). myke only focuses on being a simple task runner +Deferring higher order build logic (like reading scm history for changelogs, updating scm tags/branches, generating version numbers, etc) to a meta-build tool (like a task runner or aggregator), restricting build tools to do only simple source builds, and having a shared build vocabulary across projects is a generally good idea. There are millions of such meta-build tools or task aggregators out there, we just wanted something fast, zero-dependency and language-agnostic while still helping us manage multiple components across repositories with ease. + +In that sense, `myke` is never a build tool, its just a task aggregator. So its not designed to be an alternative for source build tools, rather it just augments them. The comparison below is on that same perspective. + +* `maven` is a lifecycle reactor and/or project management tool that does a lot of things (compilation/scm/release/lifecycle/build/etc), except its hard to use it as a simple task runner. myke focuses only on the latter * `bazel` `buck` `pants` `gradle` `...` replace your current buildchain by giving you a totally new DSL to compile your programs (`java_binary`, etc). myke simply acts as a yml-based interface to your existing tools and workflows, thereby not needing to change your project and IDE setup * `grunt` `gulp` `pyinvoke` `rake` `sake` `thor` `...` myke is zero-dependency, language agnostic, uses simple yml and allows aggregation of tasks through hierarchies, templates and tags * `make` `scons` `ninja` `...` they are low-level build tools with a crux of file-based dependencies. Most buildchains today are already intelligent enough to process only changed files, so myke completely bypasses file tracking and only focuses on task aggregation and discoverability @@ -97,8 +100,6 @@ For example, * `ansible` `salt` `...` myke is not a configuration management tool, its a task runner * [`robo`](https://github.com/tj/robo) is the closest relative to myke, you should check it out as well -Deferring higher-order build logic (like reading scm history for changelogs, updating scm tags/branches, generating version numbers, etc) to a meta-build tool (like a task runner or aggregator), restricting build tools to do only simple source builds, and having a shared build vocabulary across projects is a generally good idea. There are millions of such meta-build tools or task aggregators out there, we just wanted something fast, zero-dependency and language-agnostic while still helping us manage multiple components across repositories with ease. - ## Development Use docker/docker-compose to develop. You don't need to have golang installed. diff --git a/core/project.go b/core/project.go index fb5f1c1..d9daa6d 100644 --- a/core/project.go +++ b/core/project.go @@ -5,8 +5,8 @@ import ( "github.com/tidwall/gjson" "io/ioutil" - "os" "path/filepath" + "strings" ) type Project struct { @@ -28,9 +28,7 @@ func ParseProject(path string) (Project, error) { return Project{}, err } - if info, err := os.Stat(src); err != nil { - return Project{}, err - } else if info.IsDir() { + if filepath.Ext(src) != ".yml" { return ParseProject(filepath.Join(src, "myke.yml")) } @@ -39,9 +37,10 @@ func ParseProject(path string) (Project, error) { return Project{}, err } + baseName := strings.TrimSuffix(src, ".yml") p.Src = src p.Cwd = filepath.Dir(src) - p.EnvFiles = append(p.EnvFiles, filepath.Join(p.Cwd, "myke.env"), filepath.Join(p.Cwd, "myke.env.local")) + p.EnvFiles = append(p.EnvFiles, baseName + ".env", baseName + ".env.local") for _, epath := range p.EnvFiles { p.Env = mergeEnv(p.Env, loadEnvFile(epath)) }