File tree 5 files changed +54
-0
lines changed
5 files changed +54
-0
lines changed Original file line number Diff line number Diff line change 1
1
# JetBrains.
2
2
.idea /
3
3
* iml
4
+
5
+ # Build artifacts.
6
+ build /
Original file line number Diff line number Diff line change @@ -56,3 +56,14 @@ arguments and an explanation of their effects:
56
56
-respect-file-case
57
57
Respect filenames' case when matching their extensions
58
58
```
59
+
60
+ ## Building from source
61
+ You can use any of the following methods to build the application:
62
+
63
+ - ` go build cmd/finley/main.go ` - Build the application
64
+ - ` build.sh ` - A simple wrapper around 'go build' that saves build artifacts
65
+ to ` build/ ` and sets a version number in the compiled binary. This script
66
+ expects a version to be provided by setting an environment variable
67
+ named ` VERSION `
68
+ - ` buildwin.sh ` - Build the application for Windows (since that seems like the
69
+ most common OS this tool would be used on)
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ if [[ -z " ${VERSION} " ]]
4
+ then
5
+ echo ' the VERSION environment variable must be set'
6
+ exit 1
7
+ fi
8
+
9
+ set -eux
10
+
11
+ buildDir=' build'
12
+ mkdir -p " ${buildDir} "
13
+
14
+ projectName=" $( basename $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " > /dev/null 2>&1 && pwd ) ) "
15
+ filename=" ${projectName} "
16
+ if [[ ! -z " ${GOOS+x} " ]]
17
+ then
18
+ filename=" ${filename} -${GOOS} "
19
+ fi
20
+ if [[ ! -z " ${GOARCH+x} " ]]
21
+ then
22
+ filename=" ${filename} -${GOARCH} "
23
+ fi
24
+ if [[ ! -z " ${GOOS+x} " ]] && [[ " ${GOOS} " == " windows" ]]
25
+ then
26
+ filename=" ${filename} .exe"
27
+ fi
28
+
29
+ go build -ldflags " -X main.version=${VERSION} " -o " ${buildDir} /${filename} " cmd/${projectName} /main.go
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ set -eux
4
+
5
+ projectDirPath=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " > /dev/null 2>&1 && pwd ) "
6
+
7
+ GOOS=windows " ${projectDirPath} /build.sh"
Original file line number Diff line number Diff line change @@ -18,6 +18,10 @@ import (
18
18
"time"
19
19
)
20
20
21
+ var (
22
+ version string
23
+ )
24
+
21
25
func main () {
22
26
targetDirPath := flag .String ("d" , "" , "The directory to search for DLLs" )
23
27
fileExtsCsv := flag .String ("e" , ".dll" , "Comma separated list of file extensions to search for" )
You can’t perform that action at this time.
0 commit comments