Skip to content

Commit b7acf9b

Browse files
author
80338435
committed
shuttle: Init shuffle worker
1 parent 3d2e820 commit b7acf9b

File tree

134 files changed

+28348
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

134 files changed

+28348
-0
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/*
2+
* Copyright 2021 OPPO. All rights reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.oppo.shuttle.rss;
18+
19+
import com.oppo.shuttle.rss.common.Constants;
20+
import com.oppo.shuttle.rss.exceptions.Ors2FileException;
21+
22+
import java.io.IOException;
23+
import java.io.InputStream;
24+
import java.util.Properties;
25+
26+
public class BuildVersion {
27+
28+
public static String projectVersion = Constants.UNKNOWN_BUILD_VERSION;
29+
public static String gitCommitVersion = Constants.UNKNOWN_BUILD_VERSION;
30+
31+
static {
32+
try (InputStream versionFileInputStream =
33+
Thread.currentThread().getContextClassLoader().getResourceAsStream(Constants.BUILD_VERSION_FILE)) {
34+
Properties properties = new Properties();
35+
properties.load(versionFileInputStream);
36+
projectVersion = properties.getProperty(Constants.PROJECT_VERSION_KEY);
37+
gitCommitVersion = properties.getProperty(Constants.GIT_COMMIT_VERSION_KEY);
38+
} catch (IOException e) {
39+
throw new Ors2FileException("Failed to open build version file " + Constants.BUILD_VERSION_FILE);
40+
}
41+
}
42+
}

0 commit comments

Comments
 (0)