Temporarily fixed version number is 1

I think we can temporarily fix the version number to 1, and then tf2.x declares the Implementation-Version.
This commit is contained in:
韩董 2019-09-27 11:34:41 +08:00 committed by GitHub
parent 2df4c12ac0
commit ffd9edffeb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -71,12 +71,6 @@ final class NativeLibrary {
log("frameworkResourceName: " + frameworkResourceName);
final InputStream frameworkResource =
NativeLibrary.class.getClassLoader().getResourceAsStream(frameworkResourceName);
if ("libtensorflow_framework.so".equals(frameworkLibName)) {
frameworkLibName = "libtensorflow_framework.so.1";
}
if ("libtensorflow_framework.dylib".equals(frameworkLibName)) {
frameworkLibName = "libtensorflow_framework.1.dylib";
}
// Do not complain if the framework resource wasn't found. This may just mean that we're
// building with --config=monolithic (in which case it's not needed and not included).
if (jniResource == null) {
@ -139,9 +133,9 @@ final class NativeLibrary {
private static String getVersionedLibraryName(String libFilename) {
// If the resource exists as an unversioned file, return that.
if (resourceExists(libFilename)) {
return libFilename;
}
// if (resourceExists(libFilename)) {
// return libFilename;
// }
final String versionName = getMajorVersionNumber();
@ -180,11 +174,13 @@ final class NativeLibrary {
* determined.
*/
private static String getMajorVersionNumber() {
// getImplementationVersion() retrun null.
String version = NativeLibrary.class.getPackage().getImplementationVersion();
// expecting a string like 1.14.0, we want to get the first '1'.
int dotIndex;
if (version == null || (dotIndex = version.indexOf('.')) == -1) {
return null;
// we want to get the version 1.
return "1";
}
String majorVersion = version.substring(0, dotIndex);
try {