Skip to content

Commit 12f99f6

Browse files
committed
Add alert developer if setup is out of date
A yellow warning is generated when the value in the setup_version.txt file and the version of that file that was written into the ~/.sjsu-dev2.mk location file differ from each other. Also updates the root for cpplint Resolves #625
1 parent caf10cd commit 12f99f6

5 files changed

Lines changed: 24 additions & 8 deletions

File tree

CPPLINT.cfg

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
set noparent
22
filter=-whitespace/braces,-legal/copyright,+readability/check,-readability/nolint,-whitespace/newline,+build/include_what_you_use,-readability/braces,-runtime/references
33
linelength=80
4-
root=firmware
5-
4+
root=library

library/etl_profile.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
1-
// Using traditional include guard to follow etl standards
2-
#ifndef LIBRARY_ETL_PROFILE_H_
3-
#define LIBRARY_ETL_PROFILE_H_
1+
#pragma once
42

53
#define ETL_CHECK_PUSH_POP
64
#define ETL_LOG_ERRORS
75
#define ETL_VERBOSE_ERRORS
86

97
#include "third_party/etl/profiles/cpp17.h"
10-
#endif // LIBRARY_ETL_PROFILE_H_

makefile

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ RED=$(shell echo "\x1B[31;1m")
99
MAGENTA=$(shell echo "\x1B[35;1m")
1010
RESET=$(shell echo "\x1B[0m")
1111
GREEN=$(shell echo "\x1B[32;1m")
12+
CURRENT_SETUP_VERSION=$(shell cat $(SJSU_DEV2_BASE)/setup_version.txt)
1213
# ============================
1314
# Modifying make Flags
1415
# ============================
@@ -25,6 +26,21 @@ endif
2526
NPROCS := 1
2627
OS := $(shell uname -s)
2728

29+
ifneq ($(PREVIOUS_SETUP_VERSION), $(CURRENT_SETUP_VERSION))
30+
$(info $(shell printf '$(YELLOW)'))
31+
$(info +---------------- Project Setup Not Up to Date -----------------+)
32+
$(info | The setup file version in the location file and this project |)
33+
$(info | are not equal. |)
34+
$(info | |)
35+
$(info \ PREVIOUS_SETUP_VERSION = $(PREVIOUS_SETUP_VERSION) )
36+
$(info \ CURRENT_SETUP_VERSION = $(CURRENT_SETUP_VERSION) )
37+
$(info | |)
38+
$(info | Please run ./setup again |)
39+
$(info +---------------------------------------------------------------+)
40+
$(info $(shell printf '$(RESET)'))
41+
$(warning )
42+
endif
43+
2844
ifeq ($(OS), Linux)
2945
NPROCS := $(shell grep -c ^processor /proc/cpuinfo)
3046
endif
@@ -152,9 +168,10 @@ endif
152168
BUILD_DIRECTORY_NAME = build
153169
# "make application"'s build directory becomes "build/application"
154170
# "make test"'s build directory becomes "build/test"
155-
ifeq ($(MAKECMDGOALS), $(filter $(MAKECMDGOALS), flash jtag-flash \
171+
ifeq ($(MAKECMDGOALS), $(filter $(MAKECMDGOALS), application flash jtag-flash \
156172
platform-flash platform-jtag-flash \
157173
stacktrace-application multi-debug debug))
174+
$(info $(shell printf '$(MAGENTA)Building application firmware...$(RESET)\n'))
158175
BUILD_SUBDIRECTORY_NAME = application
159176
else ifeq ($(MAKECMDGOALS), $(filter $(MAKECMDGOALS), run-test))
160177
BUILD_SUBDIRECTORY_NAME = test

setup

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,9 +186,11 @@ function generate_location_file()
186186
echo " ───────────────────────────────────────────────────┐"
187187
echo " Generating SJSU-Dev2 Location File "
188188
echo "└─────────────────────────────────────────────────── "
189+
local SETUP_VERSION=$(cat $BASE/setup_version.txt)
189190
cat >~/.sjsu_dev2.mk <<EOL
190191
# Location of SJSU-Dev2 folder
191-
SJSU_DEV2_BASE = $BASE
192+
SJSU_DEV2_BASE = $BASE
193+
PREVIOUS_SETUP_VERSION = $SETUP_VERSION
192194
193195
ifeq (,\$(wildcard \$(SJSU_DEV2_BASE)))
194196
\$(info +-------------- SJSU-Dev2 Folder Not Found Error ---------------+)

setup_version.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1

0 commit comments

Comments
 (0)