RFR 8210226: Add support for multiple project folders to idea.sh

Maurizio Cimadamore maurizio.cimadamore at oracle.com
Fri Aug 31 13:59:30 UTC 2018


Thanks for the reviews; once again, when doing some more testing I 
discovered some issues which had to do with coexistence with the 
intellij jtreg plugin.

The bottom of the issue is that certain IDE owned ant variable (such as 
$ModuleFileDir$) are only set when clicking on certain IDE actions, but 
not on other. This leads to a very messy behavior, where certain times 
the IDE will fail to build the project if the build is triggered 
implicitly  (e.g. upon running a jtreg test from the IDE).

I now got rid of references to such variables and replaced it with 
references to a new IDEA_DIR template variable, whose addition in the 
idea.sh script is straighforward.

To make sure that I got all bases covered, I tested in the following fashion

1) create a project for java.base and jdk.compiler module in the root folder
- verify that source files belonging to either of the above modules can 
be opened inside the IDE
- verify that jtreg tests can be run from the IDE (and that it triggers 
'make images' correctly)
- verify that the build/rebuild buttons of the IDE also work
- check consistency of IDE setting by inspecting various menus (e.g. 
Project structure and Project settings)

2) create a project for java.desktop in a folder called desktop (e.g. 
using -o desktop), then check again:
- verify that source files belonging to the java.desktop module can be 
opened inside the IDE
- verify that jtreg tests can be run from the IDE (and that it triggers 
'make images' correctly)
- verify that the build/rebuild buttons of the IDE also work
- check consistency of IDE setting by inspecting various menus (e.g. 
Project structure and Project settings)


This all worked as expected.

Webrev:

http://cr.openjdk.java.net/~mcimadamore/8210226_v2/


Sorry for the review churn!

Maurizio





On 30/08/18 16:12, Maurizio Cimadamore wrote:
> Hi,
> this patch adds proper support for -o option to the idea.sh script, 
> which allows to place the .idea folder under any given output folder 
> (not necessarily the JDK root).
>
> To be able to do this, I had to revampo the logic for template 
> substitution in idea.sh, as it was growing too brittle. I now have a 
> much more declarative logic, where replacements can be added by 
> calling the add_replacement function. This allows to replace a lot of 
> the previous code with very simple and self-explanatory calls to that 
> routine.
>
> This piece was necessary, as we needed to replace a lot of references 
> to the idea variable $PROJECT_DIR with the new template variable 
> ###ROOT_DIR### (otherwise the project is ill-formed, since 
> $PROJECT_DIR merely points at the folder containing the .idea project 
> folder).
>
> Webrev:
>
> http://cr.openjdk.java.net/~mcimadamore/8210226/
>
> Cheers
> Maurizio
>




More information about the build-dev mailing list