Commit 3b834cd6 authored by Florian Lugou's avatar Florian Lugou

fixed bug with gradle version in Makefile with printf this time

parent 330b042e
...@@ -7,14 +7,14 @@ TAR = tar ...@@ -7,14 +7,14 @@ TAR = tar
GZIP = gzip GZIP = gzip
GRADLE = $(shell which gradle) GRADLE = $(shell which gradle)
GRADLE_VERSION_NEEDED = 3.3 GRADLE_VERSION_NEEDED = 3.3
ERROR_MSG = echo -e "$(COLOR)\nBuild with gradle failed. Falling back to regular javac command...\n$(RESET)" ERROR_MSG = printf "$(COLOR)\nBuild with gradle failed. Falling back to regular javac command...\n$(RESET)"
ifeq "$(GRADLE)" "" ifeq "$(GRADLE)" ""
ERROR_MSG = echo "Gradle was not found. Falling back to regular javac command...\n" ERROR_MSG = echo "Gradle was not found. Falling back to regular javac command...\n"
GRADLE = false && echo >/dev/null GRADLE = false && echo >/dev/null
else else
GRADLE_VERSION := $(shell $(GRADLE) --version | grep "^Gradle" | awk '{print $$2}') GRADLE_VERSION := $(shell $(GRADLE) --version | grep "^Gradle" | awk '{print $$2}')
GRADLE_VERSION_MIN := $(shell echo -e "$(GRADLE_VERSION_NEEDED)\n$(GRADLE_VERSION)" | sort -V 2>/dev/null | head -n1) GRADLE_VERSION_MIN := $(shell printf "%s\n%s\n" "$(GRADLE_VERSION_NEEDED)" "$(GRADLE_VERSION)" | sort -V 2>/dev/null | head -n1)
ifneq "$(GRADLE_VERSION_NEEDED)" "$(GRADLE_VERSION_MIN)" ifneq "$(GRADLE_VERSION_NEEDED)" "$(GRADLE_VERSION_MIN)"
ERROR_MSG = echo "$(COLOR)Gradle $(GRADLE_VERSION) is too old. Needs at least $(GRADLE_VERSION_NEEDED). Falling back to regular javac command...\n$(RESET)" ERROR_MSG = echo "$(COLOR)Gradle $(GRADLE_VERSION) is too old. Needs at least $(GRADLE_VERSION_NEEDED). Falling back to regular javac command...\n$(RESET)"
GRADLE = false && echo >/dev/null GRADLE = false && echo >/dev/null
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment