yavsc/scripts/build/make/dnx.mk

76 lines
1.7 KiB
Makefile
Raw Normal View History

2018-05-04 10:45:45 +02:00
# Common defs
#
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
2019-11-14 14:03:35 +00:00
dnx=ndnx
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
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
2019-05-10 09:58:09 +01:00
MONO_OPTIONS=--debug MONO_MANAGED_WATCHER=enabled 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
2019-01-05 16:57:11 +00:00
rm project.lock.json
2018-05-04 10:45:45 +02:00
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
2019-09-27 07:06:19 +01:00
echo $(version) > bin/output/wwwroot/version
# @git log -1 --pretty=format:%h > bin/output/wwwroot/version
2018-05-04 10:45:45 +02:00
2018-07-26 17:10:57 +02:00
pack: $(NUGETSOURCE)/$(PKGFILENAME)
2020-06-07 17:46:08 +01:00
$(NUGETSOURCE)/$(PKGFILENAME): $(BINTARGETPATH) ../../version.txt
2018-05-07 10:08:56 +02:00
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)