Default compiler setting for resources.

Is it possible to make the default entry in the compiler settings for project resources
"!?*.java"
This would be much more convinient than having to check and extend that list each time a new kind of resource gets added to the project (e.g. a dll in a project that uses JNI)

10 comments
Comment actions Permalink

There's no general solution to the problem. With this approach some unwanted files may be copied as resources. If the patterns suits
well for your project, you may configure IDEA to use it.

--
Best regards,
Eugene Zhuravlev
Software Developer
JetBrains Inc.
http://www.jetbrains.com
"Develop with pleasure!"

"Tobias Kurzke" <no_reply@jetbrains.com> wrote in message news:29797907.1186566769218.JavaMail.itn@is.intellij.net...

Is it possible to make the default entry in the compiler settings for project resources
"!?*.java"
This would be much more convinient than having to check and extend that list each time a new kind of resource gets added to the
project (e.g. a dll in a project that uses JNI)



0
Comment actions Permalink

Which files could that be?
Which kind of files are in a project's source path that are not *.java and are no resource files?

0
Comment actions Permalink

+Which kind of files are in a project's source path that are not *.java and are no resource files? +

Man's got a point. All I can come up with is the occasional straying build.xml, and even that's getting rarer and rarer these days. I imagine the situation becomes more complex when people start integrating other languages that compile to .class (Groovy, JRuby, Scala), particularly when that compilation is optional, but we're not really there, yet. Project layouts are a lot tamer and more standardized than they were back in the day.

--Dave Griffith

0
Comment actions Permalink

a file named "build.xml" would get copied anyway, as *?.xml is included in the current default list.
And normally, you wouldn't even have your build.xml in a source path in a well designed project.

0
Comment actions Permalink

I can give you a straight example :

The VCS we use, MKS, creates a file named "project.pj" in all folders, (quite similar to what VSS does IIRC).

THose should certainly not be considered resources

0
Comment actions Permalink

Right. That's an example of something that shouldn't be copied, but would under your example. While build.xml files seem to becoming rarer and rarer in source roots, I still see them a few times in poorly-designed projects, usually in some aborted attempt to have cascading builds.

--Dave Griffith

0
Comment actions Permalink

I would have thought those would be excluded by "ignored files and folders" under the general IDE settings, just like .svn directories. Doesn't seem to be by default, so that's probably worth adding.

--Dave Griffith

0
Comment actions Permalink

you're right, i forgot about it.

0
Comment actions Permalink

I like the maven approach for this problem. They copy every file within "src/main/resources"... So not the file suffix is arbitrative but the file location.
Why not add a third type of source folder?

0
Comment actions Permalink

How about just making Idea ask the user whenever you make/compile and Idea detects file types that are not on the current list?
Of course if you answer "No" idea must add the file type to another list of ignored file types (that should probably also be visible in the settings).

You probably wouldn't believe what garbage some projects have in their source paths.
Typically those are the big projects in large enterprise, that you just can't change yourself. For example I have just seen a java project that was still using "make" to build and where the sources are mixed with word douments and uml model files.

0

Please sign in to leave a comment.