-
Notifications
You must be signed in to change notification settings - Fork 210
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
build
needs a --clean
flag
#1170
Comments
Duplicate of #1104. |
Not quite. A stand-alone clean command. Great. This is asking for a |
I'm not sure of the value here. It's 1 command versus 2? We don't want this to be a common flag/command, for example in #1104 I outline that we should prompt the user to file a bug everytime they have to use this, because it means we are probably doing something wrong. |
It's nice when debugging builders, etc – to run everything every time... I guess one could just do |
Right, but the point is you shouldn't need it - builders should rerun from scratch if changed. |
Right, but often you want to rerun several times from scratch as you're trying to step through and debug... |
Today we typically touch a line of code in our builder which invalidates the entire build. I personally haven't had a need to rerun with a builder in exactly the same code state... |
@DineshBhosale - If things are working correctly you should not need to delete this directory. If you update your configuration it will automatically clean whatever is necessary. The proposed What issues are you seeing when you don't delete it? |
Closing. There is no reason to be "extra sure". If we need things cleaned up, its a bug. |
I have another use case: My workaround is:
git_version: https://github.com/MikeMitterer/dart-git_version pre condition: |
That sounds like the whitelisting feature of the build system: build/build_runner_core/lib/src/generate/options.dart Lines 18 to 28 in a3a3b7d
I'd open up another bug asking how to customize this whitelist, not for /cc @natebosch |
I guess you are using targets:
$default:
sources:
exclude: [".git/**"]
_git:
sources:
include: [".git/**"] After that you should be able to construct an asset ID like |
How would a whitelisting help if files don't change? OK - there are some changes but they are deep inside of .git mini_web_sample $ git tag -l --sort=v:refname
v1.0
> mini_web_sample $ git describe --tags --match v1.0
v1.0-4-gb61c783 Thats what the package does (@natebosch: https://github.com/MikeMitterer/dart-git_version/blob/master/lib/git_version.dart) , then it cuts off everything after the last dash. Every commit increases the last value v1.0-4 -> v1.0-5 The builder replaces %version% in index.tmpl.html and changes the extension to index.html Why is a --clean option so bad? It's easy to understand and easy to use.
|
@MikeMitterer As mentioned, using Take a look at @natebosch's comment for an example of what to do. |
Another option would be to run the git command and output it to a file in your package, then read that file in the builder. Then, you just re-run the git command and run a build and only that one builder will rerun. |
You could even wrap up the build command in a little shell script that does that automatically for you before each build? |
It's a pattern we want to discourage so we don't want to build in explicit support and give the impression that we think it's something users should ever have to do.
It's also rarely something the users wants to happen. In this case it's definitely not what you want to happen - you wouldn't want to rerun DDC or any other builders that aren't impacted by the version change coming from git. You'd really like to rerun only that builder and any other builders that depend on it, not the entire build graph. I filed #1512 to track the feature that would solve this problem.
|
Related to #1104
I'm doing a lot of
rm -rf .dart_tool/build; pbr build
to reproduce an issue, etcThe text was updated successfully, but these errors were encountered: