Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[EXPERIMENTAL] prototyping a next-generation cross-platform outline client with the sdk #193

Draft
wants to merge 12 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions x/examples/outline-vpn-app/.air.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# .air.conf
# Working directory
# . or absolute path, please note that the directories following must be under root.
root = "."
tmp_dir = "output/air"

[build]
# Just plain old shell command. You could use `make` as well.
cmd = "go build -o ./output/air/main ."
# Binary file yields from `cmd`.
bin = "output/air/main"
# Customize binary.
full_bin = "APP_ENV=dev APP_USER=air ./output/air/main"
# Watch these filename extensions.
include_ext = ["go"]
# Ignore these filename extensions or directories.
exclude_dir = []
# Watch these directories if you specified.
include_dir = ["fullstack_app"]
# Exclude files.
exclude_file = []
# It's not necessary to trigger build each time file changes if it's too frequent.
delay = 1000 # ms
# Stop to run old binary when build errors occur.
stop_on_error = true
# This log file places in your tmp_dir.
log = "output/air/errors.log"

[log]
# Show log time
time = false

[color]
# Customize each part's color. If no color found, use the raw app log.
main = "magenta"
watcher = "cyan"
build = "yellow"
runner = "green"

[misc]
# Delete tmp directory on exit
clean_on_exit = true
1 change: 1 addition & 0 deletions x/examples/outline-vpn-app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
output
45 changes: 45 additions & 0 deletions x/examples/outline-vpn-app/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@

OUTDIR=$(CURDIR)/output
BUILDDIR=$(OUTDIR)/build

GOBIN=$(OUTDIR)/bin
GOMOBILE=$(GOBIN)/gomobile
GOBIND=env PATH="$(GOBIN):$(PATH)" "$(GOMOBILE)" bind

IMPORT_HOST=github.com
IMPORT_PATH=$(IMPORT_HOST)/outline_prototype

ROOT_GO_PKG=fullstack_app

.PHONY: android apple watch all
all: android apple
watch:
mkdir -p ${OUTDIR}
templ generate -watch &
go run github.com/cosmtrek/air

android: $(BUILDDIR)/android/fullstack_app.aar

$(BUILDDIR)/android/fullstack_app.aar: $(GOMOBILE) fullstack_app/*_templ.go
mkdir -p "$(BUILDDIR)/android"
$(GOBIND) -o $(BUILDDIR)/android/fullstack_app.aar -target=android ./fullstack_app

apple: $(BUILDDIR)/apple/fullstack_app.xcframework

$(BUILDDIR)/apple/fullstack_app.xcframework: $(GOMOBILE) fullstack_app/*_templ.go
mkdir -p "$(BUILDDIR)/apple"
$(GOBIND) \
-o $(BUILDDIR)/apple/fullstack_app.xcframework \
-target=ios,iossimulator,maccatalyst \
-iosversion=13.1 \
./fullstack_app

fullstack_app/*_templ.go: fullstack_app/*.templ
templ generate

$(GOMOBILE): go.mod
env GOBIN="$(GOBIN)" go install golang.org/x/mobile/cmd/gomobile
env GOBIN="$(GOBIN)" $(GOMOBILE) init

go.mod:
go mod tidy
Loading
Loading