initial commit: applephotos CLI with progress, cloud status, per-asset export

This commit is contained in:
Ein Anderssono
2026-06-11 20:25:07 +02:00
commit 6ec16f3966
21 changed files with 3488 additions and 0 deletions
+39
View File
@@ -0,0 +1,39 @@
BINARY := ./bin/applephotos
MODULE := github.com/einand/applephotos
BRIDGE_DIR := bridge
OBJ := $(BRIDGE_DIR)/photokit_bridge.o
LIB := $(BRIDGE_DIR)/libphotokit_bridge.a
STUB_OBJ := $(BRIDGE_DIR)/photokit_bridge_stub.o
STUB_LIB := $(BRIDGE_DIR)/libphotokit_bridge_stub.a
.PHONY: build clean test coverage
$(LIB): $(OBJ)
ar rcs $@ $<
$(OBJ): $(BRIDGE_DIR)/photokit_bridge.m $(BRIDGE_DIR)/photokit_bridge.h
cc -c -x objective-c -fobjc-arc -framework Photos -framework Foundation -o $@ $<
$(STUB_LIB): $(STUB_OBJ)
ar rcs $@ $<
$(STUB_OBJ): $(BRIDGE_DIR)/photokit_bridge_stub.c $(BRIDGE_DIR)/photokit_bridge.h
cc -c -o $@ $<
build: $(LIB)
go build -o $(BINARY) $(MODULE)/cmd/applephotos
test: $(STUB_LIB)
go test -tags=test -coverprofile=coverage.out -covermode=atomic -coverpkg=./... ./...
@grep -v 'main_main.go' coverage.out > coverage_filtered.out 2>/dev/null || true
@mv coverage_filtered.out coverage.out 2>/dev/null || true
@go tool cover -func=coverage.out | tail -1
coverage: $(STUB_LIB)
go test -tags=test -coverprofile=coverage.out -covermode=atomic -coverpkg=./... ./...
@grep -v 'main_main.go' coverage.out > coverage_filtered.out 2>/dev/null || true
@mv coverage_filtered.out coverage.out 2>/dev/null || true
go tool cover -func=coverage.out
clean:
rm -f $(BINARY) $(OBJ) $(LIB) $(STUB_OBJ) $(STUB_LIB) coverage.out