mirror of
https://gitcode.com/gh_mirrors/re/react-native-pushy.git
synced 2025-12-16 10:02:34 +08:00
添加buildTime
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
int MILLIS_IN_MINUTE = 1000 * 60
|
||||
int minutesSinceEpoch = System.currentTimeMillis() / MILLIS_IN_MINUTE
|
||||
|
||||
def safeExtGet(prop, fallback) {
|
||||
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
|
||||
@@ -22,6 +24,17 @@ android {
|
||||
jniLibs.srcDirs = ['./lib']
|
||||
}
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
buildConfigField("String", "PUSHY_BUILD_TIME", "\"${minutesSinceEpoch}\"")
|
||||
resValue("string", "pushy_build_time", "${minutesSinceEpoch}")
|
||||
}
|
||||
debug {
|
||||
buildConfigField("String", "PUSHY_BUILD_TIME", "\"0\"")
|
||||
resValue("string", "pushy_build_time", "0")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
repositories {
|
||||
|
||||
@@ -59,6 +59,10 @@ public class UpdateContext {
|
||||
return null;
|
||||
}
|
||||
|
||||
public String getBuildTime() {
|
||||
return BuildConfig.PUSHY_BUILD_TIME;
|
||||
}
|
||||
|
||||
public interface DownloadFileListener {
|
||||
void onDownloadCompleted();
|
||||
void onDownloadFailed(Throwable error);
|
||||
|
||||
@@ -41,6 +41,7 @@ public class UpdateModule extends ReactContextBaseJavaModule{
|
||||
constants.put("downloadRootDir", updateContext.getRootDir());
|
||||
constants.put("packageVersion", updateContext.getPackageVersion());
|
||||
constants.put("currentVersion", updateContext.getCurrentVersion());
|
||||
constants.put("buildTime", updateContext.getBuildTime());
|
||||
boolean isFirstTime = updateContext.isFirstTime();
|
||||
constants.put("isFirstTime", isFirstTime);
|
||||
if (isFirstTime) {
|
||||
|
||||
Reference in New Issue
Block a user