Skip to content

Commit 674cf71

Browse files
author
Ted Strzalkowski
committed
Disable Java wrapper build by default.
- Java wrapper build isn't necessary for all Python builds. - Java wrapper build can now be enabled with ``ENABLE_JAVA`` environment variable.
1 parent 914404d commit 674cf71

File tree

3 files changed

+41
-0
lines changed

3 files changed

+41
-0
lines changed

.travis.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,18 @@ jobs:
6666
- SDIST=1
6767
- ENABLE_CONTRIB=0
6868
- ENABLE_HEADLESS=0
69+
- ENABLE_JAVA=0
70+
python: "3.8"
71+
language: python
72+
dist: xenial
73+
- os: linux
74+
stage: s1
75+
script: skip
76+
env:
77+
- SDIST=1
78+
- ENABLE_CONTRIB=0
79+
- ENABLE_HEADLESS=0
80+
- ENABLE_JAVA=1
6981
python: "3.8"
7082
language: python
7183
dist: xenial
@@ -76,6 +88,18 @@ jobs:
7688
- SDIST=1
7789
- ENABLE_CONTRIB=0
7890
- ENABLE_HEADLESS=1
91+
- ENABLE_JAVA=0
92+
python: "3.8"
93+
language: python
94+
dist: xenial
95+
- os: linux
96+
stage: s1
97+
script: skip
98+
env:
99+
- SDIST=1
100+
- ENABLE_CONTRIB=1
101+
- ENABLE_HEADLESS=0
102+
- ENABLE_JAVA=0
79103
python: "3.8"
80104
language: python
81105
dist: xenial
@@ -86,6 +110,18 @@ jobs:
86110
- SDIST=1
87111
- ENABLE_CONTRIB=1
88112
- ENABLE_HEADLESS=0
113+
- ENABLE_JAVA=1
114+
python: "3.8"
115+
language: python
116+
dist: xenial
117+
- os: linux
118+
stage: s1
119+
script: skip
120+
env:
121+
- SDIST=1
122+
- ENABLE_CONTRIB=0
123+
- ENABLE_HEADLESS=1
124+
- ENABLE_JAVA=1
89125
python: "3.8"
90126
language: python
91127
dist: xenial
@@ -96,6 +132,7 @@ jobs:
96132
- SDIST=1
97133
- ENABLE_CONTRIB=1
98134
- ENABLE_HEADLESS=1
135+
- ENABLE_JAVA=1
99136
python: "3.8"
100137
language: python
101138
dist: xenial

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ The build can be customized with environment variables. In addition to any varia
113113

114114
- ``CI_BUILD``. Set to ``1`` to emulate the CI environment build behaviour. Used only in CI builds to force certain build flags on in ``setup.py``. Do not use this unless you know what you are doing.
115115
- ``ENABLE_CONTRIB`` and ``ENABLE_HEADLESS``. Set to ``1`` to build the contrib and/or headless version
116+
- ``ENABLE_JAVA``, Set to ``1`` to enable the Java client build. This is disabled by default.
116117
- ``CMAKE_ARGS``. Additional arguments for OpenCV's CMake invocation. You can use this to make a custom build.
117118

118119
See the next section for more info about manual builds outside the CI environment.

setup.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ def main():
1919
minimum_supported_numpy = "1.13.1"
2020
build_contrib = get_build_env_var_by_name("contrib")
2121
build_headless = get_build_env_var_by_name("headless")
22+
build_java = get_build_env_var_by_name("java")
2223

2324
if sys.version_info[:2] >= (3, 6):
2425
minimum_supported_numpy = "1.13.3"
@@ -121,6 +122,8 @@ def main():
121122
"-DPYTHON3_LIBRARY=%s" % python_lib_path,
122123
"-DBUILD_opencv_python3=ON",
123124
"-DBUILD_opencv_python2=OFF",
125+
# Disable the Java build by default as it is not needed
126+
"-DBUILD_opencv_java=%s" % build_java,
124127
# When off, adds __init__.py and a few more helper .py's. We use our own helper files with a different structure.
125128
"-DOPENCV_SKIP_PYTHON_LOADER=ON",
126129
# Relative dir to install the built module to in the build tree.

0 commit comments

Comments
 (0)