Skip to content

Commit 01e3e36

Browse files
author
Karl Rieb
committed
spec: Update to latest API specs.
1 parent 5fb1768 commit 01e3e36

6 files changed

Lines changed: 50 additions & 9 deletions

File tree

ChangeLog.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
2+
---------------------------------------------
3+
2.0-beta-5 (2016-01-22)
4+
- Updated to latest API specs.
15
- Change format of tagged union classes.
26
- Change getter method format from getAbc() to getAbcValue().
37
- Add new isAbc() convenience methods.

babel

Submodule babel updated from 54f8a7f to 3747005

generator/java.babelg.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ def format_route_ref(api, namespace, route):
181181
def format_route(api_namespace, api_route):
182182
if uses_builder_pattern(api_route):
183183
return '%s#%s' % (namespace_ref(api_namespace), builder_method_name(api_route))
184-
elif is_void_type(api_route.request_data_type):
184+
elif is_void_type(api_route.request_data_type) or is_union_type(api_route.request_data_type):
185185
return '%s#%s' % (namespace_ref(api_namespace), routename(api_route.name))
186186
else:
187187
# by default, all doc refs should point to the method that
@@ -1663,6 +1663,13 @@ def generate_javadoc(self, doc, params=None, returns=None, throws=None):
16631663
out('/**')
16641664

16651665
if doc:
1666+
# sanitize &, <, > characters
1667+
for char, code in (('&', '&amp;'),
1668+
('<', '&lt;'),
1669+
('>', '&gt;')):
1670+
doc = doc.replace(char, code)
1671+
1672+
16661673
first_paragraph = True
16671674
for paragraph in split_paragraphs(doc.strip()):
16681675
if not first_paragraph:

pom.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@
4141
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
4242
<skipTests>true</skipTests>
4343
<osgi.bnd.noee>false</osgi.bnd.noee>
44+
<!-- BEGIN PRIVATE REPO ONLY -->
45+
<specDir>${project.basedir}/spec</specDir>
46+
<!-- END PRIVATE REPO ONLY -->
4447
</properties>
4548

4649
<dependencies>
@@ -229,6 +232,9 @@
229232
<configuration>
230233
<executable>run-babel-codegen</executable>
231234
<sourceRoot>${project.build.directory}/generated-sources/babel</sourceRoot>
235+
<arguments>
236+
<argument>${specDir}</argument>
237+
</arguments>
232238
</configuration>
233239
</execution>
234240
</executions>

run-babel-codegen

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,42 @@ while [ -h "$loc" ]; do
1515
fi
1616
done
1717

18-
if [[ $# -ne 0 ]]; then
19-
echo "$0: Not expecting any command-line arguments, got $#." 1>&2
20-
exit 1
21-
fi
22-
2318
base_dir=`dirname "$loc"`
2419

2520
babel_dir="$base_dir/babel"
26-
spec_dir="$base_dir/spec"
2721
gen_dir="$base_dir/$mvn_target_dir/generated-sources/babel"
2822
generator="$base_dir/generator/java.babelg.py"
2923

24+
usage() {
25+
echo "usage: $0 [SPEC_DIR]"
26+
echo ""
27+
echo "positional arguments:"
28+
echo " SPEC_DIR Top-level directory containing Babel spec files."
29+
echo ""
30+
echo "optional arguments:"
31+
echo " -h/--help Display this message and exit."
32+
}
33+
34+
if [[ $# -gt 0 ]]; then
35+
case "$1" in
36+
"-h"|"--help")
37+
usage
38+
exit 0
39+
;;
40+
*)
41+
spec_dir="$1"
42+
shift
43+
esac
44+
else
45+
spec_dir="$base_dir/spec"
46+
fi
47+
48+
if [[ $# -ne 0 ]]; then
49+
echo "$0: Too many arguments" 1>&2
50+
usage
51+
exit 1
52+
fi
53+
3054
up_to_date() {
3155
local target="$1"; shift
3256
[[ -f "$target" && $(find "$@" -newer "$target" | head -n 1 | wc -l) -eq 0 ]]

0 commit comments

Comments
 (0)