Created
December 27, 2009 05:59
-
-
Save leandrosilva/264171 to your computer and use it in GitHub Desktop.
Thorfile for my Ebuild
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'thor' | |
| class Ebuild < Thor | |
| desc 'all', 'clean, compile and generate edoc for all modules' | |
| def all | |
| clean | |
| compile | |
| doc | |
| end | |
| desc 'clean', 'clean ebin directory' | |
| def clean | |
| `rm -rf ebin/*` | |
| end | |
| desc 'compile', 'compile all source code' | |
| def compile | |
| clean | |
| `erlc -o ebin/ -I include/ src/*.erl test/*.erl` | |
| `cp src/*.app ebin/` | |
| end | |
| desc 'doc', 'generate edoc for all modules' | |
| def doc | |
| Dir.glob(File.expand_path('src/*.erl')).each do |filename| | |
| `erl -noshell -run edoc file src/#{File.basename(filename)} -run init stop` | |
| end | |
| `mv src/*.html doc/` | |
| Dir.glob(File.expand_path('test/*.erl')).each do |filename| | |
| `erl -noshell -run edoc file test/#{File.basename(filename)} -run init stop` | |
| end | |
| `mv test/*.html doc/` | |
| end | |
| desc 'test', 'run a EUnit tests' | |
| def test(name) | |
| puts `erl -pa ebin/ -noshell -run #{name} test -run init stop` | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment