Skip to content

Commit

Permalink
fix: Add version.tag to release archives
Browse files Browse the repository at this point in the history
The CMake scripts depend on the version.tag file in the project root to
determine the library version. However, current release archives do not
have this file.

Add version.tag to release archives, so developers and vcpkg can use the
file to generate correct Argtable3ConfigVersion.cmake and DLL version
resource.
  • Loading branch information
tomghuang committed Jun 7, 2021
1 parent aaa5f19 commit c295740
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ MV = mv
CP = cp
CD = cd
ZIP = zip
TAR = tar
PUSHD = pushd
POPD = popd
MKINDEX = makeindex
Expand Down Expand Up @@ -72,17 +73,28 @@ co:
@$(MKDIR) $(ARCHIVE_DIR)
@$(MKDIR) $(ARCHIVE_DIR)/$(TAG)
@$(PRINTF) "Export tag %s...\n" $(TAG)
@$(GIT) archive $(TAG) | tar -x -C $(ARCHIVE_DIR)/$(TAG)
@$(GIT) -c core.autocrlf=true archive $(TAG) | $(TAR) -x -C $(ARCHIVE_DIR)/$(TAG)
@$(MKDIR) $(TAGS_DIR)
@$(MV) $(ARCHIVE_DIR)/$(TAG) $(TAGS_DIR)/$(TAG)
@$(RM) $(ARCHIVE_DIR)
@$(PRINTF) $(TAG) > $(TAGS_DIR)/$(TAG)/version.tag


.PHONY: archive
archive:
@$(MKDIR) $(ARCHIVE_DIR)
@$(GIT) archive -o $(ARCHIVE_DIR)/argtable_$(TAG).zip $(TAG)
@$(MKDIR) $(ARCHIVE_DIR)/argtable-$(TAG)
@$(PRINTF) "Archive tag %s in %s...\n" $(TAG) $(ARCHIVE_DIR)/argtable-$(TAG).zip
@$(GIT) -c core.autocrlf=true archive $(TAG) | $(TAR) -x -C $(ARCHIVE_DIR)/argtable-$(TAG)
@$(PRINTF) $(TAG) > $(ARCHIVE_DIR)/argtable-$(TAG)/version.tag
@$(CD) $(ARCHIVE_DIR); $(ZIP) -rq argtable-$(TAG).zip argtable-$(TAG)
@$(RM) $(ARCHIVE_DIR)/argtable-$(TAG)

@$(MKDIR) $(ARCHIVE_DIR)/argtable-$(TAG)
@$(PRINTF) "Archive tag %s in %s...\n" $(TAG) $(ARCHIVE_DIR)/argtable-$(TAG).tar.gz
@$(GIT) archive $(TAG) | $(TAR) -x -C $(ARCHIVE_DIR)/argtable-$(TAG)
@$(PRINTF) $(TAG) > $(ARCHIVE_DIR)/argtable-$(TAG)/version.tag
@$(CD) $(ARCHIVE_DIR); $(TAR) -zcf argtable-$(TAG).tar.gz argtable-$(TAG)
@$(RM) $(ARCHIVE_DIR)/argtable-$(TAG)


.PHONY: tag
Expand All @@ -105,4 +117,3 @@ cleanall:
.PHONY: githead
githead:
@$(GIT) rev-parse --short=7 HEAD

0 comments on commit c295740

Please sign in to comment.