This file contains hidden or 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
internal struct _NSSimpleObjCType: ExpressibleByStringLiteral { | |
fileprivate let staticString: StaticString | |
var rawValue: UnicodeScalar { | |
return staticString.unicodeScalar | |
} | |
var _objCType: UnsafePointer<Int8> { | |
return UnsafeRawPointer(staticString.utf8Start).assumingMemoryBound(to: Int8.self) | |
} |
This file contains hidden or 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
$ echo 'func f(_ s: StaticString) { print(s) }; f("test")'|swiftc - -emit-assembly -O|swift demangle | |
.section __TEXT,__text,regular,pure_instructions | |
.macosx_version_min 10, 9 | |
.section __TEXT,__literal16,16byte_literals | |
.p2align 4 | |
LCPI0_0: | |
.quad 1 | |
.quad 2 | |
.section __TEXT,__text,regular,pure_instructions | |
.globl _main |
This file contains hidden or 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
➜ 8:51:41 git:(master) ✗ echo 'print("Hello, world!")'|DEVELOPER_DIR=/Applications/Xcode-beta.app swiftc - -static-stdlib -emit-bc -o hello_world.bc | |
➜ 8:51:48 git:(master) ✗ DEVELOPER_DIR=/Applications/Xcode-beta.app LLVM=/usr/local/Cellar/emscripten/1.37.10/libexec/llvm/bin/ emcc hello_world.bc | |
warning: Linking two modules of different data layouts: '/Users/norio/.emscripten_cache/asmjs/libc.bc' is 'e-p:32:32-i64:64-v128:32:128-n32-S128' whereas 'hello_world.bc' is 'e-m:o-i64:64-f80:128-n8:16:32:64-S128' | |
warning: Linking two modules of different target triples: /Users/norio/.emscripten_cache/asmjs/libc.bc' is 'asmjs-unknown-emscripten' whereas 'hello_world.bc' is 'x86_64-apple-macosx10.9' | |
error: Appending variables with different alignment need to be linked! | |
Traceback (most recent call last): | |
File "/usr/local/bin/emcc", line 13, in <module> | |
emcc.run() |
This file contains hidden or 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
//: Playground - noun: a place where people can play | |
import UIKit | |
struct URLCodableTest: Codable { | |
let ou: URL? | |
let u: URL | |
enum CodingKeys: String, CodingKey { | |
case ou |
This file contains hidden or 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
// swift-tools-version:4.0 | |
import PackageDescription | |
let package = Package( | |
name: "SourceKitten", | |
dependencies: [ | |
.package(url: "https://github.com/Carthage/Commandant.git", from: "0.12.0"), | |
.package(url: "https://github.com/drmohundro/SWXMLHash.git", .branch("version-4.0-changes")), | |
.package(url: "https://github.com/jpsim/Yams.git", .branch("master")), | |
.package(url: "https://github.com/norio-nomura/Clang_C.git", from: "1.0.0"), |
This file contains hidden or 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
➜ 8:25:59 git clone https://github.com/jpsim/SourceKitten.git --recurse-submodules | |
Cloning into 'SourceKitten'... | |
remote: Counting objects: 7924, done. | |
remote: Compressing objects: 100% (14/14), done. | |
remote: Total 7924 (delta 3), reused 7 (delta 2), pack-reused 7908 | |
Receiving objects: 100% (7924/7924), 6.05 MiB | 1.11 MiB/s, done. | |
Resolving deltas: 100% (5073/5073), done. | |
Submodule 'Carthage/Checkouts/Commandant' (https://github.com/Carthage/Commandant.git) registered for path 'Carthage/Checkouts/Commandant' | |
Submodule 'Carthage/Checkouts/Result' (https://github.com/antitypical/Result.git) registered for path 'Carthage/Checkouts/Result' | |
Submodule 'Carthage/Checkouts/SWXMLHash' (https://github.com/drmohundro/SWXMLHash.git) registered for path 'Carthage/Checkouts/SWXMLHash' |
This file contains hidden or 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
{ | |
"{\"root\":\"/Users/norio/github/SwiftLint\",\"rules\":{\"closure_spacing\":\"warning\",\"notification_center_detachment\":\"warning\",\"function_parameter_count\":\"warning: 5, error: 8\",\"redundant_discardable_let\":\"warning\",\"closure_parameter_position\":\"warning\",\"function_body_length\":\"warning: 40, error: 100\",\"nesting\":\"(type_level) w: 1, (statement_level) w: 5\",\"first_where\":\"warning\",\"unused_enumerated\":\"warning\",\"valid_ibinspectable\":\"warning\",\"trailing_newline\":\"warning\",\"control_statement\":\"warning\",\"vertical_whitespace\":\"warning, max_empty_lines: 1\",\"for_where\":\"warning\",\"trailing_comma\":\"warning, mandatory_comma: false\",\"closure_end_indentation\":\"warning\",\"generic_type_name\":\"(min_length) w/e: 1/0, (max_length) w/e: 20/1000, excluded: [], allowed_symbols: [], validates_start_with_lowercase: true\",\"redundant_nil_coalescing\":\"warning\",\"leading_whitespace\":\"warning\",\"force_cast\":\"error\",\"empty_parentheses_with_trailing_closure\": |
This file contains hidden or 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
#!/usr/bin/env bash | |
VERSION=20170501 | |
DARWIN_TOOLCHAIN_APPLICATION_CERT=9E8A538843E364A1C53A4C932648FA4CBC7E5986 | |
DARWIN_BUNDLE_IDENTIFIER=local.swift.$VERSION | |
DARWIN_INSTALLER_CERT="Developer ID Installer: Norio Nomura (PK9GMQ772L)" | |
BUNDLE_BASE_NAME=swift-LOCAL-2017-05-01-a | |
BUNDLE_NAME=$BUNDLE_BASE_NAME.xctoolchain | |
DARWIN_TOOLCHAIN_INSTALL_LOCATION=/Library/Developer/Toolchains/$BUNDLE_NAME | |
DARWIN_SCRIPTS=swift/utils/darwin-installer-scripts |
This file contains hidden or 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
/Users/buildnode/jenkins/workspace/oss-swift-package-osx/swift/utils/build-script | |
--ios | |
--tvos | |
--watchos | |
--lldb | |
--llbuild | |
--swiftpm | |
--playgroundlogger | |
--playgroundsupport | |
--release-debuginfo |
This file contains hidden or 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
➜ 8:50:54 git:(master) docker run --privileged -it --rm swift-base:16.04 | |
root@1c1012e25424:/# which swift | |
root@1c1012e25424:/# mkdir -p /opt/swift/swift-3.1.1-with-sourcekit | |
root@1c1012e25424:/# cd /opt/swift/swift-3.1.1-with-sourcekit | |
root@1c1012e25424:/opt/swift/swift-3.1.1-with-sourcekit# curl -L https://github.com/norio-nomura/docker-sourcekit-builder/releases/download/311/swift-3.1.1-RELEASE-3f82132-with-sourcekit.tar.gz|tar zxf - | |
% Total % Received % Xferd Average Speed Time Time Time Current | |
Dload Upload Total Spent Left Speed | |
100 625 0 625 0 0 692 0 --:--:-- --:--:-- --:--:-- 692 | |
100 352M 100 352M 0 0 2084k 0 0:02:53 0:02:53 --:--:-- 2251k | |
root@1c1012e25424:/opt/swift/swift-3.1.1-with-sourcekit# export PATH=$PATH:/opt/swift/swift-3.1.1-with-sourcekit/usr/bin/ |