mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 19:28:01 +00:00
fix android updater, add fallback to android check
- copy build.txt to assets (gdx.files.internal looks only inside assets folder)
This commit is contained in:
@@ -425,6 +425,23 @@
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>android-additional-asset</id>
|
||||
<phase>test</phase>
|
||||
<configuration>
|
||||
<target>
|
||||
<delete file="${basedir}/assets/build.txt"/>
|
||||
<copy todir="${basedir}/assets">
|
||||
<fileset dir="${project.build.directory}/classes">
|
||||
<include name="build.txt" />
|
||||
</fileset>
|
||||
</copy>
|
||||
</target>
|
||||
</configuration>
|
||||
<goals>
|
||||
<goal>run</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>android-release-packaging</id>
|
||||
<phase>package</phase>
|
||||
|
||||
@@ -58,7 +58,7 @@ public class AssetsDownloader {
|
||||
final String versionText = isSnapshots ? snapsURL + "version.txt" : releaseURL + "maven-metadata.xml";
|
||||
FileHandle assetsDir = Gdx.files.absolute(ASSETS_DIR);
|
||||
FileHandle resDir = Gdx.files.absolute(RES_DIR);
|
||||
FileHandle buildTxtFileHandle = Gdx.files.classpath("build.txt");
|
||||
FileHandle buildTxtFileHandle = GuiBase.isAndroid() ? Gdx.files.internal("build.txt") : Gdx.files.classpath("build.txt");
|
||||
final SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
boolean verifyUpdatable = false;
|
||||
boolean mandatory = false;
|
||||
@@ -101,6 +101,9 @@ public class AssetsDownloader {
|
||||
buildTimeStamp = format.parse(buildTxtFileHandle.readString());
|
||||
buildDate = buildTimeStamp.toString();
|
||||
verifyUpdatable = snapsTimestamp.after(buildTimeStamp);
|
||||
} else {
|
||||
//fallback to old version comparison
|
||||
verifyUpdatable = !StringUtils.isEmpty(version) && !versionString.equals(version);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user