Skip to content

Commit

Permalink
Merge pull request #44 from marinofelipe/felipe/updates
Browse files Browse the repository at this point in the history
Update to use SPM library
  • Loading branch information
marinofelipe authored Jan 16, 2024
2 parents 1d0c284 + 9321235 commit 5240e7b
Show file tree
Hide file tree
Showing 30 changed files with 1,254 additions and 3,245 deletions.
15 changes: 12 additions & 3 deletions .swiftpm/xcode/xcshareddata/xcschemes/swift-package-info.xcscheme
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
customWorkingDirectory = "/Users/marino.felipe/Documents/projects/personal/swift-package-info"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
Expand All @@ -190,15 +191,19 @@
</BuildableProductRunnable>
<CommandLineArguments>
<CommandLineArgument
argument = "--for https://github.com/ReactiveX/RxSwift"
argument = "--path https://github.com/firebase/firebase-ios-sdk.git"
isEnabled = "YES">
</CommandLineArgument>
<CommandLineArgument
argument = ""
isEnabled = "NO">
</CommandLineArgument>
<CommandLineArgument
argument = "-v 6.0.0"
isEnabled = "YES">
isEnabled = "NO">
</CommandLineArgument>
<CommandLineArgument
argument = "--product RxSwift"
argument = "--product &quot;FirebaseCrashlytics&quot;"
isEnabled = "YES">
</CommandLineArgument>
<CommandLineArgument
Expand All @@ -209,6 +214,10 @@
argument = "--verbose"
isEnabled = "YES">
</CommandLineArgument>
<CommandLineArgument
argument = "--report jsonDump"
isEnabled = "NO">
</CommandLineArgument>
</CommandLineArguments>
</LaunchAction>
<ProfileAction
Expand Down
226 changes: 108 additions & 118 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,129 +1,119 @@
// swift-tools-version:5.3
// swift-tools-version:5.7
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
name: "swift-package-info",
platforms: [
.macOS(.v10_15)
],
products: [
.executable(
name: "swift-package-info",
targets: [
"Run"
]
)
],
dependencies: [
.package(
url: "https://github.com/apple/swift-argument-parser",
.upToNextMinor(from: "1.2.1")
name: "swift-package-info",
platforms: [
.macOS(.v12)
],
products: [
.executable(
name: "swift-package-info",
targets: [
"Run"
]
)
],
dependencies: [
.package(
url: "https://github.com/apple/swift-argument-parser",
.upToNextMinor(from: "1.2.1")
),
.package(
url: "https://github.com/tuist/XcodeProj.git",
.upToNextMinor(from: "8.7.1")
),
.package(
url: "https://github.com/marinofelipe/http_client",
.upToNextMinor(from: "0.0.4")
),
// - For now pinned to the 5.9.2 release / Xcode 15.1
// It auto exports SwiftToolsSupport, so no need to directly depend on the former 🙏
.package(
url: "https://github.com/apple/swift-package-manager",
revision: "swift-5.9.2-RELEASE"
),
],
targets: [
.executableTarget(
name: "Run",
dependencies: [
.target(name: "App"),
.target(name: "Reports"),
.target(name: "Core"),
.product(
name: "ArgumentParser",
package: "swift-argument-parser"
),
.package(
url: "https://github.com/tuist/XcodeProj.git",
.upToNextMinor(from: "8.7.1")
]
),
.testTarget(
name: "RunTests",
dependencies: [
.target(name: "Run")
]
),
.target(
name: "App",
dependencies: [
.product(
name: "XcodeProj",
package: "XcodeProj"
),
.package(
url: "https://github.com/apple/swift-tools-support-core.git",
.upToNextMinor(from: "0.4.0")
.product(
name: "CombineHTTPClient",
package: "http_client"
),
.package(
name: "HTTPClient",
url: "https://github.com/marinofelipe/http_client",
.upToNextMinor(from: "0.0.4")
)
],
targets: [
.target(
name: "Run",
dependencies: [
.target(name: "App"),
.target(name: "Reports"),
.target(name: "Core"),
.product(
name: "ArgumentParser",
package: "swift-argument-parser"
),
.product(
name: "SwiftToolsSupport-auto",
package: "swift-tools-support-core"
)
]
.target(name: "Core")
]
),
.testTarget(
name: "AppTests",
dependencies: [
.target(name: "App"),
.target(name: "CoreTestSupport")
]
),
.target(
name: "Reports",
dependencies: [
.target(name: "Core")
]
),
.testTarget(
name: "ReportsTests",
dependencies: [
.target(name: "Reports"),
.target(name: "CoreTestSupport")
]
),
.target(
name: "Core",
dependencies: [
.product(
name: "ArgumentParser",
package: "swift-argument-parser"
),
.testTarget(
name: "RunTests",
dependencies: [
.target(name: "Run")
]
.product(
name: "SwiftPM",
package: "swift-package-manager"
),
.target(
name: "App",
dependencies: [
.product(
name: "XcodeProj",
package: "XcodeProj"
),
.product(
name: "CombineHTTPClient",
package: "HTTPClient"
),
.target(name: "Core")
]
),
.testTarget(
name: "AppTests",
dependencies: [
.target(name: "App"),
.target(name: "CoreTestSupport")
]
),
.target(
name: "Reports",
dependencies: [
.product(
name: "SwiftToolsSupport-auto",
package: "swift-tools-support-core"
),
.target(name: "Core")
]
),
.testTarget(
name: "ReportsTests",
dependencies: [
.target(name: "Reports"),
.target(name: "CoreTestSupport")
]
),
.target(
name: "Core",
dependencies: [
.product(
name: "ArgumentParser",
package: "swift-argument-parser"
),
.product(
name: "SwiftToolsSupport-auto",
package: "swift-tools-support-core"
)
]
),
.testTarget(
name: "CoreTests",
dependencies: [
.target(name: "Core"),
.target(name: "CoreTestSupport")
],
resources: [
.process("Resources")
]
),
.target(
name: "CoreTestSupport",
dependencies: [
.target(name: "Core")
]
)
]
]
),
.testTarget(
name: "CoreTests",
dependencies: [
.target(name: "Core"),
.target(name: "CoreTestSupport")
]
),
.target(
name: "CoreTestSupport",
dependencies: [
.target(name: "Core")
]
)
]
)
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,13 @@ enum BinarySizeProviderError: LocalizedError, Equatable {
public struct BinarySizeProvider {
public static func fetchInformation(
for swiftPackage: SwiftPackage,
packageContent: PackageContent,
package: PackageWrapper,
verbose: Bool
) -> Result<ProvidedInfo, InfoProviderError> {
let sizeMeasurer = defaultSizeMeasurer(verbose)
var binarySize: SizeOnDisk = .zero

let isProductDynamicLibrary = packageContent.products
let isProductDynamicLibrary = package.products
.first{ $0.name == swiftPackage.product }?
.isDynamicLibrary ?? false

Expand Down
Loading

0 comments on commit 5240e7b

Please sign in to comment.