1
0
mirror of https://github.com/janet-lang/janet synced 2024-11-28 11:09:54 +00:00

Update version schema - now have version number

and build number.
This commit is contained in:
Calvin Rose 2018-12-08 14:17:03 -05:00
parent 043f61ef7a
commit 16e514b351
6 changed files with 25 additions and 16 deletions

View File

@ -27,11 +27,10 @@ PREFIX?=/usr/local
INCLUDEDIR=$(PREFIX)/include/janet INCLUDEDIR=$(PREFIX)/include/janet
LIBDIR=$(PREFIX)/lib LIBDIR=$(PREFIX)/lib
BINDIR=$(PREFIX)/bin BINDIR=$(PREFIX)/bin
JANET_VERSION?="\"commit-$(shell git log --pretty=format:'%h' -n 1)\"" JANET_BUILD?="\"$(shell git log --pretty=format:'%h' -n 1)\""
#CFLAGS=-std=c99 -Wall -Wextra -Isrc/include -fpic -g -DJANET_VERSION=$(JANET_VERSION)
CFLAGS=-std=c99 -Wall -Wextra -Isrc/include -fpic -O2 -fvisibility=hidden \ CFLAGS=-std=c99 -Wall -Wextra -Isrc/include -fpic -O2 -fvisibility=hidden \
-DJANET_VERSION=$(JANET_VERSION) -DJANET_BUILD=$(JANET_BUILD)
CLIBS=-lm -ldl CLIBS=-lm -ldl
JANET_TARGET=janet JANET_TARGET=janet
JANET_LIBRARY=libjanet.so JANET_LIBRARY=libjanet.so
@ -87,7 +86,7 @@ EMCCFLAGS=-std=c99 -Wall -Wextra -Isrc/include -O2 \
-s EXTRA_EXPORTED_RUNTIME_METHODS='["cwrap"]' \ -s EXTRA_EXPORTED_RUNTIME_METHODS='["cwrap"]' \
-s ALLOW_MEMORY_GROWTH=1 \ -s ALLOW_MEMORY_GROWTH=1 \
-s AGGRESSIVE_VARIABLE_ELIMINATION=1 \ -s AGGRESSIVE_VARIABLE_ELIMINATION=1 \
-DJANET_VERSION=$(JANET_VERSION) -DJANET_BUILD=$(JANET_BUILD)
JANET_EMTARGET=janet.js JANET_EMTARGET=janet.js
JANET_WEB_SOURCES=$(JANET_CORE_SOURCES) $(JANET_WEBCLIENT_SOURCES) JANET_WEB_SOURCES=$(JANET_CORE_SOURCES) $(JANET_WEBCLIENT_SOURCES)
JANET_EMOBJECTS=$(patsubst %.c,%.bc,$(JANET_WEB_SOURCES)) JANET_EMOBJECTS=$(patsubst %.c,%.bc,$(JANET_WEB_SOURCES))

View File

@ -1,4 +1,4 @@
version: 1.0.{build} version: build-{build}
branches: branches:
only: only:
- master - master
@ -34,5 +34,11 @@ only_commits:
artifacts: artifacts:
- path: janet.exe - path: janet.exe
name: janet name: janet.exe
type: File
- path: janet.dll
name: janet.dll
type: File
- path: janet.lib
name: janet.lib
type: File type: File

View File

@ -779,6 +779,8 @@ JanetTable *janet_core_env(void) {
/* Platform detection */ /* Platform detection */
janet_def(env, "janet/version", janet_cstringv(JANET_VERSION), janet_def(env, "janet/version", janet_cstringv(JANET_VERSION),
"The version number of the running janet program."); "The version number of the running janet program.");
janet_def(env, "janet/build", janet_cstringv(JANET_BUILD),
"The build identifier of the running janet program.");
/* Set as gc root */ /* Set as gc root */
janet_gcroot(janet_wrap_table(env)); janet_gcroot(janet_wrap_table(env));

View File

@ -29,8 +29,10 @@ extern "C" {
/***** START SECTION CONFIG *****/ /***** START SECTION CONFIG *****/
#ifndef JANET_VERSION #define JANET_VERSION "0.0.0"
#define JANET_VERSION "0.0.0 alpha"
#ifndef JANET_BUILD
#define JANET_BUILD "local"
#endif #endif
/* /*

View File

@ -23,7 +23,7 @@
-- Stop handling options`) -- Stop handling options`)
(os/exit 0) (os/exit 0)
1) 1)
"v" (fn [&] (print janet/version) (os/exit 0) 1) "v" (fn [&] (print janet/version "-" janet/build) (os/exit 0) 1)
"s" (fn [&] (:= *raw-stdin* true) (:= *should-repl* true) 1) "s" (fn [&] (:= *raw-stdin* true) (:= *should-repl* true) 1)
"r" (fn [&] (:= *should-repl* true) 1) "r" (fn [&] (:= *should-repl* true) 1)
"p" (fn [&] (:= *exit-on-error* false) 1) "p" (fn [&] (:= *exit-on-error* false) 1)
@ -53,7 +53,7 @@
(if *raw-stdin* (if *raw-stdin*
(repl nil identity) (repl nil identity)
(do (do
(print (string "Janet " janet/version " Copyright (C) 2017-2018 Calvin Rose")) (print (string "Janet " janet/version "-" janet/build " Copyright (C) 2017-2018 Calvin Rose"))
(repl (fn [buf p] (repl (fn [buf p]
(def [line] (parser/where p)) (def [line] (parser/where p))
(def prompt (string "janet:" line ":" (parser/state p) "> ")) (def prompt (string "janet:" line ":" (parser/state p) "> "))

View File

@ -1,5 +1,5 @@
# Copyright 2017-2018 (C) Calvin Rose # Copyright 2017-2018 (C) Calvin Rose
(print (string "Janet " janet/version " Copyright (C) 2017-2018 Calvin Rose")) (print (string "Janet " janet/version "-" janet/build " Copyright (C) 2017-2018 Calvin Rose"))
(fiber/new (fn webrepl [] (fiber/new (fn webrepl []
(repl (fn get-line [buf p] (repl (fn get-line [buf p]