Skip to content

Commit

Permalink
chore: delete cmd/ftl symlink (#2730)
Browse files Browse the repository at this point in the history
It's annoying because some editors will index both directories and every
file will show up twice.
  • Loading branch information
alecthomas authored Sep 19, 2024
1 parent 2b0d47a commit 5d6c3a4
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .go-arch-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ components:
protos: { in: backend/protos/** }
schema: { in: backend/schema/** }
ftl: { in: . }
ftl-cmd: { in: cmd/ftl/** }
ftl-cmd: { in: frontend/cli/ftl/** }
go-runtime: { in: go-runtime/** }
jvm-runtime: { in: jvm-runtime/** }
rust-runtime: { in: rust-runtime/** }
Expand Down
13 changes: 6 additions & 7 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
builds:
- id: ftl
main: ./cmd/ftl
main: ./frontend/cli/ftl
binary: ftl
env:
- CGO_ENABLED=0
Expand All @@ -18,18 +18,18 @@ archives:
- format: tar.gz
name_template: "{{ .ProjectName }}-{{ .Version }}.{{- .Os }}-{{ .Arch }}"
format_overrides:
- goos: windows
format: zip
- goos: windows
format: zip
checksum:
name_template: 'checksums.txt'
name_template: "checksums.txt"
snapshot:
name_template: "{{ incpatch .Version }}-next"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
- "^docs:"
- "^test:"

brews:
- name: ftl
Expand All @@ -39,7 +39,6 @@ brews:
owner: TBD54566975
name: homebrew-ftl
token: "{{ .Env.FTL_HOMEBREW_TOKEN }}"

# The lines beneath this are called `modelines`. See `:help modeline`
# Feel free to remove those if you don't want/use them.
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
Expand Down
15 changes: 9 additions & 6 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,16 @@ build-generate:
build +tools: build-protos build-zips build-frontend
#!/bin/bash
shopt -s extglob
set -x

if [ "${FTL_DEBUG:-}" = "true" ]; then
for tool in $@; do go build -o "{{RELEASE}}/$tool" -tags release -gcflags=all="-N -l" -ldflags "-X github.com/TBD54566975/ftl.Version={{VERSION}} -X github.com/TBD54566975/ftl.Timestamp={{TIMESTAMP}}" "./cmd/$tool"; done
else
for tool in $@; do mk "{{RELEASE}}/$tool" : !(build|integration|infrastructure|node_modules|Procfile*|Dockerfile*) -- go build -o "{{RELEASE}}/$tool" -tags release -ldflags "-X github.com/TBD54566975/ftl.Version={{VERSION}} -X github.com/TBD54566975/ftl.Timestamp={{TIMESTAMP}}" "./cmd/$tool"; done
fi
for tool in $@; do
path="cmd/$tool"
test "$tool" = "ftl" && path="frontend/cli"
if [ "${FTL_DEBUG:-}" = "true" ]; then
go build -o "{{RELEASE}}/$tool" -tags release -gcflags=all="-N -l" -ldflags "-X github.com/TBD54566975/ftl.Version={{VERSION}} -X github.com/TBD54566975/ftl.Timestamp={{TIMESTAMP}}" "./$path"
else
mk "{{RELEASE}}/$tool" : !(build|integration|infrastructure|node_modules|Procfile*|Dockerfile*) -- go build -o "{{RELEASE}}/$tool" -tags release -ldflags "-X github.com/TBD54566975/ftl.Version={{VERSION}} -X github.com/TBD54566975/ftl.Timestamp={{TIMESTAMP}}" "./$path"
fi
done

# Build all backend binaries
build-backend:
Expand Down
1 change: 0 additions & 1 deletion cmd/ftl

This file was deleted.

6 changes: 5 additions & 1 deletion scripts/ftl
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,9 @@ set -euo pipefail
ftldir="$(dirname "$(readlink -f "$0")")/.."
name="$(basename "$0")"
dest="${ftldir}/build/devel"
src="./cmd/${name}"
if [ "${name}" = "ftl" ]; then
src="./frontend/cli"
fi
mkdir -p "$dest"
(cd "${ftldir}/cmd/${name}" && "${ftldir}/bin/go" build -ldflags="-s -w -buildid=" -o "$dest/${name}" ./) && exec "$dest/${name}" "$@"
(cd "${ftldir}/${src}" && "${ftldir}/bin/go" build -ldflags="-s -w -buildid=" -o "$dest/${name}" .) && exec "$dest/${name}" "$@"

0 comments on commit 5d6c3a4

Please sign in to comment.