Константа std::OwnLang с версией и платформой

This commit is contained in:
Victor 2019-01-02 18:57:15 +02:00
parent 9540834d2f
commit dbdc56f323
2 changed files with 14 additions and 2 deletions

View File

@ -22,7 +22,12 @@ import java.util.concurrent.TimeUnit;
*/
public final class Main {
public static final String VERSION = "1.3.1_" + Gen.BUILD_DATE;
public static int VERSION_MAJOR = 1;
public static int VERSION_MINOR = 4;
public static int VERSION_PATCH = 0;
public static final String VERSION = VERSION_MAJOR + "."
+ VERSION_MINOR + "." + VERSION_PATCH
+ "_" + Gen.BUILD_DATE;
private static String[] ownlangArgs = new String[0];

View File

@ -11,6 +11,13 @@ import com.annimon.ownlang.modules.Module;
public final class std implements Module {
public static void initConstants() {
MapValue ownlang = new MapValue(5);
ownlang.set("PLATFORM", new StringValue("desktop"));
ownlang.set("VERSION", new StringValue(Main.VERSION));
ownlang.set("VERSION_MAJOR", NumberValue.of(Main.VERSION_MAJOR));
ownlang.set("VERSION_MINOR", NumberValue.of(Main.VERSION_MINOR));
ownlang.set("VERSION_PATCH", NumberValue.of(Main.VERSION_PATCH));
Variables.define("OwnLang", ownlang);
}
@Override