Skip to content

Commit aaaa39d

Browse files
committed
Update readme and improve variable names
1 parent a6d7364 commit aaaa39d

File tree

3 files changed

+15
-14
lines changed

3 files changed

+15
-14
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,13 +106,14 @@ Then to make sure that OpenCV is installed prior to using any OpenCV code:
106106

107107
```java
108108
import edu.wpi.first.wpilib.opencv.installer.Installer;
109+
import edu.wpi.first.wpilib.opencv.installer.PlatformDetector;
109110
import org.opencv.core.Core;
110111

111112
class Main {
112113

113114
static {
114115
Installer.setOpenCvVersion(Core.VERSION);
115-
Installer.installJni();
116+
Installer.installJni(PlatformDetector.getPlatform().getDefaultJniInstallLocation());
116117
System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
117118
}
118119

src/main/java/edu/wpi/first/wpilib/opencv/installer/Installer.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,28 +113,28 @@ public static void main(String[] args) throws ParseException {
113113
System.out.println("Installing specified OpenCV components");
114114
if (parsedArgs.hasOption("java") || parsedArgs.hasOption("all")) {
115115
try {
116-
installJava(parsedArgs.getOptionValue("java", platform.getJavaInstallLocation()));
116+
installJava(parsedArgs.getOptionValue("java", platform.getDefaultJavaInstallLocation()));
117117
} catch (IOException e) {
118118
e.printStackTrace();
119119
}
120120
}
121121
if (parsedArgs.hasOption("jni") || parsedArgs.hasOption("all")) {
122122
try {
123-
installJni(parsedArgs.getOptionValue("jni", platform.getJniInstallLocation()));
123+
installJni(parsedArgs.getOptionValue("jni", platform.getDefaultJniInstallLocation()));
124124
} catch (IOException e) {
125125
e.printStackTrace();
126126
}
127127
}
128128
if (parsedArgs.hasOption("headers") || parsedArgs.hasOption("all")) {
129129
try {
130-
installHeaders(parsedArgs.getOptionValue("headers", platform.getHeadersInstallLocation()));
130+
installHeaders(parsedArgs.getOptionValue("headers", platform.getDefaultHeadersInstallLocation()));
131131
} catch (IOException e) {
132132
e.printStackTrace();
133133
}
134134
}
135135
if (parsedArgs.hasOption("natives") || parsedArgs.hasOption("all")) {
136136
try {
137-
installNatives(parsedArgs.getOptionValue("natives", platform.getNativesInstallLocation()));
137+
installNatives(parsedArgs.getOptionValue("natives", platform.getDefaultNativesInstallLocation()));
138138
} catch (IOException e) {
139139
e.printStackTrace();
140140
}

src/main/java/edu/wpi/first/wpilib/opencv/installer/Platform.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -63,25 +63,25 @@ private static final class UserHomeHolder {
6363
}
6464

6565
/**
66-
* The location of installs for the Java library.
66+
* The default location of installs for the Java library.
6767
*/
68-
private final String javaInstallLocation;
68+
private final String defaultJavaInstallLocation;
6969

7070
/**
71-
* The location of installs for the JNI bindings. This should be in a location that is on {@code java.library.path}
72-
* by default.
71+
* The default location of installs for the JNI bindings. This should be in a location that is on
72+
* {@code java.library.path} by default.
7373
*/
74-
private final String jniInstallLocation;
74+
private final String defaultJniInstallLocation;
7575

7676
/**
77-
* The location of installs for the C++ header files.
77+
* The default location of installs for the C++ header files.
7878
*/
79-
private final String headersInstallLocation;
79+
private final String defaultHeadersInstallLocation;
8080

8181
/**
82-
* The location of installs for the native C++ libraries. This should be a default location on the path
82+
* The default location of installs for the native C++ libraries. This should be a default location on the path
8383
* (e.g. {@code /usr/local/}).
8484
*/
85-
private final String nativesInstallLocation;
85+
private final String defaultNativesInstallLocation;
8686

8787
}

0 commit comments

Comments
 (0)