forked from ome/ome-release
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbfgen.py
executable file
·70 lines (56 loc) · 2.44 KB
/
bfgen.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
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import datetime
import fileinput
from utils import RSYNC_PATH, get_version, get_tag_url
from doc_generator import find_pkg, repl_all
latest_url = ("http://ci.openmicroscopy.org/job/BIOFORMATS-5.1-latest/"
"lastSuccessfulBuild/artifact/artifacts")
def usage():
print "bfgen.py version"
sys.exit(1)
try:
version = sys.argv[1]
except:
usage()
repl = {"@VERSION@": version,
"@MONTHYEAR@": datetime.datetime.now().strftime("%b %Y")}
# Read major and minor version from input version
major_version, minor_version = get_version(version)
repl["@TAG_URL@"] = get_tag_url("bioformats", version)
repl["@DOC_URL@"] = (
"http://www.openmicroscopy.org/site/support/bio-formats%s.%s"
% (major_version, minor_version))
PREFIX = os.environ.get('PREFIX', 'bio-formats')
BF_RSYNC_PATH = '%s/%s/%s/' % (RSYNC_PATH, PREFIX, version)
for x, y in (
("COMMAND_LINE_TOOLS", "artifacts/bftools.zip"),
("MATLAB_TOOLS", "artifacts/bfmatlab.zip"),
("DOC", "artifacts/Bio-Formats-@[email protected]"),
("JAVADOCS", "artifacts/bio-formats-javadocs.zip"),
("SOURCE_CODE", "artifacts/bioformats-@[email protected]"),
("bioformats_package.jar", "artifacts/bioformats_package.jar"),
("bio-formats_plugins.jar", "artifacts/bio-formats_plugins.jar"),
("bio-formats-testing-framework.jar",
"artifacts/bio-formats-testing-framework.jar"),
("formats-api.jar", "artifacts/formats-api.jar"),
("formats-bsd.jar", "artifacts/formats-bsd.jar"),
("formats-bsd-test.jar", "artifacts/formats-bsd-test.jar"),
("formats-common.jar", "artifacts/formats-common.jar"),
("formats-gpl.jar", "artifacts/formats-gpl.jar"),
("jai_imageio.jar", "artifacts/jai_imageio.jar"),
("loci_tools.jar", "artifacts/loci_tools.jar"),
("lwf-stubs.jar", "artifacts/lwf-stubs.jar"),
("mdbtools-java.jar", "artifacts/mdbtools-java.jar"),
("metakit.jar", "artifacts/metakit.jar"),
("ome-xml.jar", "artifacts/ome-xml.jar"),
("ome-poi.jar", "artifacts/ome-poi.jar"),
("specification.jar", "artifacts/specification.jar"),
("turbojpeg.jar", "artifacts/turbojpeg.jar"),
):
find_pkg(repl, BF_RSYNC_PATH, x, y)
repl["@LATEST_%s@" % x] = "%s/%s" % (latest_url, x)
for line in fileinput.input(["bf_downloads.html"]):
print repl_all(repl, line, check_http=True),