git.fiddlerwoaroof.com
Browse code

chore: cleanup Makefile, use deliver for more things

Edward Langley authored on 11/10/2019 02:00:51
Showing 3 changed files
... ...
@@ -1,18 +1,17 @@
1 1
 ASSET_DIRS = $(shell find assets/ -type d)
2 2
 ASSET_FILES = $(shell find assets/ -type f)
3 3
 
4
-all: app.icns CJAWSAccess.app accounts.json $(ASSET_DIRS) $(ASSET_FILES)
4
+all: app.icns CJAWSAccess.app assets/accounts.json $(ASSET_DIRS) $(ASSET_FILES)
5 5
 	rsync -arvh assets/ CJAWSAccess.app/Contents/Resources/
6
-	cp accounts.json CJAWSAccess.app/Contents/Resources/accounts.json
7
-	cp app.icns CJAWSAccess.app/Contents/Resources/app.icns
8 6
 	touch CJAWSAccess.app
9 7
 
10 8
 CJAWSAccess.app: deliver.lisp src/*.lisp aws-access.asd addFonts.patch
11 9
 	/Applications/LispWorks\ 7.1\ \(64-bit\)/LispWorks\ \(64-bit\).app/Contents/MacOS/lispworks-7-1-0-amd64-darwin -build deliver.lisp
12 10
 	patch -N -p0 < addFonts.patch
13 11
 
14
-accounts.json: accounts.yml
12
+assets/accounts.json: accounts.yml
15 13
 	./flip-yaml.lisp accounts.yml
14
+	cp accounts.json assets/
16 15
 
17 16
 accounts.yml:
18 17
 	git archive --format=tar --remote=git@gitlab.cj.com:operations-chapter/aws-department.git heads/master -- accounts.yaml | tar xO accounts.yaml > ~/accounts.yml
... ...
@@ -28,5 +27,5 @@ cleanDmg:
28 27
 	rm -f CJAWSAccess.dmg
29 28
 
30 29
 clean: cleanDmg
31
-	rm -f accounts.json
30
+	rm -f assets/accounts.json
32 31
 	rm -rf CJAWSAccess.app
... ...
@@ -13,7 +13,14 @@
13 13
          (create-macos-application-bundle
14 14
           "CJAWSAccess.app"
15 15
           :document-types nil
16
-          :identifier "fwoar.cj.AWSAccess")
16
+          :application-icns "app.icns"
17
+          :identifier "fwoar.cj.AWSAccess"
18
+          :version (asdf:component-version
19
+                    (asdf:find-system :aws-access))
20
+          :build (concatenate 'string
21
+                              (subseq (uiop:run-program (list "git" "rev-parse" "HEAD") :output :string)
22
+                                      0 7)
23
+                              (uiop:run-program (list "zsh" "scripts/dirty-tag") :output :string)))
17 24
          0
18 25
          :KEEP-PRETTY-PRINTER t
19 26
          :interface :capi
20 27
new file mode 100755
... ...
@@ -0,0 +1,3 @@
1
+#!/usr/bin/env sh
2
+
3
+(git diff --quiet && git status --short &>>/dev/null) || echo -n -dirty