2017-06-22 23:57:09 +02:00
|
|
|
SHELL=/bin/bash
|
2017-06-21 23:23:48 +02:00
|
|
|
.SHELLFLAGS=-e
|
|
|
|
|
2017-05-18 20:38:28 +02:00
|
|
|
PROJECT=github.com/pulumi/lumi
|
Makeify more; add a "full build" target (#193)
* Makeify more; add a "full build" target
This change uses make for more of our tree. Namely, the AWS provider
and LumiJS compilers each now use make to build and/or install them.
Not only does this bring about some consistency to how we build and
test things, but also made it easy to add a full build target:
$ make all
This target will build, test, and install the core Go tools, the LumiJS
compiler, and the AWS provider, in that order.
Each can be made in isolation, however, which ensures that the inner
loop for those is fast and so that, when it comes to finishing
pulumi/lumi#147, we can easily split them out and make from the top.
2017-06-02 23:26:34 +02:00
|
|
|
PROJECT_PKGS=$(shell go list ./cmd/... ./pkg/... | grep -v /vendor/)
|
2017-06-16 02:42:53 +02:00
|
|
|
TESTPARALLELISM=10
|
2016-11-15 20:30:34 +01:00
|
|
|
|
2017-06-22 23:57:09 +02:00
|
|
|
ECHO=echo -e
|
2017-06-21 23:46:03 +02:00
|
|
|
GOMETALINTERBIN=gometalinter
|
Tidy up more lint
This change fixes a few things:
* Most importantly, we need to place a leading "." in the paths
to Gometalinter, otherwise some sub-linters just silently skip
the directory altogether. errcheck is one such linter, which
is a very important one!
* Use an explicit Gometalinter.json file to configure the various
settings. This flips on a few additional linters that aren't
on by default (line line length checking). Sadly, a few that
I'd like to enable take waaaay too much time, so in the future
we may consider a nightly job (this includes code similarity,
unused parameters, unused functions, and others that generally
require global analysis).
* Now that we're running more, however, linting takes a while!
The core Lumi project now takes 26 seconds to lint on my laptop.
That's not terrible, but it's long enough that we don't want to
do the silly "run them twice" thing our Makefiles were previously
doing. Instead, we shall deploy some $$($${PIPESTATUS[1]}-1))-fu
to rely on the fact that grep returns 1 on "zero lines".
* Finally, fix the many issues that this turned up.
I think(?) we are done, except, of course, for needing to drive
down some of the cyclomatic complexity issues (which I'm possibly
going to punt on; see pulumi/lumi#259 for more details).
2017-06-22 21:09:46 +02:00
|
|
|
GOMETALINTER=${GOMETALINTERBIN} --config=Gometalinter.json
|
2017-06-21 23:46:03 +02:00
|
|
|
|
Makeify more; add a "full build" target (#193)
* Makeify more; add a "full build" target
This change uses make for more of our tree. Namely, the AWS provider
and LumiJS compilers each now use make to build and/or install them.
Not only does this bring about some consistency to how we build and
test things, but also made it easy to add a full build target:
$ make all
This target will build, test, and install the core Go tools, the LumiJS
compiler, and the AWS provider, in that order.
Each can be made in isolation, however, which ensures that the inner
loop for those is fast and so that, when it comes to finishing
pulumi/lumi#147, we can easily split them out and make from the top.
2017-06-02 23:26:34 +02:00
|
|
|
.PHONY: default
|
2017-06-21 23:38:52 +02:00
|
|
|
default: banner vet test install lint_quiet
|
Makeify more; add a "full build" target (#193)
* Makeify more; add a "full build" target
This change uses make for more of our tree. Namely, the AWS provider
and LumiJS compilers each now use make to build and/or install them.
Not only does this bring about some consistency to how we build and
test things, but also made it easy to add a full build target:
$ make all
This target will build, test, and install the core Go tools, the LumiJS
compiler, and the AWS provider, in that order.
Each can be made in isolation, however, which ensures that the inner
loop for those is fast and so that, when it comes to finishing
pulumi/lumi#147, we can easily split them out and make from the top.
2017-06-02 23:26:34 +02:00
|
|
|
|
|
|
|
.PHONY: all
|
2017-06-21 23:38:52 +02:00
|
|
|
all: banner_all vet test install lint_quiet lumijs lumirtpkg lumijspkg lumipkg awspkg
|
2017-06-16 18:50:56 +02:00
|
|
|
|
|
|
|
.PHONY: nightly
|
2017-06-24 00:11:20 +02:00
|
|
|
nightly: banner_all vet test install lint_quiet lumijs lumirtpkg lumijspkg lumipkg awspkg examples gocover
|
2017-05-24 20:58:58 +02:00
|
|
|
|
Makeify more; add a "full build" target (#193)
* Makeify more; add a "full build" target
This change uses make for more of our tree. Namely, the AWS provider
and LumiJS compilers each now use make to build and/or install them.
Not only does this bring about some consistency to how we build and
test things, but also made it easy to add a full build target:
$ make all
This target will build, test, and install the core Go tools, the LumiJS
compiler, and the AWS provider, in that order.
Each can be made in isolation, however, which ensures that the inner
loop for those is fast and so that, when it comes to finishing
pulumi/lumi#147, we can easily split them out and make from the top.
2017-06-02 23:26:34 +02:00
|
|
|
.PHONY: banner
|
2017-05-24 20:58:58 +02:00
|
|
|
banner:
|
2017-06-22 23:57:09 +02:00
|
|
|
@$(ECHO) "\033[1;37m============\033[0m"
|
|
|
|
@$(ECHO) "\033[1;37mLumi (Quick)\033[0m"
|
|
|
|
@$(ECHO) "\033[1;37m============\033[0m"
|
|
|
|
@$(ECHO) "\033[0;33mRunning quick build; to run full tests, run 'make all'\033[0m"
|
|
|
|
@$(ECHO) "\033[0;33mRemember to do this before checkin, otherwise your CI will fail\033[0m"
|
2017-06-02 19:30:57 +02:00
|
|
|
|
Makeify more; add a "full build" target (#193)
* Makeify more; add a "full build" target
This change uses make for more of our tree. Namely, the AWS provider
and LumiJS compilers each now use make to build and/or install them.
Not only does this bring about some consistency to how we build and
test things, but also made it easy to add a full build target:
$ make all
This target will build, test, and install the core Go tools, the LumiJS
compiler, and the AWS provider, in that order.
Each can be made in isolation, however, which ensures that the inner
loop for those is fast and so that, when it comes to finishing
pulumi/lumi#147, we can easily split them out and make from the top.
2017-06-02 23:26:34 +02:00
|
|
|
.PHONY: banner_all
|
|
|
|
banner_all:
|
2017-06-22 23:57:09 +02:00
|
|
|
@$(ECHO) "\033[1;37m============\033[0m"
|
|
|
|
@$(ECHO) "\033[1;37mLumi (Full)\033[0m"
|
|
|
|
@$(ECHO) "\033[1;37m============\033[0m"
|
2017-01-28 00:42:55 +01:00
|
|
|
|
Makeify more; add a "full build" target (#193)
* Makeify more; add a "full build" target
This change uses make for more of our tree. Namely, the AWS provider
and LumiJS compilers each now use make to build and/or install them.
Not only does this bring about some consistency to how we build and
test things, but also made it easy to add a full build target:
$ make all
This target will build, test, and install the core Go tools, the LumiJS
compiler, and the AWS provider, in that order.
Each can be made in isolation, however, which ensures that the inner
loop for those is fast and so that, when it comes to finishing
pulumi/lumi#147, we can easily split them out and make from the top.
2017-06-02 23:26:34 +02:00
|
|
|
.PHONY: install
|
2017-01-28 00:42:55 +01:00
|
|
|
install:
|
2017-06-22 23:57:09 +02:00
|
|
|
@$(ECHO) "\033[0;32mINSTALL:\033[0m"
|
2017-06-21 22:24:35 +02:00
|
|
|
go install ${PROJECT}/cmd/lumi
|
|
|
|
go install ${PROJECT}/cmd/lumidl
|
2017-01-28 00:42:55 +01:00
|
|
|
|
Makeify more; add a "full build" target (#193)
* Makeify more; add a "full build" target
This change uses make for more of our tree. Namely, the AWS provider
and LumiJS compilers each now use make to build and/or install them.
Not only does this bring about some consistency to how we build and
test things, but also made it easy to add a full build target:
$ make all
This target will build, test, and install the core Go tools, the LumiJS
compiler, and the AWS provider, in that order.
Each can be made in isolation, however, which ensures that the inner
loop for those is fast and so that, when it comes to finishing
pulumi/lumi#147, we can easily split them out and make from the top.
2017-06-02 23:26:34 +02:00
|
|
|
.PHONY: lint
|
2017-01-28 00:42:55 +01:00
|
|
|
lint:
|
2017-06-22 23:57:09 +02:00
|
|
|
@$(ECHO) "\033[0;32mLINT:\033[0m"
|
2017-06-21 23:46:03 +02:00
|
|
|
which ${GOMETALINTERBIN} >/dev/null
|
Tidy up more lint
This change fixes a few things:
* Most importantly, we need to place a leading "." in the paths
to Gometalinter, otherwise some sub-linters just silently skip
the directory altogether. errcheck is one such linter, which
is a very important one!
* Use an explicit Gometalinter.json file to configure the various
settings. This flips on a few additional linters that aren't
on by default (line line length checking). Sadly, a few that
I'd like to enable take waaaay too much time, so in the future
we may consider a nightly job (this includes code similarity,
unused parameters, unused functions, and others that generally
require global analysis).
* Now that we're running more, however, linting takes a while!
The core Lumi project now takes 26 seconds to lint on my laptop.
That's not terrible, but it's long enough that we don't want to
do the silly "run them twice" thing our Makefiles were previously
doing. Instead, we shall deploy some $$($${PIPESTATUS[1]}-1))-fu
to rely on the fact that grep returns 1 on "zero lines".
* Finally, fix the many issues that this turned up.
I think(?) we are done, except, of course, for needing to drive
down some of the cyclomatic complexity issues (which I'm possibly
going to punt on; see pulumi/lumi#259 for more details).
2017-06-22 21:09:46 +02:00
|
|
|
$(GOMETALINTER) ./pkg/... | sort ; exit "$${PIPESTATUS[0]}"
|
|
|
|
$(GOMETALINTER) ./cmd/lumi/... | sort ; exit "$${PIPESTATUS[0]}"
|
|
|
|
$(GOMETALINTER) ./cmd/lumidl/... | sort ; exit "$${PIPESTATUS[0]}"
|
2017-06-21 22:24:35 +02:00
|
|
|
|
|
|
|
# In quiet mode, suppress some messages.
|
|
|
|
# - "or be unexported": TODO[pulumi/lumi#191]: will fix when we write all of our API docs
|
|
|
|
# - "Subprocess launching with variable": we intentionally launch processes dynamically.
|
Tidy up more lint
This change fixes a few things:
* Most importantly, we need to place a leading "." in the paths
to Gometalinter, otherwise some sub-linters just silently skip
the directory altogether. errcheck is one such linter, which
is a very important one!
* Use an explicit Gometalinter.json file to configure the various
settings. This flips on a few additional linters that aren't
on by default (line line length checking). Sadly, a few that
I'd like to enable take waaaay too much time, so in the future
we may consider a nightly job (this includes code similarity,
unused parameters, unused functions, and others that generally
require global analysis).
* Now that we're running more, however, linting takes a while!
The core Lumi project now takes 26 seconds to lint on my laptop.
That's not terrible, but it's long enough that we don't want to
do the silly "run them twice" thing our Makefiles were previously
doing. Instead, we shall deploy some $$($${PIPESTATUS[1]}-1))-fu
to rely on the fact that grep returns 1 on "zero lines".
* Finally, fix the many issues that this turned up.
I think(?) we are done, except, of course, for needing to drive
down some of the cyclomatic complexity issues (which I'm possibly
going to punt on; see pulumi/lumi#259 for more details).
2017-06-22 21:09:46 +02:00
|
|
|
# - "cyclomatic complexity" (disabled in config): TODO[pulumi/lumi#259]: need to fix many of these.
|
|
|
|
LINT_SUPPRESS="or be unexported|Subprocess launching with variable"
|
2017-06-14 01:47:55 +02:00
|
|
|
|
Makeify more; add a "full build" target (#193)
* Makeify more; add a "full build" target
This change uses make for more of our tree. Namely, the AWS provider
and LumiJS compilers each now use make to build and/or install them.
Not only does this bring about some consistency to how we build and
test things, but also made it easy to add a full build target:
$ make all
This target will build, test, and install the core Go tools, the LumiJS
compiler, and the AWS provider, in that order.
Each can be made in isolation, however, which ensures that the inner
loop for those is fast and so that, when it comes to finishing
pulumi/lumi#147, we can easily split them out and make from the top.
2017-06-02 23:26:34 +02:00
|
|
|
.PHONY: lint_quiet
|
2017-04-12 20:01:16 +02:00
|
|
|
lint_quiet:
|
2017-06-22 23:57:09 +02:00
|
|
|
@$(ECHO) "\033[0;32mLINT (quiet):\033[0m"
|
2017-06-21 23:46:03 +02:00
|
|
|
which ${GOMETALINTERBIN} >/dev/null
|
Tidy up more lint
This change fixes a few things:
* Most importantly, we need to place a leading "." in the paths
to Gometalinter, otherwise some sub-linters just silently skip
the directory altogether. errcheck is one such linter, which
is a very important one!
* Use an explicit Gometalinter.json file to configure the various
settings. This flips on a few additional linters that aren't
on by default (line line length checking). Sadly, a few that
I'd like to enable take waaaay too much time, so in the future
we may consider a nightly job (this includes code similarity,
unused parameters, unused functions, and others that generally
require global analysis).
* Now that we're running more, however, linting takes a while!
The core Lumi project now takes 26 seconds to lint on my laptop.
That's not terrible, but it's long enough that we don't want to
do the silly "run them twice" thing our Makefiles were previously
doing. Instead, we shall deploy some $$($${PIPESTATUS[1]}-1))-fu
to rely on the fact that grep returns 1 on "zero lines".
* Finally, fix the many issues that this turned up.
I think(?) we are done, except, of course, for needing to drive
down some of the cyclomatic complexity issues (which I'm possibly
going to punt on; see pulumi/lumi#259 for more details).
2017-06-22 21:09:46 +02:00
|
|
|
$(GOMETALINTER) ./pkg/... | grep -vE ${LINT_SUPPRESS} | sort ; exit $$(($${PIPESTATUS[1]}-1))
|
|
|
|
$(GOMETALINTER) ./cmd/lumi/... | grep -vE ${LINT_SUPPRESS} | sort ; exit $$(($${PIPESTATUS[1]}-1))
|
|
|
|
$(GOMETALINTER) ./cmd/lumidl/... | grep -vE ${LINT_SUPPRESS} | sort ; exit $$(($${PIPESTATUS[1]}-1))
|
2017-06-22 23:57:09 +02:00
|
|
|
@$(ECHO) "\033[0;33mlint was run quietly; to run with noisy errors, run 'make lint'\033[0m"
|
2017-01-28 00:42:55 +01:00
|
|
|
|
Makeify more; add a "full build" target (#193)
* Makeify more; add a "full build" target
This change uses make for more of our tree. Namely, the AWS provider
and LumiJS compilers each now use make to build and/or install them.
Not only does this bring about some consistency to how we build and
test things, but also made it easy to add a full build target:
$ make all
This target will build, test, and install the core Go tools, the LumiJS
compiler, and the AWS provider, in that order.
Each can be made in isolation, however, which ensures that the inner
loop for those is fast and so that, when it comes to finishing
pulumi/lumi#147, we can easily split them out and make from the top.
2017-06-02 23:26:34 +02:00
|
|
|
.PHONY: vet
|
|
|
|
vet:
|
2017-06-22 23:57:09 +02:00
|
|
|
@$(ECHO) "\033[0;32mVET:\033[0m"
|
2017-06-21 22:24:35 +02:00
|
|
|
go tool vet -printf=false cmd/ pkg/
|
Makeify more; add a "full build" target (#193)
* Makeify more; add a "full build" target
This change uses make for more of our tree. Namely, the AWS provider
and LumiJS compilers each now use make to build and/or install them.
Not only does this bring about some consistency to how we build and
test things, but also made it easy to add a full build target:
$ make all
This target will build, test, and install the core Go tools, the LumiJS
compiler, and the AWS provider, in that order.
Each can be made in isolation, however, which ensures that the inner
loop for those is fast and so that, when it comes to finishing
pulumi/lumi#147, we can easily split them out and make from the top.
2017-06-02 23:26:34 +02:00
|
|
|
|
|
|
|
.PHONY: test
|
2017-01-28 00:42:55 +01:00
|
|
|
test:
|
2017-06-22 23:57:09 +02:00
|
|
|
@$(ECHO) "\033[0;32mTEST:\033[0m"
|
2017-06-21 22:24:35 +02:00
|
|
|
go test -cover -parallel ${TESTPARALLELISM} ${PROJECT_PKGS}
|
2017-06-01 23:01:26 +02:00
|
|
|
|
Makeify more; add a "full build" target (#193)
* Makeify more; add a "full build" target
This change uses make for more of our tree. Namely, the AWS provider
and LumiJS compilers each now use make to build and/or install them.
Not only does this bring about some consistency to how we build and
test things, but also made it easy to add a full build target:
$ make all
This target will build, test, and install the core Go tools, the LumiJS
compiler, and the AWS provider, in that order.
Each can be made in isolation, however, which ensures that the inner
loop for those is fast and so that, when it comes to finishing
pulumi/lumi#147, we can easily split them out and make from the top.
2017-06-02 23:26:34 +02:00
|
|
|
.PHONY: lumijs
|
|
|
|
lumijs:
|
|
|
|
@cd ./cmd/lumijs && $(MAKE)
|
2017-01-28 00:42:55 +01:00
|
|
|
|
2017-06-14 03:11:59 +02:00
|
|
|
.PHONY: lumirtpkg
|
|
|
|
lumirtpkg:
|
|
|
|
@cd ./lib/lumirt && $(MAKE)
|
2017-06-02 23:50:35 +02:00
|
|
|
|
|
|
|
.PHONY: lumijspkg
|
|
|
|
lumijspkg:
|
|
|
|
@cd ./lib/lumijs && $(MAKE)
|
|
|
|
|
2017-06-14 03:11:59 +02:00
|
|
|
.PHONY: lumipkg
|
|
|
|
lumipkg:
|
|
|
|
@cd ./lib/lumi && $(MAKE)
|
|
|
|
|
2017-06-02 23:50:35 +02:00
|
|
|
.PHONY: awspkg
|
|
|
|
awspkg:
|
Makeify more; add a "full build" target (#193)
* Makeify more; add a "full build" target
This change uses make for more of our tree. Namely, the AWS provider
and LumiJS compilers each now use make to build and/or install them.
Not only does this bring about some consistency to how we build and
test things, but also made it easy to add a full build target:
$ make all
This target will build, test, and install the core Go tools, the LumiJS
compiler, and the AWS provider, in that order.
Each can be made in isolation, however, which ensures that the inner
loop for those is fast and so that, when it comes to finishing
pulumi/lumi#147, we can easily split them out and make from the top.
2017-06-02 23:26:34 +02:00
|
|
|
@cd ./lib/aws && $(MAKE)
|
|
|
|
|
|
|
|
.PHONY: verify
|
|
|
|
verify:
|
|
|
|
@cd ./lib/aws && $(MAKE) verify
|
2016-11-15 20:30:34 +01:00
|
|
|
|
2017-06-16 02:54:53 +02:00
|
|
|
.PHONY: examples
|
|
|
|
examples:
|
2017-06-22 23:57:09 +02:00
|
|
|
@$(ECHO) "\033[0;32mTEST EXAMPLES:\033[0m"
|
2017-06-21 22:24:35 +02:00
|
|
|
go test -v -cover -timeout 1h -parallel ${TESTPARALLELISM} ./examples
|
|
|
|
|
2017-06-24 00:11:20 +02:00
|
|
|
.PHONY: gocover
|
|
|
|
gocover:
|
|
|
|
@$(ECHO) "\033[0;32mGO CODE COVERAGE:\033[0m"
|
|
|
|
./gocover.sh
|
|
|
|
|