From 6f7763d42410590311be3dee32695779c1f05d95 Mon Sep 17 00:00:00 2001 From: Paul Schneider Date: Thu, 3 May 2018 09:43:37 +0200 Subject: [PATCH] a generic Makefile target to deploy nuget packages --- Makefile | 26 +++++++++++++------------- Yavsc.Server/Makefile | 14 ++++++-------- Yavsc.Server/Yavsc.Server.nuspec | 4 ++-- cli/Makefile | 12 ++++++------ 4 files changed, 27 insertions(+), 29 deletions(-) diff --git a/Makefile b/Makefile index d7fcd675..3d74cf4e 100644 --- a/Makefile +++ b/Makefile @@ -1,12 +1,7 @@ +include common.mk -MAKE=make -SUBDIRS=Yavsc.Abstract Yavsc cli -git_status := $(shell git status -s --porcelain |wc -l) -rc_num := $(shell cat rc-num.txt) -VERSION=1.0.5-rc$(rc_num) - -all: $(SUBDIRS) +all: Yavsc $(SUBDIRS): $(MAKE) -C $@ VERSION=$(VERSION) @@ -14,20 +9,25 @@ $(SUBDIRS): Yavsc.Abstract: $(MAKE) -C Yavsc.Abstract VERSION=$(VERSION) -Yavsc.Abstract-deploy: - $(MAKE) -C Yavsc.Abstract deploy-pkg VERSION=$(VERSION) +%-deploy-pkg: + $(MAKE) -C $(basename $@ -deploy-pkg) deploy-pkg VERSION=$(VERSION) -Yavsc-deploy: Yavsc - $(MAKE) -C Yavsc deploy-pkg VERSION=$(VERSION) +Yavsc.Server: Yavsc.Abstract -Yavsc: Yavsc.Abstract Yavsc.Abstract-deploy +Yavsc: Yavsc.Server Yavsc.Server-deploy-pkg make -C Yavsc restore make -C Yavsc VERSION=$(VERSION) -cli-: +cli-deploy-pkg: make -C cli deploy-pkg VERSION=$(VERSION) cli: Yavsc +%: + make -C $@ + +memo: + vim ~/TODO.md + .PHONY: all $(SUBDIRS) diff --git a/Yavsc.Server/Makefile b/Yavsc.Server/Makefile index c6e07bf4..d156a636 100644 --- a/Yavsc.Server/Makefile +++ b/Yavsc.Server/Makefile @@ -1,11 +1,9 @@ -CONFIG=Release -PRJNAME=Yavsc.Server +include ../common.mk + -PKGFILENAME=$(PRJNAME).$(VERSION).nupkg -DESTPATH=. -PACKAGE=$(DESTPATH)/$(PKGFILENAME) -BINARY=bin/$(CONFIG)/net451/$(PRJNAME).dll -NUGETSOURCE=$(HOME)/Nupkgs/ +# Useless, defaults to the directory name. +# +PRJNAME=Yavsc.Server $(PACKAGE): $(BINARY) nuget pack $(PRJNAME).nuspec -Version $(VERSION) -Properties config=$(CONFIG) @@ -19,7 +17,7 @@ $(BINARY): project.lock.json project.lock.json: project.json dnu restore -deploy: $(PACKAGE) +deploy-pkg: $(PACKAGE) cp $(PACKAGE) $(NUGETSOURCE) .PHONY: $(BINARY) diff --git a/Yavsc.Server/Yavsc.Server.nuspec b/Yavsc.Server/Yavsc.Server.nuspec index 57b2682b..dc4a700b 100644 --- a/Yavsc.Server/Yavsc.Server.nuspec +++ b/Yavsc.Server/Yavsc.Server.nuspec @@ -13,7 +13,7 @@ https://github.com/pazof/yavsc/README.md https://github.com/pazof/yavsc/blob/vnext/Yavsc/wwwroot/images/yavsc.png true - Some common server side bytes + Some common server side code yavsc @@ -27,4 +27,4 @@ - \ No newline at end of file + diff --git a/cli/Makefile b/cli/Makefile index 10c3ddf7..dc944be2 100644 --- a/cli/Makefile +++ b/cli/Makefile @@ -1,12 +1,9 @@ - +include ../common.mk all: build build: project.lock.json - dnu build - -deploy-pkg: - + ASPNET_ENV=$(ASPNET_ENV) ASPNET_LOG_LEVEL=$(ASPNET_LOG_LEVEL) dnu build --configuration=$(CONFIGURATION) restore: touch project.json @@ -16,7 +13,10 @@ project.lock.json: project.json dnu restore run: project.lock.json - ASPNET_ENV=Development ASPNET_LOG_LEVEL=Debug dnx run + ASPNET_ENV=Development ASPNET_LOG_LEVEL=$(ASPNET_LOG_LEVEL) dnx run --configuration=$(CONFIGURATION) +deploy-pkg: $(PACKAGE) + cp $(PACKAGE) $(NUGETSOURCE) +.PHONY: $(BINARY)