Remove Xcode project & Drop Carthage Support
Xcode has supported Swift Package Manager projects natively since Xcode 11, which has been out for over a year, where you can use Xcode by having it open the `Package.swift` manifest rather than a `.xcodeproj` or `.xcworkspace`. I've been primarily developing SwiftLint in Xcode using this approach for over a year, and despite a few nitpicks I have, it's been a joy to use. So I'd like to completely remove the Xcode project along with things that support it: * `SwiftLint.xcworkspace`/`SwiftLint.xcodeproj`: Neither of these are needed if we use `xed .` or `xed Package.swift` to develop SwiftLint in Xcode. * `Cartfile`/`Cartfile.private`/`Cartfile.resolved`/`.gitmodules`/`Carthage/`: These were used to manage dependencies as git submodules for use in the Xcode workspace, but that's no longer necessary if Xcode delegates to SwiftPM to manage dependencies for us. * Some scripts can be simplified, cleaned up or even completely removed. * **Reduce duplication:** Rather than update dependencies or files in multiples places, there will only be the package manifest and the Podfile * **Reduce merge conflicts:** This hasn't been too bad, but it's occasionally a pain when trying to land old PRs * **Reduce development overhead:** No need to manually make sure that files in the Xcode project are sorted alphabetically * **Reduce clone time:** No need to run `git submodules update --init --recursive` anymore I think this breaks Carthage users that pull in SwiftLintFramework as a dependency in a Cartfile. However I can't find any references to [`SwiftLintFramework` in any `Cartfile` files on GitHub](https://github.com/search?q=swiftlintframework+filename%3ACartfile&type=Code&ref=advsearch&l=&l=) so this doesn't appear to be worth continuing to maintain. Resolves https://github.com/realm/SwiftLint/issues/3412
This commit is contained in:
parent
b2b95cf403
commit
76708d88f7
|
@ -35,13 +35,6 @@ xcuserdata
|
|||
#
|
||||
#Pods/
|
||||
|
||||
# Carthage
|
||||
#
|
||||
# Add this line if you want to avoid checking in source code from Carthage dependencies.
|
||||
# Carthage/Checkouts
|
||||
|
||||
Carthage/Build
|
||||
|
||||
# SwiftLint
|
||||
|
||||
SwiftLint.pkg
|
||||
|
|
|
@ -1,18 +0,0 @@
|
|||
[submodule "Carthage/Checkouts/SWXMLHash"]
|
||||
path = Carthage/Checkouts/SWXMLHash
|
||||
url = https://github.com/drmohundro/SWXMLHash.git
|
||||
[submodule "Carthage/Checkouts/xcconfigs"]
|
||||
path = Carthage/Checkouts/xcconfigs
|
||||
url = https://github.com/jspahrsummers/xcconfigs.git
|
||||
[submodule "Carthage/Checkouts/Commandant"]
|
||||
path = Carthage/Checkouts/Commandant
|
||||
url = https://github.com/Carthage/Commandant.git
|
||||
[submodule "Carthage/Checkouts/SourceKitten"]
|
||||
path = Carthage/Checkouts/SourceKitten
|
||||
url = https://github.com/jpsim/SourceKitten.git
|
||||
[submodule "Carthage/Checkouts/SwiftyTextTable"]
|
||||
path = Carthage/Checkouts/SwiftyTextTable
|
||||
url = https://github.com/scottrhoyt/SwiftyTextTable.git
|
||||
[submodule "Carthage/Checkouts/Yams"]
|
||||
path = Carthage/Checkouts/Yams
|
||||
url = https://github.com/jpsim/Yams.git
|
12
CHANGELOG.md
12
CHANGELOG.md
|
@ -5,6 +5,18 @@
|
|||
* SwiftLint now requires Swift 5.2 or higher to build.
|
||||
[JP Simard](https://github.com/jpsim)
|
||||
|
||||
* SwiftLintFramework can no longer be integrated as a Carthage
|
||||
depdendency.
|
||||
[JP Simard](https://github.com/jpsim)
|
||||
[#3412](https://github.com/realm/SwiftLint/issues/3412)
|
||||
|
||||
* `SwiftLint.xcworkspace` and `SwiftLint.xcproject` have been completely
|
||||
removed. You can still use Xcode to develop SwiftLint by opening it as
|
||||
a Swift Package by typing `xed .` or `xed Package.swift` from your
|
||||
shell.
|
||||
[JP Simard](https://github.com/jpsim)
|
||||
[#3412](https://github.com/realm/SwiftLint/issues/3412)
|
||||
|
||||
#### Experimental
|
||||
|
||||
* None.
|
||||
|
|
|
@ -37,17 +37,6 @@ Then you can use the full power of Xcode/LLDB/Instruments to develop and debug y
|
|||
1. Use the produced `swiftlint` binary from the command line, either by running `swift run [-c release] [swiftlint] [arguments]` or by invoking the binary directly at `.build/[release|debug]/swiftlint`
|
||||
1. [Optional] Attach LLDB: `lldb -- .build/[release|debug]/swiftlint [arguments]`
|
||||
|
||||
### Submodules
|
||||
|
||||
This SwiftLint repository uses submodules for its dependencies.
|
||||
The git submodules are used when using the Xcode project and workspace
|
||||
(e.g. `xed SwiftLint.xcworkspace`) and building SwiftLint by executing
|
||||
the `Makefile`. This means that if you decide to fork this repository to
|
||||
contribute to SwiftLint, don't forget to checkout the submodules as well when
|
||||
cloning, by running `git submodule update --init --recursive` after cloning.
|
||||
|
||||
See more info [in the README](https://github.com/realm/SwiftLint#installation).
|
||||
|
||||
### Code Generation
|
||||
|
||||
If XCTest cases or functions are added/removed/renamed, or if rules are
|
||||
|
@ -62,7 +51,7 @@ with Swift Package Manager on Linux. When contributing code changes, please
|
|||
ensure that all three supported build methods continue to work and pass tests.
|
||||
|
||||
```shell
|
||||
$ script/cibuild
|
||||
$ xcodebuild -scheme swiftlint test
|
||||
$ swift test
|
||||
$ make docker_test
|
||||
```
|
||||
|
|
2
Cartfile
2
Cartfile
|
@ -1,2 +0,0 @@
|
|||
github "jpsim/SourceKitten" ~> 0.30.1
|
||||
github "scottrhoyt/SwiftyTextTable" ~> 0.9.0
|
|
@ -1,3 +0,0 @@
|
|||
github "Carthage/Commandant" ~> 0.17.0
|
||||
github "jpsim/Yams" ~> 4.0.0
|
||||
github "jspahrsummers/xcconfigs" ~> 0.12.0
|
|
@ -1,6 +0,0 @@
|
|||
github "Carthage/Commandant" "0.17.0"
|
||||
github "drmohundro/SWXMLHash" "5.0.1"
|
||||
github "jpsim/SourceKitten" "0.30.1"
|
||||
github "jpsim/Yams" "4.0.0"
|
||||
github "jspahrsummers/xcconfigs" "0.12"
|
||||
github "scottrhoyt/SwiftyTextTable" "0.9.0"
|
|
@ -1 +0,0 @@
|
|||
Subproject commit ab68611013dec67413628ac87c1f29e8427bc8e4
|
|
@ -1 +0,0 @@
|
|||
Subproject commit a4931e5c3bafbedeb1601d3bb76bbe835c6d475a
|
|
@ -1 +0,0 @@
|
|||
Subproject commit c0f960f72fa1e6151695074ffa696e4da6c45ce8
|
|
@ -1 +0,0 @@
|
|||
Subproject commit c6df6cf533d120716bff38f8ff9885e1ce2a4ac3
|
|
@ -1 +0,0 @@
|
|||
Subproject commit 88caa2e6fffdbef2e91c2022d038576062042907
|
|
@ -1 +0,0 @@
|
|||
Subproject commit bb795558a76e5daf3688500055bbcfe243bffa8d
|
20
Makefile
20
Makefile
|
@ -2,8 +2,7 @@ TEMPORARY_FOLDER?=/tmp/SwiftLint.dst
|
|||
PREFIX?=/usr/local
|
||||
BUILD_TOOL?=xcodebuild
|
||||
|
||||
XCODEFLAGS=-workspace 'SwiftLint.xcworkspace' \
|
||||
-scheme 'swiftlint' \
|
||||
XCODEFLAGS=-scheme 'swiftlint' \
|
||||
DSTROOT=$(TEMPORARY_FOLDER) \
|
||||
OTHER_LDFLAGS=-Wl,-headerpad_max_install_names
|
||||
|
||||
|
@ -34,7 +33,7 @@ SWIFTLINTFRAMEWORK_PLIST=Source/SwiftLintFramework/Supporting Files/Info.plist
|
|||
|
||||
VERSION_STRING=$(shell /usr/libexec/PlistBuddy -c "Print :CFBundleShortVersionString" "$(SWIFTLINT_PLIST)")
|
||||
|
||||
.PHONY: all bootstrap clean build install package test uninstall docs
|
||||
.PHONY: all clean build install package test uninstall docs
|
||||
|
||||
all: build
|
||||
|
||||
|
@ -52,18 +51,15 @@ Tests/SwiftLintFrameworkTests/AutomaticRuleTests.generated.swift: Source/SwiftLi
|
|||
sourcery --sources Source/SwiftLintFramework/Rules --templates .sourcery/AutomaticRuleTests.stencil --output .sourcery
|
||||
mv .sourcery/AutomaticRuleTests.generated.swift Tests/SwiftLintFrameworkTests/AutomaticRuleTests.generated.swift
|
||||
|
||||
bootstrap:
|
||||
script/bootstrap
|
||||
|
||||
test: clean_xcode bootstrap
|
||||
test: clean_xcode
|
||||
$(BUILD_TOOL) $(XCODEFLAGS) test
|
||||
|
||||
test_tsan:
|
||||
swift build --build-tests $(TSAN_SWIFT_BUILD_FLAGS)
|
||||
DYLD_INSERT_LIBRARIES=$(TSAN_LIB) $(TSAN_XCTEST) $(TSAN_TEST_BUNDLE)
|
||||
|
||||
write_xcodebuild_log: bootstrap
|
||||
xcodebuild -workspace SwiftLint.xcworkspace -scheme swiftlint clean build-for-testing > xcodebuild.log
|
||||
write_xcodebuild_log:
|
||||
xcodebuild -scheme swiftlint clean build-for-testing > xcodebuild.log
|
||||
|
||||
analyze: write_xcodebuild_log
|
||||
swift run -c release swiftlint analyze --strict --compiler-log-path xcodebuild.log
|
||||
|
@ -122,11 +118,7 @@ package: installables
|
|||
--version "$(VERSION_STRING)" \
|
||||
"$(OUTPUT_PACKAGE)"
|
||||
|
||||
archive:
|
||||
carthage build --no-skip-current --platform mac
|
||||
carthage archive SwiftLintFramework
|
||||
|
||||
release: package archive portable_zip zip_linux
|
||||
release: package portable_zip zip_linux
|
||||
|
||||
docker_test:
|
||||
docker run -v `pwd`:`pwd` -w `pwd` --name swiftlint --rm swift:5.3 swift test --parallel
|
||||
|
|
10
README.md
10
README.md
|
@ -58,10 +58,10 @@ You can also install SwiftLint by downloading `SwiftLint.pkg` from the
|
|||
[latest GitHub release](https://github.com/realm/SwiftLint/releases/latest) and
|
||||
running it.
|
||||
|
||||
### Compiling from source:
|
||||
### Installing from source:
|
||||
|
||||
You can also build from source by cloning this project and running
|
||||
`git submodule update --init --recursive; make install` (Xcode 10.2 or later).
|
||||
You can also build and install from source by cloning this project and running
|
||||
`make install` (Xcode 11.4 or later).
|
||||
|
||||
### Known Installation Issues On MacOS Before 10.14.4
|
||||
|
||||
|
@ -72,8 +72,8 @@ you'll need to install the [Swift 5 Runtime Support for Command Line Tools](http
|
|||
Alternatively, you can:
|
||||
|
||||
* Update to macOS 10.14.4 or later
|
||||
* Install Xcode 10.2 or later at `/Applications/Xcode.app`
|
||||
* Rebuild SwiftLint from source using Xcode 10.2 or later
|
||||
* Install Xcode 11.4 or later at `/Applications/Xcode.app`
|
||||
* Rebuild SwiftLint from source using Xcode 11.4 or later
|
||||
|
||||
## Usage
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ $ mint install realm/SwiftLint
|
|||
|
||||
### 编译源代码:
|
||||
|
||||
你也可以通过 Clone SwiftLint 的 Git 仓库到本地然后执行 `git submodule update --init --recursive; make install` (Xcode 10.2+) 编译源代码的方式来安装。
|
||||
你也可以通过 Clone SwiftLint 的 Git 仓库到本地然后执行 `make install` (Xcode 11.4+) 编译源代码的方式来安装。
|
||||
|
||||
## 用法
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@ $ mint install realm/SwiftLint
|
|||
|
||||
### 소스를 직접 컴파일하는 경우:
|
||||
|
||||
본 프로젝트를 클론해서 빌드할 수도 있습니다. `git submodule update --init --recursive; make install` 명령을 사용합니다. (Xcode 10.2 이후 버전)
|
||||
본 프로젝트를 클론해서 빌드할 수도 있습니다. `make install` 명령을 사용합니다. (Xcode 11.4 이후 버전)
|
||||
|
||||
## 사용 방법
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,7 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Workspace
|
||||
version = "1.0">
|
||||
<FileRef
|
||||
location = "self:SwiftLint.xcodeproj">
|
||||
</FileRef>
|
||||
</Workspace>
|
|
@ -1,8 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>IDEDidComputeMac32BitWarning</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
|
@ -1,113 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0930"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
buildImplicitDependencies = "YES">
|
||||
<BuildActionEntries>
|
||||
<BuildActionEntry
|
||||
buildForTesting = "YES"
|
||||
buildForRunning = "YES"
|
||||
buildForProfiling = "YES"
|
||||
buildForArchiving = "YES"
|
||||
buildForAnalyzing = "YES">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "D0D1216C19E87B05005E4BAA"
|
||||
BuildableName = "SwiftLintFramework.framework"
|
||||
BlueprintName = "SwiftLintFramework"
|
||||
ReferencedContainer = "container:SwiftLint.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
<BuildActionEntry
|
||||
buildForTesting = "YES"
|
||||
buildForRunning = "NO"
|
||||
buildForProfiling = "NO"
|
||||
buildForArchiving = "NO"
|
||||
buildForAnalyzing = "NO">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "D0D1217619E87B05005E4BAA"
|
||||
BuildableName = "SwiftLintFrameworkTests.xctest"
|
||||
BlueprintName = "SwiftLintFrameworkTests"
|
||||
ReferencedContainer = "container:SwiftLint.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
</BuildActionEntries>
|
||||
</BuildAction>
|
||||
<TestAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<Testables>
|
||||
<TestableReference
|
||||
skipped = "NO">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "D0D1217619E87B05005E4BAA"
|
||||
BuildableName = "SwiftLintFrameworkTests.xctest"
|
||||
BlueprintName = "SwiftLintFrameworkTests"
|
||||
ReferencedContainer = "container:SwiftLint.xcodeproj">
|
||||
</BuildableReference>
|
||||
</TestableReference>
|
||||
</Testables>
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "D0D1216C19E87B05005E4BAA"
|
||||
BuildableName = "SwiftLintFramework.framework"
|
||||
BlueprintName = "SwiftLintFramework"
|
||||
ReferencedContainer = "container:SwiftLint.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
debugDocumentVersioning = "YES"
|
||||
debugServiceExtension = "internal"
|
||||
allowLocationSimulation = "YES">
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "D0D1216C19E87B05005E4BAA"
|
||||
BuildableName = "SwiftLintFramework.framework"
|
||||
BlueprintName = "SwiftLintFramework"
|
||||
ReferencedContainer = "container:SwiftLint.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
buildConfiguration = "Profile"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
savedToolIdentifier = ""
|
||||
useCustomWorkingDirectory = "NO"
|
||||
debugDocumentVersioning = "YES">
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "D0D1216C19E87B05005E4BAA"
|
||||
BuildableName = "SwiftLintFramework.framework"
|
||||
BlueprintName = "SwiftLintFramework"
|
||||
ReferencedContainer = "container:SwiftLint.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
</ProfileAction>
|
||||
<AnalyzeAction
|
||||
buildConfiguration = "Debug">
|
||||
</AnalyzeAction>
|
||||
<ArchiveAction
|
||||
buildConfiguration = "Release"
|
||||
revealArchiveInOrganizer = "YES">
|
||||
</ArchiveAction>
|
||||
</Scheme>
|
|
@ -1,134 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0930"
|
||||
version = "2.0">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
buildImplicitDependencies = "YES">
|
||||
<BuildActionEntries>
|
||||
<BuildActionEntry
|
||||
buildForTesting = "YES"
|
||||
buildForRunning = "YES"
|
||||
buildForProfiling = "YES"
|
||||
buildForArchiving = "YES"
|
||||
buildForAnalyzing = "YES">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "D0E7B63119E9C64500EDBA4D"
|
||||
BuildableName = "swiftlint.app"
|
||||
BlueprintName = "swiftlint"
|
||||
ReferencedContainer = "container:SwiftLint.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
</BuildActionEntries>
|
||||
</BuildAction>
|
||||
<TestAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
codeCoverageEnabled = "YES"
|
||||
onlyGenerateCoverageForSpecifiedTargets = "YES"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<CodeCoverageTargets>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "D0D1216C19E87B05005E4BAA"
|
||||
BuildableName = "SwiftLintFramework.framework"
|
||||
BlueprintName = "SwiftLintFramework"
|
||||
ReferencedContainer = "container:SwiftLint.xcodeproj">
|
||||
</BuildableReference>
|
||||
</CodeCoverageTargets>
|
||||
<Testables>
|
||||
<TestableReference
|
||||
skipped = "NO"
|
||||
parallelizable = "YES"
|
||||
testExecutionOrdering = "random">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "D0D1217619E87B05005E4BAA"
|
||||
BuildableName = "SwiftLintFrameworkTests.xctest"
|
||||
BlueprintName = "SwiftLintFrameworkTests"
|
||||
ReferencedContainer = "container:SwiftLint.xcodeproj">
|
||||
</BuildableReference>
|
||||
</TestableReference>
|
||||
</Testables>
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "D0E7B63119E9C64500EDBA4D"
|
||||
BuildableName = "swiftlint.app"
|
||||
BlueprintName = "swiftlint"
|
||||
ReferencedContainer = "container:SwiftLint.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
debugDocumentVersioning = "NO"
|
||||
debugXPCServices = "NO"
|
||||
debugServiceExtension = "internal"
|
||||
allowLocationSimulation = "NO"
|
||||
viewDebuggingEnabled = "No">
|
||||
<BuildableProductRunnable
|
||||
runnableDebuggingMode = "0">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "D0E7B63119E9C64500EDBA4D"
|
||||
BuildableName = "swiftlint.app"
|
||||
BlueprintName = "swiftlint"
|
||||
ReferencedContainer = "container:SwiftLint.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
<CommandLineArguments>
|
||||
<CommandLineArgument
|
||||
argument = "lint --no-cache"
|
||||
isEnabled = "YES">
|
||||
</CommandLineArgument>
|
||||
</CommandLineArguments>
|
||||
<EnvironmentVariables>
|
||||
<EnvironmentVariable
|
||||
key = "DEVELOPER_DIR"
|
||||
value = "${DEVELOPER_DIR}"
|
||||
isEnabled = "YES">
|
||||
</EnvironmentVariable>
|
||||
<EnvironmentVariable
|
||||
key = "TOOLCHAINS"
|
||||
value = "${TOOLCHAINS}"
|
||||
isEnabled = "YES">
|
||||
</EnvironmentVariable>
|
||||
</EnvironmentVariables>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
buildConfiguration = "Profile"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
savedToolIdentifier = ""
|
||||
useCustomWorkingDirectory = "NO"
|
||||
debugDocumentVersioning = "YES">
|
||||
<BuildableProductRunnable
|
||||
runnableDebuggingMode = "0">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "D0E7B63119E9C64500EDBA4D"
|
||||
BuildableName = "swiftlint.app"
|
||||
BlueprintName = "swiftlint"
|
||||
ReferencedContainer = "container:SwiftLint.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
</ProfileAction>
|
||||
<AnalyzeAction
|
||||
buildConfiguration = "Debug">
|
||||
</AnalyzeAction>
|
||||
<ArchiveAction
|
||||
buildConfiguration = "Release"
|
||||
revealArchiveInOrganizer = "YES">
|
||||
</ArchiveAction>
|
||||
</Scheme>
|
|
@ -1,22 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Workspace
|
||||
version = "1.0">
|
||||
<FileRef
|
||||
location = "group:SwiftLint.xcodeproj">
|
||||
</FileRef>
|
||||
<FileRef
|
||||
location = "group:Carthage/Checkouts/SourceKitten/sourcekitten.xcodeproj">
|
||||
</FileRef>
|
||||
<FileRef
|
||||
location = "group:Carthage/Checkouts/Commandant/Commandant.xcodeproj">
|
||||
</FileRef>
|
||||
<FileRef
|
||||
location = "group:Carthage/Checkouts/SWXMLHash/SWXMLHash.xcodeproj">
|
||||
</FileRef>
|
||||
<FileRef
|
||||
location = "group:Carthage/Checkouts/SwiftyTextTable/SwiftyTextTable.xcodeproj">
|
||||
</FileRef>
|
||||
<FileRef
|
||||
location = "group:Carthage/Checkouts/Yams/Yams.xcodeproj">
|
||||
</FileRef>
|
||||
</Workspace>
|
|
@ -1,8 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>IDEDidComputeMac32BitWarning</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
|
@ -772,8 +772,7 @@ extension IntegrationTests {
|
|||
static var allTests: [(String, (IntegrationTests) -> () throws -> Void)] = [
|
||||
("testSwiftLintLints", testSwiftLintLints),
|
||||
("testSwiftLintAutoCorrects", testSwiftLintAutoCorrects),
|
||||
("testSimulateHomebrewTest", testSimulateHomebrewTest),
|
||||
("testSimulateHomebrewTestWithDisableSourceKit", testSimulateHomebrewTestWithDisableSourceKit)
|
||||
("testSimulateHomebrewTest", testSimulateHomebrewTest)
|
||||
]
|
||||
}
|
||||
|
||||
|
|
|
@ -96,42 +96,6 @@ class IntegrationTests: XCTestCase {
|
|||
XCTAssertEqual(swiftlintResult.stdout, stdoutWithoutCrash)
|
||||
XCTAssertEqual(swiftlintResult.stderr, stderrWithoutCrash)
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
func testSimulateHomebrewTestWithDisableSourceKit() {
|
||||
// Since this test uses the `swiftlint` binary built while building `SwiftLintPackageTests`,
|
||||
// we run it only on macOS using SwiftPM.
|
||||
#if os(macOS) && SWIFT_PACKAGE
|
||||
guard let swiftlintURL = swiftlintBuiltBySwiftPM(),
|
||||
let (testSwiftURL, seatbeltURL) = prepareSandbox() else {
|
||||
return
|
||||
}
|
||||
|
||||
defer {
|
||||
try? FileManager.default.removeItem(at: testSwiftURL.deletingLastPathComponent())
|
||||
try? FileManager.default.removeItem(at: seatbeltURL)
|
||||
}
|
||||
|
||||
let swiftlintInSandboxArgs = [
|
||||
"sandbox-exec", "-f", seatbeltURL.path, "sh", "-c",
|
||||
"SWIFTLINT_SWIFT_VERSION=3 SWIFTLINT_DISABLE_SOURCEKIT=1 \(swiftlintURL.path) --no-cache"
|
||||
]
|
||||
let swiftlintResult = execute(swiftlintInSandboxArgs, in: testSwiftURL.deletingLastPathComponent())
|
||||
XCTAssertEqual(swiftlintResult.status, 0)
|
||||
XCTAssertEqual(swiftlintResult.stdout, """
|
||||
\(testSwiftURL.path):1:1: \
|
||||
warning: Trailing Newline Violation: Files should have a single trailing newline. (trailing_newline)
|
||||
|
||||
""")
|
||||
XCTAssertEqual(swiftlintResult.stderr, """
|
||||
Linting Swift files at paths \n\
|
||||
Linting 'Test.swift' (1/1)
|
||||
SourceKit is disabled by `SWIFTLINT_DISABLE_SOURCEKIT`.
|
||||
Most rules will be skipped because sourcekitd has failed.
|
||||
Done linting! Found 1 violation, 0 serious in 1 file.
|
||||
|
||||
""")
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,15 +32,13 @@ jobs:
|
|||
xcode12:
|
||||
DEVELOPER_DIR: /Applications/Xcode_12.app
|
||||
steps:
|
||||
- script: git submodule update --init --recursive
|
||||
displayName: Update git submodules
|
||||
- script: |
|
||||
sw_vers
|
||||
xcodebuild -version
|
||||
displayName: Version Informations
|
||||
- script: >
|
||||
set -o pipefail &&
|
||||
xcodebuild -workspace SwiftLint.xcworkspace -scheme swiftlint test |
|
||||
xcodebuild -scheme swiftlint test |
|
||||
xcpretty -r junit -o build/reports/xcodebuild.xml
|
||||
displayName: xcodebuild test
|
||||
- script: bash <(curl -s https://codecov.io/bash)
|
||||
|
|
|
@ -1,18 +0,0 @@
|
|||
**Copyright (c) 2013 Justin Spahr-Summers**
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||
the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@ -1,82 +0,0 @@
|
|||
# objc-build-scripts
|
||||
|
||||
This project is a collection of scripts created with two goals:
|
||||
|
||||
1. To standardize how Objective-C projects are bootstrapped after cloning
|
||||
1. To easily build Objective-C projects on continuous integration servers
|
||||
|
||||
## Scripts
|
||||
|
||||
Right now, there are two important scripts: [`bootstrap`](#bootstrap) and
|
||||
[`cibuild`](#cibuild). Both are Bash scripts, to maximize compatibility and
|
||||
eliminate pesky system configuration issues (like setting up a working Ruby
|
||||
environment).
|
||||
|
||||
The structure of the scripts on disk is meant to follow that of a typical Ruby
|
||||
project:
|
||||
|
||||
```
|
||||
script/
|
||||
bootstrap
|
||||
cibuild
|
||||
```
|
||||
|
||||
### bootstrap
|
||||
|
||||
This script is responsible for bootstrapping (initializing) your project after
|
||||
it's been checked out. Here, you should install or clone any dependencies that
|
||||
are required for a working build and development environment.
|
||||
|
||||
By default, the script will verify that [xctool][] is installed, then initialize
|
||||
and update submodules recursively. If any submodules contain `script/bootstrap`,
|
||||
that will be run as well.
|
||||
|
||||
To check that other tools are installed, you can set the `REQUIRED_TOOLS`
|
||||
environment variable before running `script/bootstrap`, or edit it within the
|
||||
script directly. Note that no installation is performed automatically, though
|
||||
this can always be added within your specific project.
|
||||
|
||||
### cibuild
|
||||
|
||||
This script is responsible for building the project, as you would want it built
|
||||
for continuous integration. This is preferable to putting the logic on the CI
|
||||
server itself, since it ensures that any changes are versioned along with the
|
||||
source.
|
||||
|
||||
By default, the script will run [`bootstrap`](#bootstrap), look for any Xcode
|
||||
workspace or project in the working directory, then build all targets/schemes
|
||||
(as found by `xcodebuild -list`) using [xctool][].
|
||||
|
||||
You can also specify the schemes to build by passing them into the script:
|
||||
|
||||
```sh
|
||||
script/cibuild ReactiveCocoa-Mac ReactiveCocoa-iOS
|
||||
```
|
||||
|
||||
As with the `bootstrap` script, there are several environment variables that can
|
||||
be used to customize behavior. They can be set on the command line before
|
||||
invoking the script, or the defaults changed within the script directly.
|
||||
|
||||
## Getting Started
|
||||
|
||||
To add the scripts to your project, read the contents of this repository into
|
||||
a `script` folder:
|
||||
|
||||
```
|
||||
$ git remote add objc-build-scripts https://github.com/jspahrsummers/objc-build-scripts.git
|
||||
$ git fetch objc-build-scripts
|
||||
$ git read-tree --prefix=script/ -u objc-build-scripts/master
|
||||
```
|
||||
|
||||
Then commit the changes, to incorporate the scripts into your own repository's
|
||||
history. You can also freely tweak the scripts for your specific project's
|
||||
needs.
|
||||
|
||||
To merge in upstream changes later:
|
||||
|
||||
```
|
||||
$ git fetch -p objc-build-scripts
|
||||
$ git merge --ff --squash -Xsubtree=script objc-build-scripts/master
|
||||
```
|
||||
|
||||
[xctool]: https://github.com/facebook/xctool
|
|
@ -1,47 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
export SCRIPT_DIR=$(dirname "$0")
|
||||
|
||||
##
|
||||
## Bootstrap Process
|
||||
##
|
||||
|
||||
main ()
|
||||
{
|
||||
submodules=$(git submodule status)
|
||||
local result=$?
|
||||
|
||||
if [ "$result" -ne "0" ]
|
||||
then
|
||||
exit $result
|
||||
fi
|
||||
|
||||
if [ -n "$submodules" ]
|
||||
then
|
||||
echo "*** Updating submodules..."
|
||||
update_submodules
|
||||
fi
|
||||
}
|
||||
|
||||
bootstrap_submodule ()
|
||||
{
|
||||
local bootstrap="script/bootstrap"
|
||||
|
||||
if [ -e "$bootstrap" ]
|
||||
then
|
||||
echo "*** Bootstrapping $name..."
|
||||
"$bootstrap" >/dev/null
|
||||
else
|
||||
update_submodules
|
||||
fi
|
||||
}
|
||||
|
||||
update_submodules ()
|
||||
{
|
||||
git submodule sync --quiet && git submodule update --init && git submodule foreach --quiet bootstrap_submodule
|
||||
}
|
||||
|
||||
export -f bootstrap_submodule
|
||||
export -f update_submodules
|
||||
|
||||
main
|
|
@ -1,12 +0,0 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
# Check the minimum required Xcode version. Meant to be run
|
||||
# as part of an Xcode Run Script build phase.
|
||||
|
||||
required_xcode_version=6.1.1
|
||||
|
||||
if [ ${XCODE_VERSION_ACTUAL} -lt ${required_xcode_version//.} ]
|
||||
then
|
||||
echo "error: Xcode ${required_xcode_version} or later is required to build ${PRODUCT_NAME}"
|
||||
exit 1
|
||||
fi
|
|
@ -1 +0,0 @@
|
|||
make test package
|
|
@ -1,6 +0,0 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
# Extracts the swiftlint CLI tool from its application bundle. Meant to be run
|
||||
# as part of an Xcode Run Script build phase.
|
||||
|
||||
cp -v "${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}" "${BUILT_PRODUCTS_DIR}/${EXECUTABLE_NAME}"
|
Loading…
Reference in New Issue