readdle / swift-java-codegen

Swift Java Codegeneration annotation processor
MIT License
31 stars 13 forks source link

PackageDescription not found in Package.swift #24

Open geertberkers opened 4 years ago

geertberkers commented 4 years ago

I am trying to opening and build the project. But I'm unable to get it building. Swift Toolchain version: swift-android-5.0-8

Screenshot 2020-01-22 12 29 06

And in https://github.com/readdle/swift-android-architecture I get the following errors:

> Task :app:swiftBuildArm64Debug FAILED
Swift PM flags: --configuration debug -Xswiftc -DDEBUG
/Users/geert/Projects/SwiftAndroid/swift-android-architecture/todoapp/app/src/main/swift: error: manifest parse error(s):
/Users/geert/Projects/SwiftAndroid/swift-android-architecture/todoapp/app/src/main/swift/Package.swift:55:15: error: 'init(name:pkgConfig:providers:products:dependencies:targets:swiftLanguageVersions:cLanguageStandard:cxxLanguageStandard:)' is unavailable
let package = Package(
              ^~~~~~~
PackageDescription.Package:27:12: note: 'init(name:pkgConfig:providers:products:dependencies:targets:swiftLanguageVersions:cLanguageStandard:cxxLanguageStandard:)' was introduced in PackageDescription 4.2
    public init(name: String, pkgConfig: String? = nil, providers: [PackageDescription.SystemPackageProvider]? = nil, products: [PackageDescription.Product] = [], dependencies: [PackageDescription.Package.Dependency] = [], targets: [PackageDescription.Target] = [], swiftLanguageVersions: [PackageDescription.SwiftVersion]? = nil, cLanguageStandard: PackageDescription.CLanguageStandard? = nil, cxxLanguageStandard: PackageDescription.CXXLanguageStandard? = nil)
           ^
/Users/geert/Projects/SwiftAndroid/swift-android-architecture/todoapp/app/src/main/swift/Package.swift:65:10: error: 'target(name:dependencies:path:exclude:sources:publicHeadersPath:)' is unavailable
        .target(name: packageName, dependencies: ["java_swift", "JavaCoder"])
         ^~~~~~
PackageDescription.Target:34:24: note: 'target(name:dependencies:path:exclude:sources:publicHeadersPath:)' was introduced in PackageDescription 4
    public static func target(name: String, dependencies: [PackageDescription.Target.Dependency] = [], path: String? = nil, exclude: [String] = [], sources: [String]? = nil, publicHeadersPath: String? = nil) -> PackageDescription.Target
                       ^
/Users/geert/Projects/SwiftAndroid/swift-android-architecture/todoapp/app/src/main/swift/Package.swift:41:10: error: 'target(name:dependencies:path:exclude:sources:publicHeadersPath:)' is unavailable
        .target(
         ^~~~~~
PackageDescription.Target:34:24: note: 'target(name:dependencies:path:exclude:sources:publicHeadersPath:)' was introduced in PackageDescription 4
    public static func target(name: String, dependencies: [PackageDescription.Target.Dependency] = [], path: String? = nil, exclude: [String] = [], sources: [String]? = nil, publicHeadersPath: String? = nil) -> PackageDescription.Target
                       ^

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:swiftBuildArm64Debug'.
> Process 'command '/Users/geert/android/swift-android-current/build-tools/1.9.6-swift5/swift-build'' finished with non-zero exit value 1

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 2s
andriydruk commented 4 years ago

Hi, please check that you have proper version swift from step 2/ https://github.com/readdle/swift-android-toolchain

Call swift --version in your terminal app

Apple Swift version 5.0.1 (swiftlang-1001.0.82.4 clang-1001.0.46.5)
Target: x86_64-apple-darwin19.0.0

You can check the proper setup in our CI script https://github.com/readdle/swift-java-codegen/pull/23

  - name: Install Swift toolchain 5.0.3 
 run: wget https://swift.org/builds/swift-5.0.3-release/xcode/swift-5.0.3-RELEASE/swift-5.0.3-RELEASE-osx.pkg;
   sudo installer -pkg swift-5.0.3-RELEASE-osx.pkg -target /