swiftlang/swift-java

Xcode integration broken

Opened this issue · 3 comments

This might be more about Xcode's plugin support for generated files, but when building with Xcode I'm getting this error:

error: Build input file cannot be found: '~/Library/Developer/Xcode/DerivedData/xls-awobgocixipoyadtahkpiowejftk/Build/Products/Debug/SwiftJavaTool'. Did you forget to declare this file as an output of a script phase or custom build rule which produces it? (in target 'xls_xls' from project 'xls')

Building on the command line works as expected, but I'd like to get autocompletion on a more comfortable IDE like Xcode.

It's a bit unclear to reproduce this, can you show your project setup or something?

We did just move to a build plugin which should make tracking files much easier for swiftpm and xcode so I'd expect this to have improved on main right now.

You'll need JDK24 and Swift 6.1.2

It's a bit unclear to reproduce this, can you show your project setup or something?

We did just move to a build plugin which should make tracking files much easier for swiftpm and xcode so I'd expect this to have improved on main right now.

You'll need JDK24 and Swift 6.1.2

Hi @ktoso , I’m also experiencing the same error when using Xcode to build JavaDependencySampleApp. When using the command line, it built successfully. The tool used in the command is swift-java. However, when building with Xcode, it uses SwiftJavaTool to resolve dependencies.

This is from command line output:

...
[info][swift-java] Run ResolveCommand: .build/arm64-apple-macosx/debug/swift-java resolve Sources/JavaCommonsCSV/swift-java.config --swift-module JavaCommonsCSV --output-directory .build/plugins/outputs/javadependencysampleapp/JavaCommonsCSV/destination/SwiftJavaPlugin/
....

and this is from Xcode:

' ~/Developer/Xcode/DerivedData/JavaDependencySampleApp-cmfgvenjvdqcpzazcggnsculdcps/Build/Products/Debug/SwiftJavaTool resolve --output-directory ~/Library/Developer/Xcode/DerivedData/JavaDependencySampleApp-cmfgvenjvdqcpzazcggnsculdcps/Build/Intermediates.noindex/BuildToolPluginIntermediates/javadependencysampleapp.output/JavaCommonsCSV/SwiftJavaPlugin/ --swift-module JavaCommonsCSV

error: Build input file cannot be found: '~/Library/Developer/Xcode/DerivedData/JavaDependencySampleApp-cmfgvenjvdqcpzazcggnsculdcps/Build/Products/Debug/SwiftJavaTool'. Did you forget to declare this file as an output of a script phase or custom build rule which produces it? (in target 'JavaCommonsCSV_JavaCommonsCSV' from project 'JavaCommonsCSV')

I'm on macOS 26.0 Beta (25A5349a) with:

  • swift-driver version: 1.127.14.1 Apple Swift version 6.2 (swiftlang-6.2.0.19.9 clang-1700.3.19.1)
    Target: arm64-apple-macosx26.0
  • java 24.0.1-amzn

I see, thanks for the additional info!