forked from antlr/stringtemplate4
-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy.py
executable file
·85 lines (60 loc) · 2.11 KB
/
deploy.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#!/usr/bin/env python
import os
"""
This script uses my experimental build tool http://www.bildtool.org
This script deploys artifacts created by bild.py.
Windows build using this script is not yet supported.
cd /usr/local/antlr/stringtemplate4
./deploy.py mvn_snapshot
or
./deploy.py mvn_deploy
or
./deploy.py pypi
or
./deploy.py # does "all"
This script must be run from the main antlr4 directory.
"""
# 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 *
VERSION = "4.0.8"
def mvn_snapshot(): # assumes that you have ~/.m2/settings.xml set up
binjar = uniformpath("dist/ST4-%s.jar" % VERSION)
docjar = uniformpath("dist/ST4-%s-javadoc.jar" % VERSION)
srcjar = uniformpath("dist/ST4-%s-sources.jar" % VERSION)
mvn(command="deploy:deploy-file",
binjar=binjar,
srcjar=srcjar,
docjar=docjar,
repositoryid="ossrh",
artifactid="ST4",
pomfile="pom.xml",
url="https://oss.sonatype.org/content/repositories/snapshots")
# deploy to maven central
def mvn_deploy(): # assumes that you have ~/.m2/settings.xml set up
binjar = uniformpath("dist/ST4-%s.jar" % VERSION)
docjar = uniformpath("dist/ST4-%s-javadoc.jar" % VERSION)
srcjar = uniformpath("dist/ST4-%s-sources.jar" % VERSION)
mvn(command="gpg:sign-and-deploy-file",
binjar=binjar,
srcjar=srcjar,
docjar=docjar, repositoryid="ossrh",
pomfile="pom.xml",
url="https://oss.sonatype.org/service/local/staging/deploy/maven2/")
def website():
"""
Push all jars, source, target artifacts etc.
"""
# There is no JavaScript project i.e; nothing to "build" it's just a bunch of files that I zip.
pass
def all(): # Note: building artifacts is in a separate file bild.py
mvn()
website()
processargs(globals()) # E.g., "python bild.py all"