understanding build vs rebuild vs make vs compile
so, the way I understand it, when it comes to compilation,there's conditional, and there's clean: confitional compilation only rewrites files that have changed, clean compilation blows them all away and starts fresh
build and rebuild and are clean, and make and compile are conditional... true?
are build and rebuild exactly the same things? are make and compile exactly the same things?
I have a multi-module project in which one module is constantly changing, and one changes almost never. so I disable compilation on that one, to save time during each test run. but sometimes I do want to rebuild, not just make, that module. is there a "rebuild module" command? dont see one
another question: from the docs and looking at the autogenerated ant scripts, intellij by default creates two subdirectories for each module: testing and production... I understand this distinction in a general way, but what exactly is the story here? am I able to define two different build profiles, one for testing, one for production? I dont see any config panel for all that
and, must have set up my output configs incorrectly because when I use rebuild project, I get one folder per module, no production/testing dirs
somehow my autogenerated ant scripts are getting scrambled... or?
thanks!
请先登录再写评论。
I'm not sure where you are seeing "Build", unless you are referring to"Build Artifact". IDEA has three compilation types:
There is also the "Build Artifact" action which allows you to "Build", "Rebuild" or just clean the artifact. Build only builds it if there is modified code, whereas Rebuild always rebuilds it.
Also of note, in the compiler configuration, you can select to "Make the project automatically" if you have the "Use external build" option selected. The latter simply runs the build in a separate OS process. Therefore you can select the former, and IDEA will automatically make the project in the background. As such, when you go to run code or tests, there is typically little if any code that needs to be compiled.
You cannot define a different build profile for production vs test code. You can only a different output directory. By default IDEA will split the content into two different directories, 'production' and 'test' of the directory configured in File > Project Structure > [Project Settings] > Project > Project compiler output. You can customize this on a per module level in File > Project Structure > [Project Settings] > Modules > {Module Name} > 'Paths' tab > Compiler Output. If you are not seeing the compiled classes being split up, it mostly likely means the source paths are not correctly identified. Go to File > Project Structure > [Project Settings] > Modules > {Module Name} > 'sources' tab and make sure your test source directory is marked as Test Source (green) and not Sources.
Hello.
"Build" action exists only for artifacts. For sources there is Compile, Make and Rebuild. For a quick guide see: http://www.jetbrains.com/idea/webhelp/compilation-types.html
Rebuild and Compile are clean in your terms, Make is conditional. Compile unconditionally compiles just pointed files, no more, no less (i.e. it may report errors, if dependencies are not compiled).
If a module does not change, Make should do nothing for it, so not spending resources. However, Rebuild will process everything from scratch. Typically users call Make regularly and Rebuild rarely, in case of some corruptions.
Production directory is for sources root output, test is for test output. On configuring them see:
http://www.jetbrains.com/idea/webhelp/content-root.html
http://www.jetbrains.com/idea/webhelp/configuring-module-compiler-output.html
And around.
Regards,
Alexander.
thanks you guys!
I know this is rather old (10 years!), but still I cannot get a definite answer I can understand about the following:
In my Tomcat configuration for my JSF application, in Run/Debug Configurations, in the "Before launch" list I can add both "Build" and then "Build artifcat" (exploded or unexploded). I know the last is necessary, but... does that one implies the normal "Build" action (the one with a hammer) is executed prior to it? Or do I have to add that option before the "Build artifact" one? Sorry guys but this should be clearly stated somewhere.
Perepas It's easy to check. Remove the Build step, leave only the Build Artifact step. Make changes to the files (or add a new Java file). Build the artifact or start the run configuration. You will see that classes are updates in the artifact. So, the Build step is not needed as building artifact already invokes Build.