yavsc/dnx.mk

81 lines
1.8 KiB
Makefile
Raw Normal View History

2018-05-04 10:45:45 +02:00
# Common defs
# assumes SOLUTIONDIR already defined
#
2018-05-03 15:40:58 +02:00
2018-05-07 10:08:56 +02:00
ifndef PRJNAME
2018-05-04 10:45:45 +02:00
PRJNAME := $(shell basename `pwd -P`)
2018-05-07 10:08:56 +02:00
endif
2018-05-04 10:45:45 +02:00
FRAMEWORK=dnx451
ASPNET_ENV=Development
ASPNET_LOG_LEVEL=Debug
HOSTING=localhost
HOSTADMIN=root
FRAMEWORKALIAS=dnx451
2018-05-04 17:56:35 +02:00
# nuget package destination, at generation time
2018-05-04 10:45:45 +02:00
BINTARGET=$(PRJNAME).dll
BINTARGETPATH=bin/$(CONFIGURATION)/$(FRAMEWORKALIAS)/$(BINTARGET)
2018-05-07 10:08:56 +02:00
PKGFILENAME=$(PRJNAME).$(VERSION).nupkg
2018-07-22 22:12:41 +02:00
dnu=dnu
dnx=dnx
2018-05-03 15:40:58 +02:00
2018-05-04 10:45:45 +02:00
# OBS SUBDIRS=Yavsc.Server Yavsc.Abstract Yavsc cli
#
# Git commit hash, in order to not publish some uncrontrolled code in production environment
#
git_status := $(shell git status -s --porcelain |wc -l)
2018-12-14 16:42:11 +00:00
all: $(BINTARGETPATH)
2018-05-04 10:45:45 +02:00
rc-num.txt-check:
ifndef rc_num
@echo no rc num ... please, could you try and run 'make rc-num.txt' ?.
else
@echo 'Got rc num : $(rc_num)'
endif
restore:
touch project.json
2018-07-22 22:12:41 +02:00
$(dnu) restore
2018-05-04 10:45:45 +02:00
project.lock.json: project.json
2018-07-22 22:12:41 +02:00
$(dnu) restore
2018-05-04 10:45:45 +02:00
watch: project.lock.json
2018-12-23 01:57:58 +00:00
MONO_OPTIONS=--debug ASPNET_ENV=$(ASPNET_ENV) ASPNET_LOG_LEVEL=$(ASPNET_LOG_LEVEL) dnx-watch web --configuration=$(CONFIGURATION)
2018-05-04 10:45:45 +02:00
clean:
rm -rf bin obj
cleanoutput:
rm -rf bin/$(CONFIGURATION)
rm -rf bin/output
$(BINTARGETPATH): project.lock.json rc-num.txt-check
2018-07-22 22:12:41 +02:00
$(dnu) build --configuration=$(CONFIGURATION)
2018-05-04 10:45:45 +02:00
# Default target, from one level sub dirs
bin/output:
2018-07-22 22:12:41 +02:00
@$(dnu) publish
2018-05-04 10:45:45 +02:00
bin/output/wwwroot/version: bin/output
@git log -1 --pretty=format:%h > bin/output/wwwroot/version
2018-07-26 17:10:57 +02:00
pack: $(NUGETSOURCE)/$(PKGFILENAME)
2018-05-07 10:08:56 +02:00
$(NUGETSOURCE)/$(PKGFILENAME): $(BINTARGETPATH) $(SOLUTIONDIR)/rc-num.txt
ifeq ($(git_status),0)
2018-07-26 17:10:57 +02:00
nuget pack $(PRJNAME).nuspec -Version $(VERSION) -Properties config=$(CONFIGURATION) -OutputDirectory bin
2018-05-07 10:08:56 +02:00
else
$(error Please, commit your changes before publishing your NuGet packages)
endif
2018-05-04 10:45:45 +02:00
2018-07-26 17:10:57 +02:00
deploy-pkg: pack
@mv bin/$(PKGFILENAME) $(NUGETSOURCE)
2018-05-04 10:45:45 +02:00
2018-12-14 11:48:26 +00:00
.PHONY: rc-num.txt-check
2018-05-03 15:40:58 +02:00
2018-12-14 16:42:11 +00:00
# .DEFAULT_GOAL := $(BINTARGETPATH)