vinivendra / Gryphon

The Swift to Kotlin translator.
https://vinivendra.github.io/Gryphon/
Other
609 stars 46 forks source link

Wrong file path in gryphonInputFiles.xcfilelist leads to script stuck #104

Closed batkov closed 3 years ago

batkov commented 3 years ago

If you will make a mistake while adding new file to gryphonInputFiles.xcfilelist script will stuck. Script failure is expected.

  1. Go to 'gryphonInputFiles.xcfilelist'
  2. Add new line 'MyApp/Sources/Model/WrongFolder/File.swift'
  3. Add new line 'MyApp/Sources/Model/WrongFolder/File.2swift'
  4. Run "Gryphon" build or run script manually through terminal
  5. See that script stuck instead of failure

    • OS: BigSur
    • Gryphon version: 0.14
MacBook-Pro:MyApp user$ gryphon "MyApp.xcodeproj" "MyApp/Supporting Files/gryphonInputFiles.xcfilelist" --verbose --continue-on-error
ℹī¸  Gryphon version 0.14
ℹī¸  SwiftSyntax version 5.4
🧑‍đŸ’ģ  Checking Xcode arguments...
    ℹī¸  Using default target.
    ℹī¸  Using Xcode project MyApp.xcodeproj.
✅  Done checking Xcode arguments.
🧑‍đŸ’ģ  Starting compilation...
    🧑‍đŸ’ģ  Parsing arguments...
        🔧  Using settings:
            ℹī¸  shouldEmitSwiftAST: false
            ℹī¸  shouldEmitRawAST: false
            ℹī¸  shouldEmitAST: false
            ℹī¸  shouldEmitKotlin: true
            ℹī¸  shouldGenerateKotlin: true
            ℹī¸  shouldGenerateAST: true
            ℹī¸  shouldGenerateRawAST: true
            ℹī¸  shouldGenerateSwiftAST: true
            ℹī¸  forcePrintingToConsole: false
            ℹī¸  quietModeIsOn: false
            ℹī¸  mainFilePath: no main file
            ℹī¸  xcodeProjectPath: MyApp.xcodeproj
        🔧  Settings done.
    ✅  Done parsing arguments.
    🧑‍đŸ’ģ  Processing the templates library...
        🧑‍đŸ’ģ  Calling SourceKit (expression types)...
            🛠  xcrun --show-sdk-path --sdk macosx
            Request with YAML:
            """{
              key.request: source.request.expression.type,
              key.compilerargs: [
                "/Users/user/Projects/myapp/MyApp/.gryphon/GryphonTemplatesLibrary.swift",
                "-sdk",
                "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk",
                "-D",
                "GRYPHON"
              ],
              key.sourcefile: "/Users/user/Projects/myapp/MyApp/.gryphon/GryphonTemplatesLibrary.swift"
            }"""
        ✅  Done calling SourceKit (expression types).
        🧑‍đŸ’ģ  Calling SourceKit (indexing)...
            ℹī¸  Request for file "/Users/user/Projects/myapp/MyApp/.gryphon/GryphonTemplatesLibrary.swift"
            ℹī¸  Request with compiler arguments: [
                "/Users/user/Projects/myapp/MyApp/.gryphon/GryphonTemplatesLibrary.swift",
                "-sdk",
                "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk",
                "-D",
                "GRYPHON",
            ]
        ✅  Done calling SourceKit (indexing).
        🧑‍đŸ’ģ  Calling SwiftSyntax...
        ✅  Done calling SwiftSyntax.
    ✅  Done processing the templates library.
    🧑‍đŸ’ģ Starting first part of translation [1/2]...
        🔀  Translating concurrently, logs may come out of order.
        🧑‍đŸ’ģ  Processing SwiftSyntax for MyApp/Sources/Model/OnboardingModel.swift...
        🧑‍đŸ’ģ  Processing SwiftSyntax for MyApp/Sources/Model/OnboardingModelFactory.swift...
vinivendra commented 3 years ago

Hey @batkov, sorry I closed this accidentally. I wasn't able to reproduce your problem but I added a check that should hopefully stop this from happening again. You can try it out with brew install vinivendra/gryphon/gryphon --HEAD or wait for the next release if you want to. If you do, please let me know if this fix worked :)

batkov commented 3 years ago

This one is fixed, thanks.

Screenshot 2021-06-06 at 00 24 55