Ray Milkey | f80bbb2 | 2016-03-11 10:16:22 -0800 | [diff] [blame^] | 1 | python_binary( |
| 2 | name = 'download_file', |
| 3 | main = 'download_file.py', |
| 4 | deps = [':util'], |
| 5 | visibility = ['PUBLIC'], |
| 6 | ) |
| 7 | |
| 8 | python_binary( |
| 9 | name = 'pack_war', |
| 10 | main = 'pack_war.py', |
| 11 | deps = [':util'], |
| 12 | visibility = ['PUBLIC'], |
| 13 | ) |
| 14 | |
| 15 | python_library( |
| 16 | name = 'util', |
| 17 | srcs = [ |
| 18 | 'util.py', |
| 19 | '__init__.py' |
| 20 | ], |
| 21 | visibility = ['PUBLIC'], |
| 22 | ) |
| 23 | |
| 24 | def shquote(s): |
| 25 | return s.replace("'", "'\\''") |
| 26 | |
| 27 | def os_path(): |
| 28 | from os import environ |
| 29 | return environ.get('PATH') |
| 30 | |
| 31 | genrule( |
| 32 | name = 'buck', |
| 33 | cmd = 'echo buck=`which buck`>$OUT;' + |
| 34 | ("echo PATH=\''%s'\' >>$OUT;" % shquote(os_path())), |
| 35 | out = 'buck.properties', |
| 36 | visibility = ['PUBLIC'], |
| 37 | ) |
| 38 | |