4
To build plugins from MonoDevelop solution:
7
To build the Mono.Addins repository in folder "repo":
10
To publish the repository (example publishes to community repo v0.4):
14
$ ./repo.py --make --build --publish
18
from os.path import commonprefix, abspath
19
from subprocess import Popen, PIPE
22
REPO_NAME = "official"
23
REPO_SCP = "gnomedo@do.davebsd.com:do.davebsd.com/repo/%s/%s" % \
24
(REPO_VERSION, REPO_NAME)
26
REPO_DIR = abspath ("repo")
30
if "--make" in argv or "--all" in argv:
32
if "--build" in argv or "--all" in argv:
34
if "--publish" in argv or "--all" in argv:
38
system ("mdtool build")
41
repo = escape (REPO_DIR)
42
system ("rm -rf %s" % repo)
43
system ("mkdir -p %s" % repo)
44
for asm in assemblies ():
45
system ("cp %s %s" % (escape (asm), repo))
46
for man in manifests (asm):
47
system ("cp %s %s" % (escape (man), repo))
48
system ("mdtool setup pack %s/*.addin.xml -d:%s" % (repo, repo))
49
system ("mdtool setup rep-build %s" % repo)
50
system ("rm -rf %s/*.dll %s/*.addin.xml" % (repo, repo))
53
repo = escape (REPO_DIR)
54
system ("scp -r %s/* %s" % (repo, REPO_SCP))
56
def manifests (asm=None):
59
ls = map (abspath, shsp ('ls'))
60
common = [(commonprefix ([p, asm]), p) for p in ls]
61
dir = abspath (max (common)[1])
63
find = 'find %s -name *.addin.xml' % dir
64
return map (abspath, shsp (find))
66
def assemblies (config=None):
67
config = config or REPO_CONFIG
68
find = 'find . -path *%s* -name *.dll' % config
69
return map (abspath, shsp (find))
72
return path.replace (' ', '\ ')
75
return sh (*lines).splitlines ()
78
"""Pipe commands together and return the output.
82
ls2 = sh ("ls", "grep Hello")
83
ps1 = sh ("ps -aux", "grep firefox")
86
for argv in map (to_argv, lines):
88
out = Popen (argv, stdin=out.stdout, stdout=PIPE)
90
out = Popen (argv, stdout=PIPE)
92
return out.communicate ()[0]
97
mask = lambda s: s.replace ('\ ', '____')
98
unmask = lambda s: s.replace ('____', ' ')
99
return map (unmask, mask (line).split ())
101
if __name__ == "__main__":