diff --git a/.commit-template b/.commit-template new file mode 100644 index 000000000..2c8b5cf89 --- /dev/null +++ b/.commit-template @@ -0,0 +1,23 @@ + + +# *************** OpenPilot commits guidelines *************** +# Each commit needs to have a message like the following sample: +# OP-1150 UI for thermal calibration: Connect State machine to UI +# +# It needs to begin with a reference to one or more Jira tickets followed by a short description. +# If needed add a longer description in the following lines, after an empty line. +# +# Before committing, ensure your code is properly formatted using: +# make uncrustify_all +# You can format flight or ground code only using respectively +# uncrustify_flight or uncrustify_ground +# +# To automatically create a review, append the following smart commit messages: +# +review OPReview +# +# To append the commit to an existing review, use the following smart commit message: +# +review OPReview-NNN +# For example "+review OPReview-609" +# +# *NOTE* leave an empty line between the commit message and "smart commit command" +# Smart commits commands need to starts immediately at first column diff --git a/Makefile b/Makefile index 667aeb622..35cfb8436 100644 --- a/Makefile +++ b/Makefile @@ -859,6 +859,8 @@ help: @$(ECHO) @$(ECHO) " Here is a summary of the available targets:" @$(ECHO) + @$(ECHO) " [Source tree preparation]" + @$(ECHO) " prepare - Install GIT commit message template" @$(ECHO) " [Tool Installers]" @$(ECHO) " arm_sdk_install - Install the GNU ARM gcc toolchain" @$(ECHO) " qt_sdk_install - Install the QT development tools" diff --git a/ground/openpilotgcs/copydata.pro b/ground/openpilotgcs/copydata.pro index a7e086f7d..e922acf2e 100644 --- a/ground/openpilotgcs/copydata.pro +++ b/ground/openpilotgcs/copydata.pro @@ -264,7 +264,7 @@ GCS_LIBRARY_PATH ssleay32.dll \ libeay32.dll for(dll, OPENSSL_DLLS) { - data_copy.commands += $(COPY_FILE) $$targetPath(\"$$(OPENSSL)/$$dll\") $$targetPath(\"$$GCS_APP_PATH/$$dll\") $$addNewline() + data_copy.commands += $(COPY_FILE) $$targetPath(\"$$(OPENSSL_DIR)/$$dll\") $$targetPath(\"$$GCS_APP_PATH/$$dll\") $$addNewline() } data_copy.target = FORCE diff --git a/make/scripts/uncrustify.sh b/make/scripts/uncrustify.sh index aee251933..fb76263e6 100644 --- a/make/scripts/uncrustify.sh +++ b/make/scripts/uncrustify.sh @@ -45,6 +45,7 @@ recursive() case "$1" in *.c|*.h|*.cc|*.cpp|*.hpp) ${UNCRUSTIFY} -c "${UNCRUSTIFY_CONFIG}" --no-backup "$1" + ${UNCRUSTIFY} -c "${UNCRUSTIFY_CONFIG}" --no-backup "$1" -q ;; esac fi diff --git a/make/tools.mk b/make/tools.mk index addc6ef61..dc22f195f 100644 --- a/make/tools.mk +++ b/make/tools.mk @@ -564,12 +564,16 @@ ifeq ($(UNAME), Windows) $(eval $(call TOOL_INSTALL_TEMPLATE,openssl,$(OPENSSL_DIR),$(OPENSSL_URL),$(notdir $(OPENSSL_URL)))) ifeq ($(shell [ -d "$(OPENSSL_DIR)" ] && $(ECHO) "exists"), exists) - export OPENSSL := $(OPENSSL_DIR) + export OPENSSL := "$(OPENSSL_DIR)/bin/openssl" + export OPENSSL_DIR := "$(OPENSSL_DIR)" else # not installed, hope it's in the path... # $(info $(EMPTY) WARNING $(call toprel, $(OPENSSL_DIR)) not found (make openssl_install), using system PATH) endif +.PHONY: openssl_version +openssl_version: + -$(V1) $(ECHO) "OpenSSL `$(OPENSSL) version`" endif ############################## @@ -947,6 +951,19 @@ android_sdk_update: $(V0) @echo " UPDATE $(ANDROID_SDK_DIR)" $(ANDROID_SDK_DIR)/tools/android update sdk --no-ui -t platform-tools,android-16,addon-google_apis-google-16 + #Install git hooks under the right folder + +.PHONY: prepare +prepare: + $(V0) @echo " Configuring GIT commit template" + $(V1) $(CD) "$(ROOT_DIR)" + $(V1) $(GIT) config commit.template .commit-template + +.PHONY: prepare_clean +prepare_clean: + $(V0) @echo " Cleanup GIT commit template configuration" + $(V1) $(CD) "$(ROOT_DIR)" + $(V1) $(GIT) config --unset commit.template ############################## #