You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
swift build (Apple Swift Package Manager - Swift 4.0.0-dev (swiftpm-13502)) fails on macos High Sierra from the command line with the following error:
Compile Swift Module 'EnergyFinanceAnalysis' (1 sources) Compile Swift Module 'OffshoreWindAnalysis' (2 sources) /Users/greg/Dropbox/common_files/Programming/Swift/commercial/EnergyAnalysis/OffshoreWindAnalysis/Sources/OffshoreWindAnalysis/OffshoreWindAnalysis.swift:32:25: error: use of undeclared type 'EnergyFinanceAnalysis' var energyAnalysis: EnergyFinanceAnalysis ^ /Users/greg/Dropbox/common_files/Programming/Swift/commercial/EnergyAnalysis/OffshoreWindAnalysis/Sources/OffshoreWindAnalysis/OffshoreWindAnalysis.swift:32:25: note: cannot use module 'EnergyFinanceAnalysis' as a type var energyAnalysis: EnergyFinanceAnalysis ^ (with more of a similar nature)
I have a main project OffshoreWindAnalysis which depends on EnergyFinanceAnalysis, a library module. Swift appears to find and compile that module located in a parallel directory, but then swift does not appear to use it.
I have the Package.swift for the main project:
// swift-tools-version:4.0 // The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
let package = Package( name: "OffshoreWindAnalysis", products: [ .executable(name: "OffshoreWindAnalysis", targets: ["OffshoreWindAnalysis"]), ], dependencies: [ // Dependencies declare other packages that this package depends on. .package(url: "../EnergyFinanceAnalysis", from: "1.0.0"), ], targets: [ // Targets are the basic building blocks of a package. A target can define a module or a test suite. // Targets can depend on other targets in this package, and on products in packages which this package depends on. .target( name: "OffshoreWindAnalysis", dependencies: ["EnergyFinanceAnalysis"]), .testTarget( name: "OffshoreWindAnalysisTests", dependencies: ["OffshoreWindAnalysis"]), ] )
I have the following Package.swift for the library module:
// swift-tools-version:4.0
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
let package = Package( name: "EnergyFinanceAnalysis", products: [ // Products define the executables and libraries produced by a package, and make them visible to other packages. .library( name: "EnergyFinanceAnalysis", targets: ["EnergyFinanceAnalysis"]), ], dependencies: [ // Dependencies declare other packages that this package depends on. .package(url: "../CIRRCalc", from: "1.0.0"), ], targets: [ // Targets are the basic building blocks of a package. A target can define a module or a test suite. // Targets can depend on other targets in this package, and on products in packages which this package depends on. .target( name: "EnergyFinanceAnalysis", dependencies: ["CIRRCalc"]), .testTarget( name: "EnergyFinanceAnalysisTests", dependencies: ["EnergyFinanceAnalysis"]), ] )
I import EnergyFinanceAnalysis in the appropriate source file for the main project where it is used.
If I do swift package generate-xcodeproj and then try to compile it also fails. In xcode I can remedy it by having the included dependency source file for EnergyFinanceAnalysis added to the target for OffshoreWindAnalysis. But I should be able to do this from the command line completely.
The text was updated successfully, but these errors were encountered:
Attachment: Download
Additional Detail from JIRA
md5: 23dd1cf8e45237f5f3ecaacdb27e97e8
Issue Description:
swift build (Apple Swift Package Manager - Swift 4.0.0-dev (swiftpm-13502)) fails on macos High Sierra from the command line with the following error:
Compile Swift Module 'EnergyFinanceAnalysis' (1 sources)
Compile Swift Module 'OffshoreWindAnalysis' (2 sources)
/Users/greg/Dropbox/common_files/Programming/Swift/commercial/EnergyAnalysis/OffshoreWindAnalysis/Sources/OffshoreWindAnalysis/OffshoreWindAnalysis.swift:32:25: error: use of undeclared type 'EnergyFinanceAnalysis'
var energyAnalysis: EnergyFinanceAnalysis
^
/Users/greg/Dropbox/common_files/Programming/Swift/commercial/EnergyAnalysis/OffshoreWindAnalysis/Sources/OffshoreWindAnalysis/OffshoreWindAnalysis.swift:32:25: note: cannot use module 'EnergyFinanceAnalysis' as a type
var energyAnalysis: EnergyFinanceAnalysis
^
(with more of a similar nature)
I have a main project OffshoreWindAnalysis which depends on EnergyFinanceAnalysis, a library module. Swift appears to find and compile that module located in a parallel directory, but then swift does not appear to use it.
I have the Package.swift for the main project:
// swift-tools-version:4.0
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
let package = Package(
name: "OffshoreWindAnalysis",
products: [
.executable(name: "OffshoreWindAnalysis",
targets: ["OffshoreWindAnalysis"]),
],
dependencies: [
// Dependencies declare other packages that this package depends on.
.package(url: "../EnergyFinanceAnalysis", from: "1.0.0"),
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
// Targets can depend on other targets in this package, and on products in packages which this package depends on.
.target(
name: "OffshoreWindAnalysis",
dependencies: ["EnergyFinanceAnalysis"]),
.testTarget(
name: "OffshoreWindAnalysisTests",
dependencies: ["OffshoreWindAnalysis"]),
]
)
I have the following Package.swift for the library module:
// swift-tools-version:4.0
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
let package = Package(
name: "EnergyFinanceAnalysis",
products: [
// Products define the executables and libraries produced by a package, and make them visible to other packages.
.library(
name: "EnergyFinanceAnalysis",
targets: ["EnergyFinanceAnalysis"]),
],
dependencies: [
// Dependencies declare other packages that this package depends on.
.package(url: "../CIRRCalc", from: "1.0.0"),
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
// Targets can depend on other targets in this package, and on products in packages which this package depends on.
.target(
name: "EnergyFinanceAnalysis",
dependencies: ["CIRRCalc"]),
.testTarget(
name: "EnergyFinanceAnalysisTests",
dependencies: ["EnergyFinanceAnalysis"]),
]
)
I import EnergyFinanceAnalysis in the appropriate source file for the main project where it is used.
If I do swift package generate-xcodeproj and then try to compile it also fails. In xcode I can remedy it by having the included dependency source file for EnergyFinanceAnalysis added to the target for OffshoreWindAnalysis. But I should be able to do this from the command line completely.
The text was updated successfully, but these errors were encountered: