aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--Makefile12
-rwxr-xr-xnant-color52
2 files changed, 64 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..b863345
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,12 @@
1all:
2 export PATH=/usr/local/bin:$(PATH)
3 ./runprebuild.sh
4 ./nant-color
5 find OpenSim -name \*.mdb -exec cp {} bin \;
6
7clean:
8 export PATH=/usr/local/bin:$(PATH)
9 ./nant-color clean
10
11tags:
12 find OpenSim -name \*\.cs | xargs etags
diff --git a/nant-color b/nant-color
new file mode 100755
index 0000000..ca5ea37
--- /dev/null
+++ b/nant-color
@@ -0,0 +1,52 @@
1#!/usr/bin/ruby
2
3
4def main
5 IO.popen("nant #{ARGV.join(' ')}") { |pipe|
6 pipe.sync = true
7 while str = pipe.gets
8 str.sub!(/\n+/, '')
9 puts colorize(str)
10 end
11 }
12end
13
14def clear
15 return "\e[0m"
16end
17
18def red(str)
19 return "\e[31m" + str + clear
20end
21
22def green(str)
23 return "\e[32m" + str + clear
24end
25
26def yellow(str)
27 return "\e[33m" + str + clear
28end
29
30def black
31 return "\e[30m"
32end
33
34def hide
35 return "\e[8m"
36end
37
38def bright
39 return "\e[1m"
40end
41
42def colorize(str)
43 str.sub!(/(error \w+:.*)/, red('\1'))
44 str.sub!(/(warning \w+:.*)/, yellow('\1'))
45
46 str.sub!(/(Build Succeeded)/i, green('\1'))
47 str.sub!(/(Compilation succeeded)/, green('\1'))
48 str.sub!(/(\d+ warning\(s\))/, yellow('\1'))
49 return str
50end
51
52main()