1
0
mirror of https://github.com/janet-lang/janet synced 2025-02-17 17:20:01 +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

@ -1,15 +1,15 @@
# Copyright (c) 2018 Calvin Rose # Copyright (c) 2018 Calvin Rose
# #
# Permission is hereby granted, free of charge, to any person obtaining a copy # Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to # of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the # deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is # sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions: # furnished to do so, subject to the following conditions:
# #
# The above copyright notice and this permission notice shall be included in # The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software. # all copies or substantial portions of the Software.
# #
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@ -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
@ -40,7 +39,7 @@ DEBUGGER=gdb
UNAME:=$(shell uname -s) UNAME:=$(shell uname -s)
LDCONFIG:=ldconfig LDCONFIG:=ldconfig
ifeq ($(UNAME), Darwin) ifeq ($(UNAME), Darwin)
# Add other macos/clang flags # Add other macos/clang flags
LDCONFIG:= LDCONFIG:=
else else
@ -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))
@ -136,7 +135,7 @@ test: $(JANET_TARGET) $(TEST_PROGRAMS)
for f in ctest/*.out; do "$$f" || exit; done for f in ctest/*.out; do "$$f" || exit; done
for f in test/*.janet; do ./$(JANET_TARGET) "$$f" || exit; done for f in test/*.janet; do ./$(JANET_TARGET) "$$f" || exit; done
VALGRIND_COMMAND=valgrind --leak-check=full -v VALGRIND_COMMAND=valgrind --leak-check=full -v
valtest: $(JANET_TARGET) $(TEST_PROGRAMS) valtest: $(JANET_TARGET) $(TEST_PROGRAMS)
for f in ctest/*.out; do $(VALGRIND_COMMAND) "$$f" || exit; done for f in ctest/*.out; do $(VALGRIND_COMMAND) "$$f" || exit; done

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]