Skip to content

Commit

Permalink
Merge pull request #182 from shawnbuso/elements
Browse files Browse the repository at this point in the history
Remove support for polymer components. bin/claat now supports custom …
  • Loading branch information
shawnbuso authored Mar 6, 2019
2 parents 879b5d2 + 6a65b0f commit bc176f1
Show file tree
Hide file tree
Showing 8 changed files with 685 additions and 1,448 deletions.
30 changes: 7 additions & 23 deletions claat/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,30 +23,22 @@ RELEASES=$(OUTDIR)/claat-darwin-amd64 \
$(OUTDIR)/claat-linux-amd64 \
$(OUTDIR)/claat-linux-386 \
$(OUTDIR)/claat-windows-amd64.exe \
$(OUTDIR)/claat-windows-386.exe \
$(OUTDIR)/claat2-darwin-amd64 \
$(OUTDIR)/claat2-linux-amd64 \
$(OUTDIR)/claat2-linux-386 \
$(OUTDIR)/claat2-windows-amd64.exe \
$(OUTDIR)/claat2-windows-386.exe
$(OUTDIR)/claat-windows-386.exe

SRCS = $(shell find . -name '*.go') render/tmpldata.go

all: $(OUTDIR)/claat $(OUTDIR)/claat2
all: $(OUTDIR)/claat

$(OUTDIR)/claat: $(SRCS) VERSION
go build -o $@ -ldflags "-X main.version=$(VERSION) -X main.useElements=false"
go build -o $@ -ldflags "-X main.version=$(VERSION)"

$(OUTDIR)/claat2: $(SRCS) VERSION
go build -o $@ -ldflags "-X main.version=$(VERSION) -X main.useElements=true"

serve: $(OUTDIR)/claat2
serve: $(OUTDIR)/claat
mkdir -p $(OUTDIR)/deps
cd ../; \
bazel build :bundle; \
mv -f bazel-genfiles/bundle.zip claat/$(OUTDIRNAME)/deps
unzip -o $(OUTDIR)/deps/bundle.zip -d $(OUTDIR)/deps/codelab-elements
cd bin; ./claat2 serve
cd bin; ./claat serve

release: $(RELEASES)
echo $(VERSION) > $(OUTDIR)/VERSION
Expand All @@ -69,16 +61,8 @@ $(OUTDIR)/claat-%: GOARCH=$(subst .exe,,$(word 2,$(subst -, ,$*)))
$(OUTDIR)/claat-%: $(SRCS) VERSION
CGO_ENABLED=0 GOOS=$(GOOS) GOARCH=$(GOARCH) go build \
-buildmode exe \
-ldflags "-X main.version=$(VERSION) -X main.useElements=false -s -w" \
-o $@

$(OUTDIR)/claat2-%: GOOS=$(firstword $(subst -, ,$*))
$(OUTDIR)/claat2-%: GOARCH=$(subst .exe,,$(word 2,$(subst -, ,$*)))
$(OUTDIR)/claat2-%: $(SRCS) VERSION
CGO_ENABLED=0 GOOS=$(GOOS) GOARCH=$(GOARCH) go build \
-buildmode exe \
-ldflags "-X main.version=$(VERSION) -X main.useElements=true -s -w" \
-ldflags "-X main.version=$(VERSION) -s -w" \
-o $@

%/tmpldata.go: %/gen-tmpldata.go %/template-elements.html %/template.html %/template.md %/template-offline.html
%/tmpldata.go: %/gen-tmpldata.go %/template.html %/template.md %/template-offline.html
cd $* && go generate
286 changes: 0 additions & 286 deletions claat/cmd/build.go

This file was deleted.

5 changes: 1 addition & 4 deletions claat/cmd/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,7 @@ import (
// CmdServe is the "claat serve ..." subcommand.
// addr is the hostname and port to bind the web server to.
// It returns a process exit code.
func CmdServe(addr string, useElements bool) int {
if !useElements {
CmdBuild()
}
func CmdServe(addr string) int {
http.Handle("/", http.FileServer(http.Dir(".")))
log.Printf("Serving codelabs on %s, opening browser tab now...", addr)
ch := make(chan error, 1)
Expand Down
Loading

0 comments on commit bc176f1

Please sign in to comment.