8000 Makefile for scaffolded app · Issue #288 · ignite/cli · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Makefile for scaffolded app #288

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
toschdev opened this issue Oct 1, 2020 · 7 comments
Closed

Makefile for scaffolded app #288

toschdev opened this issue Oct 1, 2020 · 7 comments
Labels
component:scaffold Feature, enhancement, or refactor related to scaffolding.

Comments

@toschdev
Copy link
Contributor
toschdev commented Oct 1, 2020

It would be great if we could have a more dedicated Makefile in our application.

Currently after scaffolding, we get a Makefile with the following content:

all: build


build:
        @mkdir -p build/
        @go build -mod=mod -o build/clayd ./cmd/clayd
        @go build -mod=mod -o build/claycli ./cmd/claycli

I think starting with adapting the daemon and cli names to the scaffolded application, it would be nice to have a few more commands available in the Makefile.

What would make sense for a minimal setup would be the commands

  • build
  • clean
  • lint

Later as soon as tests are integrated, these would be a great addition to the Makefile

@toschdev toschdev changed the title Makefile Makefile for scaffolded app Oct 1, 2020
@ilgooz
Copy link
Member
ilgooz commented Oct 1, 2020

What you guys think about adding a scripts configuration in the config.yml instead? Under scripts, devs can add arbitrary pre/post hooks to different actions such as build, install, serve etc.

Pre/post hooks would look like:

  • prebuild
  • preinstall
  • preserve
  • postbuild
  • postinstall
  • postserve

Custom scripts:

  • mycustom

We can also enable customization on builds and installations in some degree e.g. providing arbitrarily flags or they can be completely overwritten by users with other commands:

  • build:
    • flags:
      • x=y
  • build: another-program-compiles-go ./cmd/cli

Running these scripts:

  • starport run mycustom
  • starport build
  • starport clean

-similar to how NPM deals with these-

The idea is to reduce one more dependency (in this case make) from the scaffolded app which requires knowledge on how to use the Makefile and introduces another installation step for make since it is not available by default on every platform.

I wonder if this idea is sensible and can fullfil your use cases with a Makefile @Tosch110 @lukitsbrian? How other scaffolding tools handle this?

@toschdev
Copy link
Contributor Author
toschdev commented Oct 1, 2020

Yes, that is a good idea and approach. I did not consider that it would require an additional dependency.

Pre/Post Hooks sound cool!

@toschdev
Copy link
Contributor Author
toschdev commented Oct 1, 2020

Currently there is an "incorrect" Makefile, will this be abandoned then?

@fadeev
Copy link
Contributor
fadeev commented Oct 1, 2020

@Tosch110 Yes, Makefile in the template shouldn't be there. Somehow, it slipped through.

This should be deleted: https://github.com/tendermint/starport/blob/develop/starport/templates/app/launchpad/Makefile.plush

@fadeev
Copy link
Contributor
fadeev commented Oct 1, 2020

I fully support the scripts approach within config. The problem with Makefile also is that it doesn't allow developers to inserts scripts within the serve process.

@fadeev
Copy link
Contributor
fadeev commented Apr 9, 2021

This is still relevant. This is part of a bigger feature of starport build (and serve) that could potentially allow a custom Makefile.

@toschdev toschdev added the component:codefest Suitable for codefest contributors. label Oct 1, 2021
@fadeev fadeev added component:scaffold Feature, enhancement, or refactor related to scaffolding. and removed component:codefest Suitable for codefest contributors. labels Sep 17, 2022
@aljo242
Copy link
Contributor
aljo242 commented Oct 27, 2022

This issue is still relevant to longer running discussions of a more advanced build system

@aljo242 aljo242 closed this as completed Nov 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:scaffold Feature, enhancement, or refactor related to scaffolding.
Projects
None yet
Development

No branches or pull requests

4 participants
0