Sourcery icon indicating copy to clipboard operation
Sourcery copied to clipboard

configuration: Linking to different path from output path

Open mlight3 opened this issue 4 years ago • 1 comments

My recent project's group hierarchy is not the same as actual folders. When I try to link my generated files to target, it created different folders and got errors.

Configuration

sources:
  - mytype/Sources
templates:
  - mytype/Sources/Sourcery/Templates
output:
  path: ./mytype/Sources/Sourcery/Generated
  link:
    project: mytype.xcodeproj
    target: mytype
    group: mytype/Sources/Sourcery/Generated

Group Hierarchy

  • mytype (Root Group)
    • Sourcery
      • Sourcery
        • Generated

Folder Hierarchy

  • mytype
    • Sources
      • Sourcery
        • Generated

mytype group location is mytype/Soucres

Problem

Sourcery generates a new group even if the root group is the same as the first group in the configuration group path. The first group from mytype/Sources/Sourcery/Generated is the same as root group: mytype. But sourcery creates new group for another mytype

Sourcery cannot handle if the group's location is not the same as the folder. My root group is mytype, but folder location is mytype/Sources.

mlight3 avatar Feb 15 '21 12:02 mlight3

hey @mlight3, can you provide a minimal sample project reproducing the issue?

also are you generating many files using extended annotations? if not then given your configuration might be simpler to just not link automatically since you are not really leveraging module integration at scanning level and just use output directory

krzysztofzablocki avatar Feb 15 '21 12:02 krzysztofzablocki