Skip to content

Commit

Permalink
Merge pull request #18 from MasterLaplace/17-implement-a-version-mana…
Browse files Browse the repository at this point in the history
…gement

17 Implement a Version Management
  • Loading branch information
MasterLaplace authored Oct 18, 2023
2 parents 174a8f9 + a4b6c45 commit 936571d
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 4 deletions.
5 changes: 3 additions & 2 deletions Launcher/src/SceneManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,13 +166,14 @@ def ShowRunProject(self):
self.run_button.setEnabled(False)
self.stacked_widget.setCurrentIndex(0)

info_pattern = r'<Info\s+name="([^"]+)"\s+graphycal="([^"]+)"'
info_pattern = r'<Info\s+name="([^"]+)"\s+graphycal="([^"]+)"\s+version="([^"]+)"/>'
match = re.search(info_pattern, self.xml_content)

if match:
name = match.group(1)
graphycal = match.group(2)
os.system(f'make run {name} {graphycal} -s')
version = match.group(3)
os.system(f'make run {name} {graphycal} {version} -s')

def ShowFileDialog(self):
options = QFileDialog.Options()
Expand Down
23 changes: 21 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ export

PROJECT_NAME := $(word 2, $(MAKECMDGOALS))
GRAPHICAL_LIB := $(word 3, $(MAKECMDGOALS))
VERSION_ENGINE := $(word 4, $(MAKECMDGOALS))

VERSION_MAJOR := $(word 1, $(subst ., ,$(VERSION_ENGINE)))
VERSION_MINOR := $(word 2, $(subst ., ,$(VERSION_ENGINE)))
VERSION_PATCH := $(word 3, $(subst ., ,$(VERSION_ENGINE)))

DEFAULT_GRAPHICAL_LIB := csfml

Expand Down Expand Up @@ -70,7 +75,18 @@ else
GRAPHICAL_LIB := $(DEFAULT_GRAPHICAL_LIB)
endif

CFLAGS = $(FLAGS) $(LDFLAGS) $(OPTI) $(IGNORE)
## VERSION

ifeq ($(VERSION_ENGINE),)
D_FLAGS := -D GRAPHICS_LIBRARY=$(GRAPHICAL_LIB)
else
D_FLAGS := -D GRAPHICS_LIBRARY=$(GRAPHICAL_LIB) \
-D FLAG_VERSION_MAJOR=$(VERSION_MAJOR) \
-D FLAG_VERSION_MINOR=$(VERSION_MINOR) \
-D FLAG_VERSION_PATCH=$(VERSION_PATCH)
endif

CFLAGS = $(FLAGS) $(LDFLAGS) $(OPTI) $(IGNORE) $(D_FLAGS)

ifeq ($(OS), linux)
CC := gcc
Expand Down Expand Up @@ -106,13 +122,16 @@ $(PROJECT_NAME):
$(GRAPHICAL_LIB):
@$(ECHO) $(BOLD) $(LIGHT_BLUE) "Selected graphical library: $(GRAPHICAL_LIB) 🎮 !" $(DEFAULT)

$(VERSION_ENGINE):
@$(ECHO) $(BOLD) $(LIGHT_BLUE) "Selected version: $(VERSION_ENGINE) 🎮 !" $(DEFAULT)

$(NAME): $(OBJ)
@$(CC) -o $(NAME) $(OBJ) $(CFLAGS) \
&& $(ECHO) $(BOLD) $(GREEN)"\n► BUILD SUCCESS ⛽ !"$(DEFAULT) \
|| ($(ECHO) $(BOLD) $(RED)"\n► BUILD FAILED ⛽"$(DEFAULT) && exit 1)


all: print lib $(NAME) $(PROJECT_NAME) $(GRAPHICAL_LIB)
all: clean print lib $(NAME) $(PROJECT_NAME) $(GRAPHICAL_LIB) $(VERSION_ENGINE)

print:
@$(ECHO) $(BOLD)$(GREEN)"🚀 Engine-3D 🚀"$(DEFAULT)
Expand Down

0 comments on commit 936571d

Please sign in to comment.