Skip to content

Instantly share code, notes, and snippets.

@ileitch
Created November 7, 2021 13:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ileitch/4696818c437e287635b61942a1c4f5b7 to your computer and use it in GitHub Desktop.
Save ileitch/4696818c437e287635b61942a1c4f5b7 to your computer and use it in GitHub Desktop.
#/usr/bin/bash
set -e
orig_path=$PATH
function typecheck {
swiftc -typecheck -module-name PeripheryKit Sources/PeripheryKit/Analyzer/Analyzer.swift Sources/PeripheryKit/Analyzer/SourceGraphVisitor.swift Sources/PeripheryKit/Analyzer/Visitors/AccessibilityCascader.swift Sources/PeripheryKit/Analyzer/Visitors/AncestralReferenceEliminator.swift Sources/PeripheryKit/Analyzer/Visitors/AssetReferenceRetainer.swift Sources/PeripheryKit/Analyzer/Visitors/AssignOnlyPropertyReferenceEliminator.swift Sources/PeripheryKit/Analyzer/Visitors/AssociatedTypeTypeAliasReferenceBuilder.swift Sources/PeripheryKit/Analyzer/Visitors/CodingKeyEnumReferenceBuilder.swift Sources/PeripheryKit/Analyzer/Visitors/ComplexPropertyAccessorReferenceBuilder.swift Sources/PeripheryKit/Analyzer/Visitors/DeclarationMarker.swift Sources/PeripheryKit/Analyzer/Visitors/DefaultConstructorReferenceBuilder.swift Sources/PeripheryKit/Analyzer/Visitors/EncodablePropertyRetainer.swift Sources/PeripheryKit/Analyzer/Visitors/EntryPointAttributeRetainer.swift Sources/PeripheryKit/Analyzer/Visitors/EnumCaseReferenceBuilder.swift Sources/PeripheryKit/Analyzer/Visitors/ExtensionReferenceBuilder.swift Sources/PeripheryKit/Analyzer/Visitors/ExternalTypeProtocolConformanceReferenceRemover.swift Sources/PeripheryKit/Analyzer/Visitors/GenericClassAndStructConstructorReferenceBuilder.swift Sources/PeripheryKit/Analyzer/Visitors/InterfaceBuilderPropertyRetainer.swift Sources/PeripheryKit/Analyzer/Visitors/ObjCAccessibleRetainer.swift Sources/PeripheryKit/Analyzer/Visitors/OptionalProtocolMemberRetainer.swift Sources/PeripheryKit/Analyzer/Visitors/PlainExtensionEliminator.swift Sources/PeripheryKit/Analyzer/Visitors/PropertyWrapperRetainer.swift Sources/PeripheryKit/Analyzer/Visitors/ProtocolConformanceReferenceBuilder.swift Sources/PeripheryKit/Analyzer/Visitors/ProtocolExtensionReferenceBuilder.swift Sources/PeripheryKit/Analyzer/Visitors/PubliclyAccessibleRetainer.swift Sources/PeripheryKit/Analyzer/Visitors/RedundantExplicitPublicAccessibilityMarker.swift Sources/PeripheryKit/Analyzer/Visitors/RedundantProtocolMarker.swift Sources/PeripheryKit/Analyzer/Visitors/StringInterpolationAppendInterpolationRetainer.swift Sources/PeripheryKit/Analyzer/Visitors/SwiftUIRetainer.swift Sources/PeripheryKit/Analyzer/Visitors/UnknownTypeExtensionRetainer.swift Sources/PeripheryKit/Analyzer/Visitors/UnusedParameterRetainer.swift Sources/PeripheryKit/Analyzer/Visitors/XCTestRetainer.swift Sources/PeripheryKit/Indexer/Accessibility.swift Sources/PeripheryKit/Indexer/AssetReference.swift Sources/PeripheryKit/Indexer/Declaration.swift Sources/PeripheryKit/Indexer/IndexExcludable.swift Sources/PeripheryKit/Indexer/InfoPlistIndexer.swift Sources/PeripheryKit/Indexer/InfoPlistParser.swift Sources/PeripheryKit/Indexer/JobPool.swift Sources/PeripheryKit/Indexer/ProjectFileKind.swift Sources/PeripheryKit/Indexer/Reference.swift Sources/PeripheryKit/Indexer/SourceFile.swift Sources/PeripheryKit/Indexer/SourceGraph.swift Sources/PeripheryKit/Indexer/SourceGraphDebugger.swift Sources/PeripheryKit/Indexer/SourceLocation.swift Sources/PeripheryKit/Indexer/SwiftIndexer.swift Sources/PeripheryKit/Indexer/XCDataModelIndexer.swift Sources/PeripheryKit/Indexer/XCDataModelParser.swift Sources/PeripheryKit/Indexer/XCMappingModelIndexer.swift Sources/PeripheryKit/Indexer/XCMappingModelParser.swift Sources/PeripheryKit/Indexer/XibIndexer.swift Sources/PeripheryKit/Indexer/XibParser.swift Sources/PeripheryKit/ProjectDriver.swift Sources/PeripheryKit/SPM/SPM.swift Sources/PeripheryKit/SPM/SPMProjectDriver.swift Sources/PeripheryKit/ScanResult.swift Sources/PeripheryKit/ScanResultBuilder.swift Sources/PeripheryKit/SwiftVersion.swift Sources/PeripheryKit/SwiftVersionParser.swift Sources/PeripheryKit/Syntax/CommentCommand.swift Sources/PeripheryKit/Syntax/ConformableVisitor.swift Sources/PeripheryKit/Syntax/DeclarationVisitor.swift Sources/PeripheryKit/Syntax/FunctionVisitor.swift Sources/PeripheryKit/Syntax/ImportVisitor.swift Sources/PeripheryKit/Syntax/MultiplexingSyntaxVisitor.swift Sources/PeripheryKit/Syntax/PropertyVisitor.swift Sources/PeripheryKit/Syntax/SourceLocationBuilder.swift Sources/PeripheryKit/Syntax/TypeSyntaxInspector.swift Sources/PeripheryKit/Syntax/UnusedParameterAnalyzer.swift Sources/PeripheryKit/Syntax/UnusedParameterParser.swift -I .build/x86_64-apple-macosx/debug -sdk /Applications/Xcode13.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk -F /Applications/Xcode13.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks -I /Applications/Xcode13.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib -L /Applications/Xcode13.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib -Xcc -fmodule-map-file=.build/checkouts/swift-indexstore/Sources/_CIndexStore/include/module.modulemap -Xcc -I -Xcc .build/checkouts/swift-indexstore/Sources/_CIndexStore/include -Xcc -fmodule-map-file=.build/x86_64-apple-macosx/debug/_CSwiftSyntax.build/module.modulemap -Xcc -I -Xcc .build/checkouts/swift-syntax/Sources/_CSwiftSyntax/include -Xcc -fmodule-map-file=.build/checkouts/swift-system/Sources/CSystem/include/module.modulemap -Xcc -I -Xcc .build/checkouts/swift-system/Sources/CSystem/include -Xcc -fmodule-map-file=.build/checkouts/Yams/Sources/CYaml/include/module.modulemap -Xcc -I -Xcc .build/checkouts/Yams/Sources/CYaml/include -index-store-path store
}
for toolchain in ~/Library/Developer/Toolchains/*; do
export PATH=${toolchain}/usr/bin:${orig_path}
which swiftc
swift -version
# warmup
swift package clean
swift build > /dev/null 2>&1
typecheck
for i in {1..5}; do
rm -rf store
time typecheck
du -d 0 store
done
echo "--------------------------------------------------"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment