Skip to content

Commit 5749762

Browse files
committed
Fix compilation
1 parent f8757b6 commit 5749762

File tree

5 files changed

+120
-2
lines changed

5 files changed

+120
-2
lines changed

Sources/XCRemoteCache/Commands/Prepare/Integrate/XCIntegrate.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public class XCIntegrate {
9999
includes: targetsInclude.integrateArrayArguments
100100
)
101101
let buildSettingsAppenderOptions: BuildSettingsIntegrateAppenderOption = [
102-
.disableSwiftDriverIntegration
102+
.disableSwiftDriverIntegration,
103103
]
104104
let buildSettingsAppender = XcodeProjBuildSettingsIntegrateAppender(
105105
mode: context.mode,

Sources/XCRemoteCache/Commands/Swiftc/NoopSwiftcProductsGenerator.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2021 Spotify AB.
1+
// Copyright (c) 2023 Spotify AB.
22
//
33
// Licensed to the Apache Software Foundation (ASF) under one
44
// or more contributor license agreements. See the NOTICE file
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
// Copyright (c) 2023 Spotify AB.
2+
//
3+
// Licensed to the Apache Software Foundation (ASF) under one
4+
// or more contributor license agreements. See the NOTICE file
5+
// distributed with this work for additional information
6+
// regarding copyright ownership. The ASF licenses this file
7+
// to you under the Apache License, Version 2.0 (the
8+
// "License"); you may not use this file except in compliance
9+
// with the License. You may obtain a copy of the License at
10+
//
11+
// http://www.apache.org/licenses/LICENSE-2.0
12+
//
13+
// Unless required by applicable law or agreed to in writing,
14+
// software distributed under the License is distributed on an
15+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16+
// KIND, either express or implied. See the License for the
17+
// specific language governing permissions and limitations
18+
// under the License.
19+
20+
import Foundation
21+
22+
class StaticSwiftcInputReader: SwiftcInputReader {
23+
private let moduleDependencies: URL?
24+
private let swiftDependencies: URL?
25+
private let compilationFiles: [SwiftFileCompilationInfo]
26+
27+
init(
28+
moduleDependencies: URL?,
29+
swiftDependencies: URL?,
30+
compilationFiles: [SwiftFileCompilationInfo]
31+
) {
32+
self.moduleDependencies = moduleDependencies
33+
self.swiftDependencies = swiftDependencies
34+
self.compilationFiles = compilationFiles
35+
}
36+
37+
func read() throws -> SwiftCompilationInfo {
38+
return .init(
39+
info: .init(
40+
dependencies: moduleDependencies,
41+
swiftDependencies: swiftDependencies
42+
),
43+
files: compilationFiles
44+
)
45+
}
46+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
// Copyright (c) 2023 Spotify AB.
2+
//
3+
// Licensed to the Apache Software Foundation (ASF) under one
4+
// or more contributor license agreements. See the NOTICE file
5+
// distributed with this work for additional information
6+
// regarding copyright ownership. The ASF licenses this file
7+
// to you under the Apache License, Version 2.0 (the
8+
// "License"); you may not use this file except in compliance
9+
// with the License. You may obtain a copy of the License at
10+
//
11+
// http://www.apache.org/licenses/LICENSE-2.0
12+
//
13+
// Unless required by applicable law or agreed to in writing,
14+
// software distributed under the License is distributed on an
15+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16+
// KIND, either express or implied. See the License for the
17+
// specific language governing permissions and limitations
18+
// under the License.
19+
20+
import Foundation
21+
22+
class StaticFileListReader: ListReader {
23+
private let list: [URL]
24+
25+
init(list: [URL]) {
26+
self.list = list
27+
}
28+
29+
func listFilesURLs() throws -> [URL] {
30+
list
31+
}
32+
33+
func canRead() -> Bool {
34+
true
35+
}
36+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
// Copyright (c) 2023 Spotify AB.
2+
//
3+
// Licensed to the Apache Software Foundation (ASF) under one
4+
// or more contributor license agreements. See the NOTICE file
5+
// distributed with this work for additional information
6+
// regarding copyright ownership. The ASF licenses this file
7+
// to you under the Apache License, Version 2.0 (the
8+
// "License"); you may not use this file except in compliance
9+
// with the License. You may obtain a copy of the License at
10+
//
11+
// http://www.apache.org/licenses/LICENSE-2.0
12+
//
13+
// Unless required by applicable law or agreed to in writing,
14+
// software distributed under the License is distributed on an
15+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16+
// KIND, either express or implied. See the License for the
17+
// specific language governing permissions and limitations
18+
// under the License.
19+
20+
@testable import XCRemoteCache
21+
import XCTest
22+
23+
class StaticFileListReaderTests: XCTestCase {
24+
func testCanAlwaysRead() throws {
25+
let reader = StaticFileListReader(list: [])
26+
27+
XCTAssertTrue(reader.canRead())
28+
}
29+
30+
func testListsPassedUrls() throws {
31+
let url: URL = "/file"
32+
let reader = StaticFileListReader(list: [url])
33+
34+
XCTAssertEqual(try reader.listFilesURLs(), [url])
35+
}
36+
}

0 commit comments

Comments
 (0)