Configure IC to work with multiple projects.

25 views
Skip to first unread message

Brooks Johnson

unread,
Feb 19, 2024, 9:17:11 AMFeb 19
to Illuminated Cloud General Discussion
Hi Scott. I wanted to start breaking up some of my happy soup  projects into multiple unlocked packages. But  I am having some issues trying to make it all work. 

I. created a new IC project with a root directory of src/ 

Then I used the CLI and created two packages in src called core and car_hunter 

If I go to Configure Module and and check the project structure I see src listed under source folders. 

But when I start retrieving metadata from an org I get a directory structure using . rather than /

For example  'objects.Car__c.fields'.I have tried to just mkdir the directories from the CLI but still end up with this same behavior. 

I am wondering if missed a step in configuring IC for this. 

Screenshot 2024-02-19 at 9.13.56 AM.png
Screenshot 2024-02-19 at 9.16.15 AM.png
Screenshot 2024-02-19 at 9.13.28 AM.png

Scott Wells

unread,
Feb 19, 2024, 10:13:07 AMFeb 19
to Illuminated Cloud General Discussion, brooksjo...@gmail.com
Brooks, the "." you're seeing is a side-effect of IC2 being hosted in IntelliJ IDEA which is fundamentally designed for Java, and Java uses "." as a package component separator. The IDE shows the directory paths that correspond to package paths with ".", but those are really "/"s. You can disable a few Project View options to make it look more like you'd expect, e.g., Flatten Packages and Compact Middle Packages from here:

ProjectViewPackageOptions.png

Generally you'll want your project source root configuration to directly mimic your sfdx-project.json file's package directories, so you'd have a content root corresponding to the project root directory, and within that content root, you'd add each of the package directories as a source root.

Let me know if that doesn't make sense or if it's not working properly after you make these UI config and project config changes.

Regards,
Scott Wells

Brooks Johnson

unread,
Feb 19, 2024, 11:19:23 AMFeb 19
to Illuminated Cloud General Discussion, sc...@illuminatedcloud.com, Brooks Johnson
It seems to be working now. I am not sure why but before when I tried to add the package directories to the src content root I would get an error to the effect  that src/core could not intersect src. That seems to have stopped now. But not sure why.

Scott Wells

unread,
Feb 19, 2024, 11:22:16 AMFeb 19
to Illuminated Cloud General Discussion, brooksjo...@gmail.com, Scott Wells
My guess is that you had configured "src" as a source root and then were trying to configure descendants of "src" as source roots as well. You want it to be configured as follows:
  • /path/to/projectDir/ - content root
    • src/ - not a content root; not a source root; not a package directory in sfdx-project.json
      • src/core/ - source root
      • src/car_hunter/ - source root
      • etc.
Even looking at your sfdx-project.json, you still have "src" as a package directory. You'll want to remove that to avoid overlapping/intersecting package directories/source roots.

Regards,
Scott Wells
Reply all
Reply to author
Forward
0 new messages