Cleaning with Tup

拜拜、爱过 提交于 2019-12-13 18:19:48

问题


How do I clean my build artifacts with Tup?

My project generates a lot of artifacts that I would like to have cleaned up. Tup doesn't seem to have a way to do it, and git reset --hard HEAD, even after a git add -Af, doesn't work.


回答1:


Just for completeness, you can keep things clean with variants.

touch default.config # An empty config file is ok
tup variant default
tup

Build files will go in the directory ./build-default.

If you do the above in an active tup project, tup will remove all the in-situ build files and move them to the build directory for you.

There is nothing special about the tup variant command. It just provides a little automation. The following would acheive the same:

touch default.config
mkdir build-default
ln -s default.config build-default/tup.config
tup



回答2:


Tup does not have a clean function like Makefiles can define.

If you're using a Git repository, you can git-clean your repository.

$ git add -A
$ git reset --hard HEAD
$ git clean -dffx

If you're working on some changes and need to clean away all of the stuff without killing your changes, use:

$ git clean -Xf


来源:https://stackoverflow.com/questions/28886876/cleaning-with-tup

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!