Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
b525c282
Commit
b525c282
authored
Sep 12, 2013
by
Roman Donchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated the Java bindings and docs to support the version status.
parent
473bfb00
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
5 deletions
+12
-5
conf.py
doc/conf.py
+2
-0
gen_java.py
modules/java/generator/gen_java.py
+10
-5
No files found.
doc/conf.py
View file @
b525c282
...
...
@@ -55,6 +55,7 @@ version_epoch = re.search("^W*#\W*define\W+CV_VERSION_EPOCH\W+(\d+)\W*$", versio
version_major
=
re
.
search
(
"^W*#
\
W*define
\
W+CV_VERSION_MAJOR
\
W+(
\
d+)
\
W*$"
,
version_file
,
re
.
MULTILINE
)
.
group
(
1
)
version_minor
=
re
.
search
(
"^W*#
\
W*define
\
W+CV_VERSION_MINOR
\
W+(
\
d+)
\
W*$"
,
version_file
,
re
.
MULTILINE
)
.
group
(
1
)
version_patch
=
re
.
search
(
"^W*#
\
W*define
\
W+CV_VERSION_REVISION
\
W+(
\
d+)
\
W*$"
,
version_file
,
re
.
MULTILINE
)
.
group
(
1
)
version_status
=
re
.
search
(
"^W*#
\
W*define
\
W+CV_VERSION_STATUS
\
W+
\"
(.*?)
\"
\
W*$"
,
version_file
,
re
.
MULTILINE
)
.
group
(
1
)
# The short X.Y version.
version
=
version_epoch
+
'.'
+
version_major
...
...
@@ -62,6 +63,7 @@ version = version_epoch + '.' + version_major
release
=
version_epoch
+
'.'
+
version_major
+
'.'
+
version_minor
if
version_patch
:
release
=
release
+
'.'
+
version_patch
release
+=
version_status
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
...
...
modules/java/generator/gen_java.py
View file @
b525c282
...
...
@@ -632,7 +632,8 @@ def getLibVersion(version_hpp_path):
major
=
re
.
search
(
"^W*#
\
W*define
\
W+CV_VERSION_MAJOR
\
W+(
\
d+)
\
W*$"
,
version_file
,
re
.
MULTILINE
)
.
group
(
1
)
minor
=
re
.
search
(
"^W*#
\
W*define
\
W+CV_VERSION_MINOR
\
W+(
\
d+)
\
W*$"
,
version_file
,
re
.
MULTILINE
)
.
group
(
1
)
revision
=
re
.
search
(
"^W*#
\
W*define
\
W+CV_VERSION_REVISION
\
W+(
\
d+)
\
W*$"
,
version_file
,
re
.
MULTILINE
)
.
group
(
1
)
return
(
epoch
,
major
,
minor
,
revision
)
status
=
re
.
search
(
"^W*#
\
W*define
\
W+CV_VERSION_STATUS
\
W+
\"
(.*?)
\"
\
W*$"
,
version_file
,
re
.
MULTILINE
)
.
group
(
1
)
return
(
epoch
,
major
,
minor
,
revision
,
status
)
class
ConstInfo
(
object
):
def
__init__
(
self
,
cname
,
name
,
val
,
addedManually
=
False
):
...
...
@@ -799,15 +800,19 @@ public class %(jc)s {
"""
%
{
'm'
:
self
.
module
,
'jc'
:
jname
}
)
if
class_name
==
'Core'
:
(
epoch
,
major
,
minor
,
revision
)
=
getLibVersion
(
(
epoch
,
major
,
minor
,
revision
,
status
)
=
getLibVersion
(
(
os
.
path
.
dirname
(
__file__
)
or
'.'
)
+
'/../../core/include/opencv2/core/version.hpp'
)
version_str
=
'.'
.
join
(
(
epoch
,
major
,
minor
,
revision
)
)
version_str
=
'.'
.
join
(
(
epoch
,
major
,
minor
,
revision
)
)
+
status
version_suffix
=
''
.
join
(
(
epoch
,
major
,
minor
)
)
self
.
classes
[
class_name
]
.
imports
.
add
(
"java.lang.String"
)
self
.
java_code
[
class_name
][
"j_code"
]
.
write
(
"""
public static final String VERSION = "
%(v)
s", NATIVE_LIBRARY_NAME = "opencv_java
%(vs)
s";
public static final int VERSION_EPOCH =
%(ep)
s, VERSION_MAJOR =
%(ma)
s, VERSION_MINOR =
%(mi)
s, VERSION_REVISION =
%(re)
s;
"""
%
{
'v'
:
version_str
,
'vs'
:
version_suffix
,
'ep'
:
epoch
,
'ma'
:
major
,
'mi'
:
minor
,
're'
:
revision
}
)
public static final int VERSION_EPOCH =
%(ep)
s;
public static final int VERSION_MAJOR =
%(ma)
s;
public static final int VERSION_MINOR =
%(mi)
s;
public static final int VERSION_REVISION =
%(re)
s;
public static final String VERSION_STATUS = "
%(st)
s";
"""
%
{
'v'
:
version_str
,
'vs'
:
version_suffix
,
'ep'
:
epoch
,
'ma'
:
major
,
'mi'
:
minor
,
're'
:
revision
,
'st'
:
status
}
)
def
add_class
(
self
,
decl
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment