Skip to content

[Vertex AI] Enable AccessLevelOnImport and InternalImportsByDefault #14639

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions FirebaseVertexAI.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ Firebase SDK.
s.dependency 'FirebaseCore', '~> 11.12.0'
s.dependency 'FirebaseCoreExtension', '~> 11.12.0'

s.pod_target_xcconfig = {
'SWIFT_UPCOMING_FEATURE_INTERNAL_IMPORTS_BY_DEFAULT' => 'YES',
}

s.test_spec 'unit' do |unit_tests|
unit_tests_dir = 'FirebaseVertexAI/Tests/Unit/'
unit_tests.scheme = { :code_coverage => true }
Expand Down
2 changes: 1 addition & 1 deletion FirebaseVertexAI/Sources/GenerateContentResponse.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

import Foundation
public import Foundation

/// The model's response to a generate content request.
@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *)
Expand Down
2 changes: 1 addition & 1 deletion FirebaseVertexAI/Sources/GenerativeAIRequest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

import Foundation
public import Foundation

@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *)
protocol GenerativeAIRequest: Sendable, Encodable {
Expand Down
10 changes: 8 additions & 2 deletions FirebaseVertexAI/Sources/PartsRepresentable+Image.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,17 @@
// See the License for the specific language governing permissions and
// limitations under the License.

import CoreGraphics
import UniformTypeIdentifiers

#if canImport(UIKit)
import UIKit // For UIImage extensions.
public import UIKit // For UIImage extensions.
#elseif canImport(AppKit)
import AppKit // For NSImage extensions.
public import AppKit // For NSImage extensions.
#endif

#if canImport(CoreImage)
import CoreImage
#endif

private let imageCompressionQuality: CGFloat = 0.8
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

import Foundation
public import Foundation

/// An error that occurs when image generation fails due to all generated images being blocked.
///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

import Foundation
public import Foundation

/// An image generated by Imagen, represented as inline data.
@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *)
Expand Down
2 changes: 1 addition & 1 deletion FirebaseVertexAI/Sources/Types/Public/Part.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

import Foundation
public import Foundation

/// A discrete piece of data in a media format interpretable by an AI model.
///
Expand Down
5 changes: 2 additions & 3 deletions FirebaseVertexAI/Sources/VertexAI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,10 @@

import FirebaseAppCheckInterop
import FirebaseAuthInterop
import FirebaseCore
import FirebaseCoreExtension
import Foundation

// Avoids exposing internal FirebaseCore APIs to Swift users.
@_implementationOnly import FirebaseCoreExtension
public import FirebaseCore

/// The Vertex AI for Firebase SDK provides access to Gemini models directly from your app.
@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *)
Expand Down
3 changes: 1 addition & 2 deletions FirebaseVertexAI/Sources/VertexLog.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.

import FirebaseCoreExtension
import Foundation
import os.log

@_implementationOnly import FirebaseCoreExtension

enum VertexLog {
/// Log message codes for the Vertex AI SDK
///
Expand Down
6 changes: 3 additions & 3 deletions FirebaseVertexAI/Tests/Unit/GenerativeModelTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@
import FirebaseAppCheckInterop
import FirebaseAuthInterop
import FirebaseCore
import FirebaseVertexAI
import XCTest

@testable import FirebaseVertexAI
@testable import struct FirebaseVertexAI.APIConfig

@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *)
final class GenerativeModelTests: XCTestCase {
Expand Down Expand Up @@ -1689,9 +1690,8 @@
struct AppCheckErrorFake: Error {}

@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *)
extension SafetyRating: Swift.Comparable {

Check failure on line 1693 in FirebaseVertexAI/Tests/Unit/GenerativeModelTests.swift

View workflow job for this annotation

GitHub Actions / spm-unit (macos-15, Xcode_16.2, tvOS)

cannot use struct 'SafetyRating' in an extension with public or '@usableFromInline' members; 'FirebaseVertexAI' was not imported publicly

Check failure on line 1693 in FirebaseVertexAI/Tests/Unit/GenerativeModelTests.swift

View workflow job for this annotation

GitHub Actions / spm-unit (macos-15, Xcode_16.2, tvOS)

cannot use struct 'SafetyRating' in an extension with public or '@usableFromInline' members; 'FirebaseVertexAI' was not imported publicly

Check failure on line 1693 in FirebaseVertexAI/Tests/Unit/GenerativeModelTests.swift

View workflow job for this annotation

GitHub Actions / spm-unit (macos-15, Xcode_16.2, tvOS)

cannot use struct 'SafetyRating' in an extension with public or '@usableFromInline' members; 'FirebaseVertexAI' was not imported publicly

Check failure on line 1693 in FirebaseVertexAI/Tests/Unit/GenerativeModelTests.swift

View workflow job for this annotation

GitHub Actions / spm-unit (macos-15, Xcode_16.2, tvOS)

cannot use struct 'SafetyRating' in an extension with public or '@usableFromInline' members; 'FirebaseVertexAI' was not imported publicly

Check failure on line 1693 in FirebaseVertexAI/Tests/Unit/GenerativeModelTests.swift

View workflow job for this annotation

GitHub Actions / spm-unit (macos-15, Xcode_16.2, visionOS)

cannot use struct 'SafetyRating' in an extension with public or '@usableFromInline' members; 'FirebaseVertexAI' was not imported publicly

Check failure on line 1693 in FirebaseVertexAI/Tests/Unit/GenerativeModelTests.swift

View workflow job for this annotation

GitHub Actions / spm-unit (macos-15, Xcode_16.2, visionOS)

cannot use struct 'SafetyRating' in an extension with public or '@usableFromInline' members; 'FirebaseVertexAI' was not imported publicly

Check failure on line 1693 in FirebaseVertexAI/Tests/Unit/GenerativeModelTests.swift

View workflow job for this annotation

GitHub Actions / spm-unit (macos-15, Xcode_16.2, visionOS)

cannot use struct 'SafetyRating' in an extension with public or '@usableFromInline' members; 'FirebaseVertexAI' was not imported publicly

Check failure on line 1693 in FirebaseVertexAI/Tests/Unit/GenerativeModelTests.swift

View workflow job for this annotation

GitHub Actions / spm-unit (macos-15, Xcode_16.2, macOS)

cannot use struct 'SafetyRating' in an extension with public or '@usableFromInline' members; 'FirebaseVertexAI' was not imported publicly

Check failure on line 1693 in FirebaseVertexAI/Tests/Unit/GenerativeModelTests.swift

View workflow job for this annotation

GitHub Actions / spm-unit (macos-15, Xcode_16.2, iOS)

cannot use struct 'SafetyRating' in an extension with public or '@usableFromInline' members; 'FirebaseVertexAI' was not imported publicly

Check failure on line 1693 in FirebaseVertexAI/Tests/Unit/GenerativeModelTests.swift

View workflow job for this annotation

GitHub Actions / spm-unit (macos-15, Xcode_16.2, macOS)

cannot use struct 'SafetyRating' in an extension with public or '@usableFromInline' members; 'FirebaseVertexAI' was not imported publicly

Check failure on line 1693 in FirebaseVertexAI/Tests/Unit/GenerativeModelTests.swift

View workflow job for this annotation

GitHub Actions / spm-unit (macos-15, Xcode_16.2, iOS)

cannot use struct 'SafetyRating' in an extension with public or '@usableFromInline' members; 'FirebaseVertexAI' was not imported publicly

Check failure on line 1693 in FirebaseVertexAI/Tests/Unit/GenerativeModelTests.swift

View workflow job for this annotation

GitHub Actions / spm-unit (macos-15, Xcode_16.2, macOS)

cannot use struct 'SafetyRating' in an extension with public or '@usableFromInline' members; 'FirebaseVertexAI' was not imported publicly

Check failure on line 1693 in FirebaseVertexAI/Tests/Unit/GenerativeModelTests.swift

View workflow job for this annotation

GitHub Actions / spm-unit (macos-15, Xcode_16.2, iOS)

cannot use struct 'SafetyRating' in an extension with public or '@usableFromInline' members; 'FirebaseVertexAI' was not imported publicly

Check failure on line 1693 in FirebaseVertexAI/Tests/Unit/GenerativeModelTests.swift

View workflow job for this annotation

GitHub Actions / spm-unit (macos-15, Xcode_16.2, macOS)

cannot use struct 'SafetyRating' in an extension with public or '@usableFromInline' members; 'FirebaseVertexAI' was not imported publicly

Check failure on line 1693 in FirebaseVertexAI/Tests/Unit/GenerativeModelTests.swift

View workflow job for this annotation

GitHub Actions / spm-unit (macos-15, Xcode_16.2, iOS)

cannot use struct 'SafetyRating' in an extension with public or '@usableFromInline' members; 'FirebaseVertexAI' was not imported publicly

Check failure on line 1693 in FirebaseVertexAI/Tests/Unit/GenerativeModelTests.swift

View workflow job for this annotation

GitHub Actions / spm-unit (macos-15, Xcode_16.2, iOS)

cannot use struct 'SafetyRating' in an extension with public or '@usableFromInline' members; 'FirebaseVertexAI' was not imported publicly

Check failure on line 1693 in FirebaseVertexAI/Tests/Unit/GenerativeModelTests.swift

View workflow job for this annotation

GitHub Actions / spm-unit (macos-15, Xcode_16.2, watchOS)

cannot use struct 'SafetyRating' in an extension with public or '@usableFromInline' members; 'FirebaseVertexAI' was not imported publicly

Check failure on line 1693 in FirebaseVertexAI/Tests/Unit/GenerativeModelTests.swift

View workflow job for this annotation

GitHub Actions / spm-unit (macos-15, Xcode_16.2, watchOS)

cannot use struct 'SafetyRating' in an extension with public or '@usableFromInline' members; 'FirebaseVertexAI' was not imported publicly

Check failure on line 1693 in FirebaseVertexAI/Tests/Unit/GenerativeModelTests.swift

View workflow job for this annotation

GitHub Actions / spm-unit (macos-15, Xcode_16.2, watchOS)

cannot use struct 'SafetyRating' in an extension with public or '@usableFromInline' members; 'FirebaseVertexAI' was not imported publicly

Check failure on line 1693 in FirebaseVertexAI/Tests/Unit/GenerativeModelTests.swift

View workflow job for this annotation

GitHub Actions / spm-unit (macos-15, Xcode_16.2, catalyst)

cannot use struct 'SafetyRating' in an extension with public or '@usableFromInline' members; 'FirebaseVertexAI' was not imported publicly

Check failure on line 1693 in FirebaseVertexAI/Tests/Unit/GenerativeModelTests.swift

View workflow job for this annotation

GitHub Actions / spm-unit (macos-15, Xcode_16.2, catalyst)

cannot use struct 'SafetyRating' in an extension with public or '@usableFromInline' members; 'FirebaseVertexAI' was not imported publicly

Check failure on line 1693 in FirebaseVertexAI/Tests/Unit/GenerativeModelTests.swift

View workflow job for this annotation

GitHub Actions / spm-unit (macos-15, Xcode_16.2, catalyst)

cannot use struct 'SafetyRating' in an extension with public or '@usableFromInline' members; 'FirebaseVertexAI' was not imported publicly

Check failure on line 1693 in FirebaseVertexAI/Tests/Unit/GenerativeModelTests.swift

View workflow job for this annotation

GitHub Actions / spm-unit (macos-14, Xcode_16.2, iOS)

cannot use struct 'SafetyRating' in an extension with public or '@usableFromInline' members; 'FirebaseVertexAI' was not imported publicly

Check failure on line 1693 in FirebaseVertexAI/Tests/Unit/GenerativeModelTests.swift

View workflow job for this annotation

GitHub Actions / spm-unit (macos-14, Xcode_16.2, iOS)

cannot use struct 'SafetyRating' in an extension with public or '@usableFromInline' members; 'FirebaseVertexAI' was not imported publicly

Check failure on line 1693 in FirebaseVertexAI/Tests/Unit/GenerativeModelTests.swift

View workflow job for this annotation

GitHub Actions / spm-unit (macos-14, Xcode_16.2, iOS)

cannot use struct 'SafetyRating' in an extension with public or '@usableFromInline' members; 'FirebaseVertexAI' was not imported publicly

Check failure on line 1693 in FirebaseVertexAI/Tests/Unit/GenerativeModelTests.swift

View workflow job for this annotation

GitHub Actions / spm-unit (macos-14, Xcode_16.2, iOS)

cannot use struct 'SafetyRating' in an extension with public or '@usableFromInline' members; 'FirebaseVertexAI' was not imported publicly

Check failure on line 1693 in FirebaseVertexAI/Tests/Unit/GenerativeModelTests.swift

View workflow job for this annotation

GitHub Actions / spm-unit (macos-14, Xcode_16.2, iOS)

cannot use struct 'SafetyRating' in an extension with public or '@usableFromInline' members; 'FirebaseVertexAI' was not imported publicly

Check failure on line 1693 in FirebaseVertexAI/Tests/Unit/GenerativeModelTests.swift

View workflow job for this annotation

GitHub Actions / swift-build-run (macos-15, Xcode_16.2, spm)

cannot use struct 'SafetyRating' in an extension with public or '@usableFromInline' members; 'FirebaseVertexAI' was not imported publicly

Check failure on line 1693 in FirebaseVertexAI/Tests/Unit/GenerativeModelTests.swift

View workflow job for this annotation

GitHub Actions / swift-build-run (macos-15, Xcode_16.2, spm)

cannot use struct 'SafetyRating' in an extension with public or '@usableFromInline' members; 'FirebaseVertexAI' was not imported publicly

Check failure on line 1693 in FirebaseVertexAI/Tests/Unit/GenerativeModelTests.swift

View workflow job for this annotation

GitHub Actions / swift-build-run (macos-15, Xcode_16.2, spm)

cannot use struct 'SafetyRating' in an extension with public or '@usableFromInline' members; 'FirebaseVertexAI' was not imported publicly

Check failure on line 1693 in FirebaseVertexAI/Tests/Unit/GenerativeModelTests.swift

View workflow job for this annotation

GitHub Actions / swift-build-run (macos-14, Xcode_16.2, spm)

cannot use struct 'SafetyRating' in an extension with public or '@usableFromInline' members; 'FirebaseVertexAI' was not imported publicly

Check failure on line 1693 in FirebaseVertexAI/Tests/Unit/GenerativeModelTests.swift

View workflow job for this annotation

GitHub Actions / swift-build-run (macos-14, Xcode_16.2, spm)

cannot use struct 'SafetyRating' in an extension with public or '@usableFromInline' members; 'FirebaseVertexAI' was not imported publicly

Check failure on line 1693 in FirebaseVertexAI/Tests/Unit/GenerativeModelTests.swift

View workflow job for this annotation

GitHub Actions / swift-build-run (macos-14, Xcode_16.2, spm)

cannot use struct 'SafetyRating' in an extension with public or '@usableFromInline' members; 'FirebaseVertexAI' was not imported publicly
public static func < (lhs: FirebaseVertexAI.SafetyRating,
rhs: FirebaseVertexAI.SafetyRating) -> Bool {
public static func < (lhs: SafetyRating, rhs: SafetyRating) -> Bool {

Check failure on line 1694 in FirebaseVertexAI/Tests/Unit/GenerativeModelTests.swift

View workflow job for this annotation

GitHub Actions / spm-unit (macos-15, Xcode_16.2, tvOS)

method cannot be declared public because its parameter uses an internal type

Check failure on line 1694 in FirebaseVertexAI/Tests/Unit/GenerativeModelTests.swift

View workflow job for this annotation

GitHub Actions / spm-unit (macos-15, Xcode_16.2, tvOS)

method cannot be declared public because its parameter uses an internal type

Check failure on line 1694 in FirebaseVertexAI/Tests/Unit/GenerativeModelTests.swift

View workflow job for this annotation

GitHub Actions / spm-unit (macos-15, Xcode_16.2, tvOS)

method cannot be declared public because its parameter uses an internal type

Check failure on line 1694 in FirebaseVertexAI/Tests/Unit/GenerativeModelTests.swift

View workflow job for this annotation

GitHub Actions / spm-unit (macos-15, Xcode_16.2, tvOS)

method cannot be declared public because its parameter uses an internal type

Check failure on line 1694 in FirebaseVertexAI/Tests/Unit/GenerativeModelTests.swift

View workflow job for this annotation

GitHub Actions / spm-unit (macos-15, Xcode_16.2, visionOS)

method cannot be declared public because its parameter uses an internal type

Check failure on line 1694 in FirebaseVertexAI/Tests/Unit/GenerativeModelTests.swift

View workflow job for this annotation

GitHub Actions / spm-unit (macos-15, Xcode_16.2, visionOS)

method cannot be declared public because its parameter uses an internal type

Check failure on line 1694 in FirebaseVertexAI/Tests/Unit/GenerativeModelTests.swift

View workflow job for this annotation

GitHub Actions / spm-unit (macos-15, Xcode_16.2, visionOS)

method cannot be declared public because its parameter uses an internal type

Check failure on line 1694 in FirebaseVertexAI/Tests/Unit/GenerativeModelTests.swift

View workflow job for this annotation

GitHub Actions / spm-unit (macos-15, Xcode_16.2, macOS)

method cannot be declared public because its parameter uses an internal type

Check failure on line 1694 in FirebaseVertexAI/Tests/Unit/GenerativeModelTests.swift

View workflow job for this annotation

GitHub Actions / spm-unit (macos-15, Xcode_16.2, iOS)

method cannot be declared public because its parameter uses an internal type

Check failure on line 1694 in FirebaseVertexAI/Tests/Unit/GenerativeModelTests.swift

View workflow job for this annotation

GitHub Actions / spm-unit (macos-15, Xcode_16.2, macOS)

method cannot be declared public because its parameter uses an internal type

Check failure on line 1694 in FirebaseVertexAI/Tests/Unit/GenerativeModelTests.swift

View workflow job for this annotation

GitHub Actions / spm-unit (macos-15, Xcode_16.2, iOS)

method cannot be declared public because its parameter uses an internal type

Check failure on line 1694 in FirebaseVertexAI/Tests/Unit/GenerativeModelTests.swift

View workflow job for this annotation

GitHub Actions / spm-unit (macos-15, Xcode_16.2, macOS)

method cannot be declared public because its parameter uses an internal type

Check failure on line 1694 in FirebaseVertexAI/Tests/Unit/GenerativeModelTests.swift

View workflow job for this annotation

GitHub Actions / spm-unit (macos-15, Xcode_16.2, iOS)

method cannot be declared public because its parameter uses an internal type

Check failure on line 1694 in FirebaseVertexAI/Tests/Unit/GenerativeModelTests.swift

View workflow job for this annotation

GitHub Actions / spm-unit (macos-15, Xcode_16.2, macOS)

method cannot be declared public because its parameter uses an internal type

Check failure on line 1694 in FirebaseVertexAI/Tests/Unit/GenerativeModelTests.swift

View workflow job for this annotation

GitHub Actions / spm-unit (macos-15, Xcode_16.2, iOS)

method cannot be declared public because its parameter uses an internal type

Check failure on line 1694 in FirebaseVertexAI/Tests/Unit/GenerativeModelTests.swift

View workflow job for this annotation

GitHub Actions / spm-unit (macos-15, Xcode_16.2, iOS)

method cannot be declared public because its parameter uses an internal type

Check failure on line 1694 in FirebaseVertexAI/Tests/Unit/GenerativeModelTests.swift

View workflow job for this annotation

GitHub Actions / spm-unit (macos-15, Xcode_16.2, watchOS)

method cannot be declared public because its parameter uses an internal type

Check failure on line 1694 in FirebaseVertexAI/Tests/Unit/GenerativeModelTests.swift

View workflow job for this annotation

GitHub Actions / spm-unit (macos-15, Xcode_16.2, watchOS)

method cannot be declared public because its parameter uses an internal type

Check failure on line 1694 in FirebaseVertexAI/Tests/Unit/GenerativeModelTests.swift

View workflow job for this annotation

GitHub Actions / spm-unit (macos-15, Xcode_16.2, watchOS)

method cannot be declared public because its parameter uses an internal type

Check failure on line 1694 in FirebaseVertexAI/Tests/Unit/GenerativeModelTests.swift

View workflow job for this annotation

GitHub Actions / spm-unit (macos-15, Xcode_16.2, catalyst)

method cannot be declared public because its parameter uses an internal type

Check failure on line 1694 in FirebaseVertexAI/Tests/Unit/GenerativeModelTests.swift

View workflow job for this annotation

GitHub Actions / spm-unit (macos-15, Xcode_16.2, catalyst)

method cannot be declared public because its parameter uses an internal type

Check failure on line 1694 in FirebaseVertexAI/Tests/Unit/GenerativeModelTests.swift

View workflow job for this annotation

GitHub Actions / spm-unit (macos-15, Xcode_16.2, catalyst)

method cannot be declared public because its parameter uses an internal type

Check failure on line 1694 in FirebaseVertexAI/Tests/Unit/GenerativeModelTests.swift

View workflow job for this annotation

GitHub Actions / spm-unit (macos-14, Xcode_16.2, iOS)

method cannot be declared public because its parameter uses an internal type

Check failure on line 1694 in FirebaseVertexAI/Tests/Unit/GenerativeModelTests.swift

View workflow job for this annotation

GitHub Actions / spm-unit (macos-14, Xcode_16.2, iOS)

method cannot be declared public because its parameter uses an internal type

Check failure on line 1694 in FirebaseVertexAI/Tests/Unit/GenerativeModelTests.swift

View workflow job for this annotation

GitHub Actions / spm-unit (macos-14, Xcode_16.2, iOS)

method cannot be declared public because its parameter uses an internal type

Check failure on line 1694 in FirebaseVertexAI/Tests/Unit/GenerativeModelTests.swift

View workflow job for this annotation

GitHub Actions / spm-unit (macos-14, Xcode_16.2, iOS)

method cannot be declared public because its parameter uses an internal type

Check failure on line 1694 in FirebaseVertexAI/Tests/Unit/GenerativeModelTests.swift

View workflow job for this annotation

GitHub Actions / spm-unit (macos-14, Xcode_16.2, iOS)

method cannot be declared public because its parameter uses an internal type

Check failure on line 1694 in FirebaseVertexAI/Tests/Unit/GenerativeModelTests.swift

View workflow job for this annotation

GitHub Actions / swift-build-run (macos-15, Xcode_16.2, spm)

method cannot be declared public because its parameter uses an internal type

Check failure on line 1694 in FirebaseVertexAI/Tests/Unit/GenerativeModelTests.swift

View workflow job for this annotation

GitHub Actions / swift-build-run (macos-15, Xcode_16.2, spm)

method cannot be declared public because its parameter uses an internal type

Check failure on line 1694 in FirebaseVertexAI/Tests/Unit/GenerativeModelTests.swift

View workflow job for this annotation

GitHub Actions / swift-build-run (macos-15, Xcode_16.2, spm)

method cannot be declared public because its parameter uses an internal type

Check failure on line 1694 in FirebaseVertexAI/Tests/Unit/GenerativeModelTests.swift

View workflow job for this annotation

GitHub Actions / swift-build-run (macos-14, Xcode_16.2, spm)

method cannot be declared public because its parameter uses an internal type

Check failure on line 1694 in FirebaseVertexAI/Tests/Unit/GenerativeModelTests.swift

View workflow job for this annotation

GitHub Actions / swift-build-run (macos-14, Xcode_16.2, spm)

method cannot be declared public because its parameter uses an internal type

Check failure on line 1694 in FirebaseVertexAI/Tests/Unit/GenerativeModelTests.swift

View workflow job for this annotation

GitHub Actions / swift-build-run (macos-14, Xcode_16.2, spm)

method cannot be declared public because its parameter uses an internal type
return lhs.category.rawValue < rhs.category.rawValue
}
}
6 changes: 3 additions & 3 deletions FirebaseVertexAI/Tests/Unit/VertexComponentTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
// limitations under the License.

@preconcurrency import FirebaseCore
import FirebaseCoreExtension
import FirebaseVertexAI
import Foundation
import XCTest

@_implementationOnly import FirebaseCoreExtension

@testable import FirebaseVertexAI
@testable import struct FirebaseVertexAI.APIConfig

@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *)
class VertexComponentTests: XCTestCase {
Expand Down
8 changes: 7 additions & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1308,7 +1308,10 @@ let package = Package(
"FirebaseCore",
"FirebaseCoreExtension",
],
path: "FirebaseVertexAI/Sources"
path: "FirebaseVertexAI/Sources",
swiftSettings: [
.enableUpcomingFeature("InternalImportsByDefault"),
]
),
.testTarget(
name: "FirebaseVertexAIUnit",
Expand All @@ -1323,6 +1326,9 @@ let package = Package(
],
cSettings: [
.headerSearchPath("../../../"),
],
swiftSettings: [
.enableUpcomingFeature("InternalImportsByDefault"),
]
),
] + firestoreTargets(),
Expand Down
6 changes: 5 additions & 1 deletion scripts/check_imports.swift
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,11 @@ private func checkFile(_ file: String, logger: ErrorLogger, inRepo repoURL: URL,
// Swift specific checks.
fileContents.components(separatedBy: .newlines)
.enumerated() // [(lineNum, line), ...]
.filter { $1.starts(with: "import FirebaseCoreExtension") }
.filter {
$1.starts(with: "import FirebaseCoreExtension")
/* FirebaseVertexAI is using `InternalImportsByDefault` so its files are not checked. */
&& !file.contains("FirebaseVertexAI")
}
.forEach { lineNum, line in
logger
.importLog(
Expand Down
Loading