Last active
June 29, 2018 02:25
-
-
Save YutoMizutani/b78d222a1e7148720f9b0239e1de010f to your computer and use it in GitHub Desktop.
複数の.swiftファイルをSwift Package Managerを用いずにコンパイルする ref: https://qiita.com/YutoMizutani/items/ba8f993ef2ef8b04fb18
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ swiftc main.swift hello.swift | |
$ ./main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cat << 'EOT' > main.swift | |
import Foundation | |
let hello = Hello() | |
hello.say() | |
EOT | |
cat << 'EOT' > hello.swift | |
import Foundation | |
struct Hello { | |
func say() { | |
print("Hello, world!!") | |
} | |
} | |
EOT | |
swiftc -o main main.swift hello.swift | |
./main | |
rm main.swift hello.swift main # 後片付け |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
struct Hello { | |
func say() { | |
print("Hello, world!!") | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
let hello = Hello() | |
hello.say() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment