Makefile 1.74 KB
Newer Older
1 2 3
BASE=ordernumbers
PLATTFORM=woocommerce
VENDOR=opentools
4
VERSION=1.3.6
5
DIR = $(shell pwd)
6
SVNDIR=wordpress-plugin-svn
7 8

BUILDDIR=.build/
9 10
BASICBUILDDIR=$(PLATTFORM)-basic-$(BASE)
ADVBUILDDIR=$(PLATTFORM)-advanced-$(BASE)
11

12
PLUGINFILES=library assets ordernumber_helper_woocommerce.php ordernumbers_woocommerce_basic.php readme.txt LICENSE.txt
13
BASICPLUGINFILES=woocommerce-basic-ordernumbers.php
14
ADVPLUGINFILES=woocommerce-advanced-ordernumbers.php ordernumbers_woocommerce.php opentools-update-checker.php plugin-update-checker/
15 16 17 18 19 20 21 22 23 24 25

TRANSLATIONS=

ZIPFILE=$(VENDOR)-$(PLATTFORM)-$(BASE)-basic_v$(VERSION).zip
ADVZIPFILE=$(VENDOR)-$(PLATTFORM)-$(BASE)-advanced_v$(VERSION).zip

all: zip

zip: $(PLUGINFILES) $(ADVPLUGINFILES) $(BASICPLUGINFILES) $(TRANSLATIONS)
	echo $(DIR)
	@echo "Packing basic plugin version into distribution file $(ZIPFILE):"
26 27
	@mkdir -p $(BUILDDIR)/$(BASICBUILDDIR)
	@cp --parents -r $(PLUGINFILES) $(BASICPLUGINFILES) $(TRANSLATIONS) $(BUILDDIR)/$(BASICBUILDDIR)
28 29
	cd $(BUILDDIR) && zip -r $(DIR)/$(ZIPFILE) $(BASICBUILDDIR)
# 	@zip -r 
30 31 32 33 34 35
	@echo "Packing advanced plugin version into distribution file $(ADVZIPFILE):"
	@mkdir -p $(BUILDDIR)/$(ADVBUILDDIR)
	echo `pwd`
	@cp --parents -r $(PLUGINFILES) $(ADVPLUGINFILES) $(TRANSLATIONS) $(BUILDDIR)/$(ADVBUILDDIR)
	@cp readme-adv.txt $(BUILDDIR)/$(ADVBUILDDIR)/readme.txt
	@cd $(BUILDDIR) && zip -r $(DIR)/$(ADVZIPFILE) $(ADVBUILDDIR)
36 37 38
	cd $(DIR)

clean:
39
	rm -rf $(ZIPFILE) $(ADVZIPFILE) $(BUILDDIR) $(ADVBUILDDIR)
40 41 42 43

$(SVNDIR)/tags/$(VERSION) :
	cd $(SVNDIR) && svn cp trunk tags/$(VERSION)

44
svn: $(SVNDIR)/trunk
45 46 47 48 49
	rsync -avP $(PLUGINFILES) $(BASICPLUGINFILES) $(TRANSLATIONS) $(SVNDIR)/trunk

svn-release: svn $(SVNDIR)/tags/$(VERSION)
	rsync -avP $(PLUGINFILES) $(BASICPLUGINFILES) $(TRANSLATIONS) $(SVNDIR)/tags/$(VERSION)