82 lines
1.8 KiB
Makefile
82 lines
1.8 KiB
Makefile
6 years ago
|
# Common defs
|
||
|
# assumes SOLUTIONDIR already defined
|
||
|
#
|
||
6 years ago
|
|
||
6 years ago
|
ifndef PRJNAME
|
||
6 years ago
|
PRJNAME := $(shell basename `pwd -P`)
|
||
6 years ago
|
endif
|
||
6 years ago
|
FRAMEWORK=dnx451
|
||
|
ASPNET_ENV=Development
|
||
|
ASPNET_LOG_LEVEL=Debug
|
||
|
HOSTING=localhost
|
||
|
HOSTADMIN=root
|
||
|
FRAMEWORKALIAS=dnx451
|
||
6 years ago
|
# nuget package destination, at generation time
|
||
6 years ago
|
BINTARGET=$(PRJNAME).dll
|
||
|
BINTARGETPATH=bin/$(CONFIGURATION)/$(FRAMEWORKALIAS)/$(BINTARGET)
|
||
6 years ago
|
PKGFILENAME=$(PRJNAME).$(VERSION).nupkg
|
||
6 years ago
|
dnu=dnu
|
||
|
dnx=dnx
|
||
6 years ago
|
|
||
6 years ago
|
# 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)
|
||
|
|
||
6 years ago
|
all: $(BINTARGETPATH)
|
||
|
|
||
6 years ago
|
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
|
||
6 years ago
|
$(dnu) restore
|
||
6 years ago
|
|
||
|
project.lock.json: project.json
|
||
6 years ago
|
$(dnu) restore
|
||
6 years ago
|
|
||
|
watch: project.lock.json
|
||
6 years ago
|
MONO_OPTIONS=--debug ASPNET_ENV=$(ASPNET_ENV) ASPNET_LOG_LEVEL=$(ASPNET_LOG_LEVEL) dnx-watch web --configuration=$(CONFIGURATION)
|
||
6 years ago
|
|
||
|
clean:
|
||
|
rm -rf bin obj
|
||
|
|
||
|
cleanoutput:
|
||
|
rm -rf bin/$(CONFIGURATION)
|
||
|
rm -rf bin/output
|
||
|
|
||
6 years ago
|
$(BINTARGETPATH): project.lock.json rc-num.txt-check
|
||
6 years ago
|
$(dnu) build --configuration=$(CONFIGURATION)
|
||
6 years ago
|
|
||
|
# Default target, from one level sub dirs
|
||
|
|
||
|
bin/output:
|
||
6 years ago
|
@$(dnu) publish
|
||
6 years ago
|
|
||
|
bin/output/wwwroot/version: bin/output
|
||
|
@git log -1 --pretty=format:%h > bin/output/wwwroot/version
|
||
|
|
||
6 years ago
|
pack: $(NUGETSOURCE)/$(PKGFILENAME)
|
||
|
|
||
6 years ago
|
$(NUGETSOURCE)/$(PKGFILENAME): $(BINTARGETPATH) $(SOLUTIONDIR)/rc-num.txt
|
||
|
ifeq ($(git_status),0)
|
||
6 years ago
|
nuget pack $(PRJNAME).nuspec -Version $(VERSION) -Properties config=$(CONFIGURATION) -OutputDirectory bin
|
||
6 years ago
|
else
|
||
|
$(error Please, commit your changes before publishing your NuGet packages)
|
||
|
endif
|
||
6 years ago
|
|
||
6 years ago
|
deploy-pkg: pack
|
||
|
@mv bin/$(PKGFILENAME) $(NUGETSOURCE)
|
||
6 years ago
|
|
||
6 years ago
|
.PHONY: rc-num.txt-check
|
||
6 years ago
|
|
||
6 years ago
|
# .DEFAULT_GOAL := $(BINTARGETPATH)
|