How to create a project from existing code in multiple languages

Hi, new to IDEA, existed at the possibility of a "real" editor for ColdFusion files, among other things, but having trouble getting my project set up.

This is a large app with files in a variety of languages, mainly ColdFusion, java, html, js, css, and xml, with a smattering of other artifacts. Partly for historical reasons and partly for functional grouping, there are directories containing java files at multiple levels of the directory hierarchy. All of this in under external source control.

When I try to create a new project in IDEA (Ultimate 9.0.2 trial), if I say it's java, or create from scratch creating an initial java module, it recognizes the java directories, but nothing else. The directories of ColdFusion and other file types aren't visible. It won't let me add subdirectories under the root as modules, because they're contained in the existing one. I tried cerating a new empty project, thinking I'd add modules manually, but it seems like the only appropriate module type is java, and the same thing happens.

So:

- How should I set up a project with this kind of multi-language content? I want IDEA to be able to work with all the file types in this app.

- Is it a problems that there are java files at multiple directory levels, intermixed with content of other types?

Thanks,
d

6 comments
Comment actions Permalink

Another example scenario: Created an empty project, adding no modules. Manually added one of the main java src dirs as a java module, looks good.

Now I want to add our ant build directory, so I can work on those xml files in IDEA, and maybe once I get my act together, build the project from the IDE. When I add that directory as a module, it wants to know where the java files are, and I tell it not to create a source directory, but then neither the directory or any of the build files appears in the left-side project panel.

What am I missing?

Thanks,
d

0
Comment actions Permalink

Hi Dave,

You should define source roots for your module then.

Also you may be interested in switching between various project views.

Regards, Denis

0
Comment actions Permalink

Thanks for your prompt reply, got me started, liking it so far :). The key is to cancel the search for java sources, and deselect any it already found.

Is it "wrong" to define just one module, with its source root at the root of the project?

That gives me pretty much a file system-like view in the project pane. Plus is that I can see everything, but maybe there's a better way?

Thanks again,
d

0
Comment actions Permalink

DaveMerrill wrote:

Is it "wrong" to define just one module, with its source root at the root of the project?

That gives me pretty much a file system-like view in the project pane. Plus is that I can see everything, but maybe there's a better way?

Thanks again,
d

It depends from particular situation - e.g. that doesn't seem to be a good idea if you have a project that is logically split into multiple parts ('modules' in IDEA terms). However, that's fine for small project where no additional logical fine-grained separation is necessary.

I'd suggest to go with your current setup as you say it's convenient for you and don't hesitate to ask for suggestions if you get any problem with that.

Regards, Denis

0
Comment actions Permalink

Hmmm, it's not that the app doesn't have logical sub-units, it's more that there are files outside them that are also relevant. For example, there's at least one or two files directly at the project root that I'd want to see. It's not small, to me, around 9,000 files, over 130 Megs.

It would definitely be handy to quickly search only one of those smaller sections sometimes (usually even), which so far I only know how to do by right-clicking a project tree node.

Maybe the best solution would be to remove that root module, and add in specific directories below there as the need arises. If I did that, to add the few relevant files at the root, I'd have to add a module with the root as a source dir, then exclude all the dirs under it, yes? And add another exclusion for any new top-level dirs created after that?

Thanks again for your help. Very impressed wtih the javascript structure view. Similar things exist in other tools, this one's just better, and not horrible slow. And go to declaration is wonderful! I know all you java folks are used to that in an IDE, but I've not had that for js, especially when the declaration is in a file in a different directory that I don't have open.

d

0
Comment actions Permalink

I took a look at using IDEA with another much smaller ColdFusion project that doesn't have any files at the root, so creating a module for each top-level dir makes perfect sense.

When you create a new project, IDEA discovers the nested dirs with java code and and offers to make modules for each of them. Am I right that I have to create each of those modules manually in my case, since since there's no java?

If so, it'd be a great time-saver if there was a Generic module type offered, that suggested new modules for each top-level directory, whether it contained java or not, and didn't recurse looking for java. That'd also make getting started with IDEA in a non-java environment a bit less confusing. As it stands, I had to say it was java, abort the search for java files, remove the ones already found, and manually add dirs marking them as source. Does that make sense?

0

Please sign in to leave a comment.