Make it easy to wrap an Illuminated Cloud project over the top of an existing codebase in source control

Issue #688 resolved
Corey Yeatman created an issue

We have a client who has their Salesforce metadata checked into git (i.e., basically the src/ folder with classes, pages, layouts, etc under it and a corresponding package.xml). This was all extracted from Salesforce with the <sf:retrieve> ant task.

Their devs have been using the developer console in Salesforce and text editors to work on their code, and when they have it done they copy it to their git repo and commit it.

I'm trying to move them across to use an IDE more, and in particular, Illuminated Cloud.

I was trying to find an "easy way" to effectively wrap an IntelliJ Idea Illuminated Cloud project over the top of the existing git repo. I basically wanted to create an Illuminated Cloud project in the same directory as the /src folder, pick or set up a connection, but then get it to use the existing /src folder and package xml rather than try to pull the metadata from Salesforce.

I've been trying out the "Create Project from existing sources" and it correctly recognises that the /src folder requires the Illuminated Cloud facet, and picks up on using the src/package.xml ... but then it seems to get lost, doesn't create a module, thinks there is "No SDK" specified, generating the offline symbol table for an SDK seems to freeze up or never complete.

Should it be possible to do it this way? Is there a "correct" way of doing it? Or is this something that needs to be fixed with the Illuminated Cloud plugin?

Comments (7)

  1. Scott Wells repo owner

    Corey, it should be pretty straightforward. Here are the steps to pull a project in from version control as a full-fledged IC project:

    1. Use File>New>Project from Version Control to start the new project wizard.
    2. Use IntelliJ's VCS client to pull the source from version control into your local file system.
    3. Once downloaded, allow IntelliJ to open the new project.
    4. You'll see a toaster popup saying "Invalid configuration for module 'moduleName'. It's also in the Event Log if you accidentally dismiss it.
    5. Expand the toaster by clicking on it, and it it will say that IC has detected the source as being for a Salesforce project and that it can take steps to convert it.
    6. Click the Resolve link in the toaster popup and IC will begin walking you through the process of importing/converting the project.
    7. The first step will be to associate the project with a connection. If you already have one for the org into which you want to deploy the metadata, choose it; if not, double-click on the row to open the connection manager and create a new one.
    8. As part of the resolution, IC will need to close and reopen the project to convert it into an IC project.
    9. Once reopened, you'll see the toaster popup again. Just click Resolve and it will walk you through the rest of the steps for importing/converting the project.
    10. The last step is offline symbol table generation. Once that completes, you shouldn't see the toaster popup any longer and your project from version control is fully ready to be used.

    It sounds like quite a bit, but it's basically a guided wizard. I just ran through it against an Apex public github repo and the full process took about 2-3 minutes.

    Let me know if this doesn't give you what you need.

  2. Scott Wells repo owner

    I'm going to resolve this for now, but if the described process doesn't work for you, or if you are seeing OST generation freezes when you follow this process (or really at any point), please reopen and attach your idea.log using Help>Show Log in Finder/Explorer/Files and I'll need to see why that's happening.

  3. Corey Yeatman reporter

    Hi Scott, thanks, sorry for not getting back to you - we will give it a go and see what happens. Cheers!

  4. Scott Wells repo owner

    Sounds good, Corey. Note that you can do the same thing with a project that's already been pulled from VCS into the local filesystem. Just use File>New>Project from Existing Sources in step 1 above and then it'll pick up again at step 4. Please let me know if that doesn't get you going on existing projects with IC quickly.

  5. Corey Yeatman reporter

    Yep, the instructions in your first comment worked flawlessly for someone else here ... so I'm happy it works. I don't know what happened locally when I did it earlier (and it didn't work) so I'll give it another go later and see if I can get it to work too.

    Great plugin BTW, its been a life-saver when doing Salesforce dev :-)

  6. Simon Kaya

    Hello Scott, Corey,

    I have a similar issue when working with one of our clients VCS. Managed to clone and follow the steps to connect to a dev org etc. Allows me to retrieve and deploy changes to existing files on the org. However creating a new class does not deploy.

    I have added this to my package xml file and set this as the source for the for project contents in illuminated cloud. However this still doesn't deploy to the org.

    Any ideas where I am going wrong?

  7. Scott Wells repo owner

    Simon, can you provide a screenshot of the deployment dialog showing the newly-added subscription contents selected for deployment? Also, can you please enable debug logging for metadata deployment as documented here:

    http://www.illuminatedcloud.com/support/debuglogging

    reproduce the issue, and either attach or email the resulting idea.log (Help>Show Log in Explorer/Finder) for review? Thanks!

  8. Log in to comment