forked from antlr/intellij-plugin-v4
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbild.py
executable file
·48 lines (32 loc) · 1.07 KB
/
bild.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/usr/bin/env python
# Type "python bild.py" to build all of the parsers needed by the plugin.
# bootstrap by downloading bilder.py if not found
import urllib
import os
if not os.path.exists("bilder.py"):
print "bootstrapping; downloading bilder.py"
urllib.urlretrieve(
"https://raw.githubusercontent.com/parrt/bild/master/src/python/bilder.py",
"bilder.py")
# assumes bilder.py is in current directory
from bilder import *
def latest_antlr4():
mkdir("lib")
# grab the lib that the plugin needs
jarname = "antlr-4.6-complete.jar"
download("http://www.antlr.org/download/" + jarname, "lib")
def latest_antlr4_sources():
download("https://github.com/antlr/antlr4/archive/4.6.zip", "lib")
mkdir("lib/src")
unjar("lib/4.6.zip", "lib/src")
rmfile("lib/4.6.zip")
def parsers():
require(latest_antlr4)
antlr4("src/grammars", "gen", version="4.6",
package="org.antlr.intellij.plugin.parser")
def clean():
rmdir("gen")
def all():
require(parsers)
require(latest_antlr4_sources)
processargs(globals())