在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):jekor/redo开源软件地址(OpenSource Url):https://github.com/jekor/redo开源编程语言(OpenSource Language):Haskell 99.2%开源软件介绍(OpenSource Introduction):Redo: A Simple Way to (Re)build Targets from SourcesRedo allows you to rebuild files from source files when they've changed. It's simpler than other build systems such as Make or SCons and more generic than language-specific build systems such as Cabal or Apache Ant. Redo gains its power and simplicity by leveraging other tools (in the Unix tradition). Build scripts for redo are simply shell scripts that follow a few conventions. UsageTo build a target file, invoke redo with one or more target arguments.
There are no command-line options. Unlike Make, there is no default target for when you invoke What You Can Use Redo forYou can use Compiling Source CodeCompiling a .c File into a .o File
Converting Markup into DocumentsGenerating an HTML Document from a Markdown Document
Advantages Over Make
Limitations
Note that you can find a minimal implementation of redo written in bourne shell here. It's called "do" since it doesn't track changes to dependencies and always fully rebuilds the target(s), but it should be suitable for distributing with your source archive. How to Use Redo in Your Project.do ScriptsRedo builds a target file by looking for a corresponding .do script. For example, you might want to build the file
Your script is not required to use any of these arguments, although you will usually want to use Scripts are executed by Atomic OutputAnything output to standard output will automatically be appended to the temporary output file ( A temporary file is used (rather than outputting directly to the target file) to ensure that the target file only appears if it has been fully and correctly rebuilt (instead of partially rebuilt due to some interruption). For example, if you wanted to convert
you should write:
or, you could take advantage of the fact that pandoc outputs to stdout by default and write:
and generalizing further with the
Specifying DependenciesTo specify that a target file depends on 1 or more source files, use the command
or more flexibly:
Redo will track the checksums of any dependencies specified this way and only build the target file if at least 1 of its dependencies has changed or the target file is missing. RecursionRedo is able to track dependencies recursively. For example, if you were not creating
Note that since Redo will know when checking whether to rebuild Similarly, if you later wanted to build one of the chapter files from some other files, you just need to add an appropriate .do script (e.g. DefaultsRedo supports writing generic .do scripts based on file extensions. For example, if you had multiple Markdown files that you wanted to convert to HTML files, rather than write multiple .do scripts, you could instead take your existing
StabilityI consider redo to be stable but not feature complete. Redo is used to build itself. However, it is not a very complicated program. Most of redis's build system (~200 lines of Make) was converted to .do scripts as a test of redo's suitability. Redo has only been tested on FreeBSD and Linux. Implementation DetailsRedo is written in Haskell. It was written "on-camera" by Chris Forno (jekor) as part of a tutorial video series on real-world Haskell development. You can find the videos on YouTube. CreditsD. J. Bernstein conceived the idea behind redo and wrote some initial documentation at http://cr.yp.to/redo.html. Alan Grosskurth wrote a thesis "Purely top-down software building" that includes an analysis and implementation of redo. Mitchell Rosen, Göktuğ Kayaalp, and Rotten194 contributed suggestions on the tutorial videos during the process of writing the program. Many other viewers provided silent code review. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论