Skip to content

Commit

Permalink
[GR-50386] IntelliJ improvements.
Browse files Browse the repository at this point in the history
PullRequest: mx/1710
  • Loading branch information
steve-s committed Nov 29, 2023
2 parents 61f3d40 + 5c8b710 commit 99417fb
Show file tree
Hide file tree
Showing 7 changed files with 155 additions and 57 deletions.
2 changes: 1 addition & 1 deletion ci.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ local with(platform, java_release, timelimit="15:00") = {
specVersion: "3",

# Overlay
overlay: "ac39d70172b1327e73fde446dad6341727340376",
overlay: "6def1af6dac47b0c2b7ebf7cbbde821ef8f4b41d",

# For use by overlay
versions:: versions,
Expand Down
4 changes: 3 additions & 1 deletion ci/common.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ local common_json = import "../common.json";
local _oraclejdk = common_json.jdks["oraclejdk-latest"];
local _ov = "ee-%s+%s" % [_oraclejdk.version, _oraclejdk.build_id];
local _lv = _labsjdk.version;
assert std.startsWith(_lv, _ov) : "update oraclejdk-latest to match labsjdk-ee-latest: %s+%s vs %s" % [_oraclejdk.version, _oraclejdk.build_id, _labsjdk.version];
# Skip the check if we are not using a labsjdk. This can happen on JDK integration branches.
local no_labsjdk = _labsjdk.name != "labsjdk";
assert no_labsjdk || std.startsWith(_lv, _ov) : "update oraclejdk-latest to match labsjdk-ee-latest: %s+%s vs %s" % [_oraclejdk.version, _oraclejdk.build_id, _labsjdk.version];
true,

# The raw jdk data, the same as common_json.jdks + { jdk_version:: }
Expand Down
16 changes: 8 additions & 8 deletions common.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"Jsonnet files should not include this file directly but use ci/common.jsonnet instead."
],

"mx_version": "7.2.2",
"mx_version": "7.3.2",

"COMMENT.jdks": "When adding or removing JDKs keep in sync with JDKs in ci/common.jsonnet",
"jdks": {
Expand Down Expand Up @@ -42,13 +42,13 @@
"labsjdk-ee-21Debug": {"name": "labsjdk", "version": "ee-21.0.1+11-jvmci-23.1-b22-debug", "platformspecific": true },
"labsjdk-ee-21-llvm": {"name": "labsjdk", "version": "ee-21.0.1+11-jvmci-23.1-b22-sulong", "platformspecific": true },

"oraclejdk-latest": {"name": "jpg-jdk", "version": "22", "build_id": "24", "release": true, "platformspecific": true, "extrabundles": ["static-libs"]},
"labsjdk-ce-latest": {"name": "labsjdk", "version": "ce-22+24-jvmci-b01", "platformspecific": true },
"labsjdk-ce-latestDebug": {"name": "labsjdk", "version": "ce-22+24-jvmci-b01-debug", "platformspecific": true },
"labsjdk-ce-latest-llvm": {"name": "labsjdk", "version": "ce-22+24-jvmci-b01-sulong", "platformspecific": true },
"labsjdk-ee-latest": {"name": "labsjdk", "version": "ee-22+24-jvmci-b01", "platformspecific": true },
"labsjdk-ee-latestDebug": {"name": "labsjdk", "version": "ee-22+24-jvmci-b01-debug", "platformspecific": true },
"labsjdk-ee-latest-llvm": {"name": "labsjdk", "version": "ee-22+24-jvmci-b01-sulong", "platformspecific": true }
"oraclejdk-latest": {"name": "jpg-jdk", "version": "22", "build_id": "25", "release": true, "platformspecific": true, "extrabundles": ["static-libs"]},
"labsjdk-ce-latest": {"name": "labsjdk", "version": "ce-22+25-jvmci-b01", "platformspecific": true },
"labsjdk-ce-latestDebug": {"name": "labsjdk", "version": "ce-22+25-jvmci-b01-debug", "platformspecific": true },
"labsjdk-ce-latest-llvm": {"name": "labsjdk", "version": "ce-22+25-jvmci-b01-sulong", "platformspecific": true },
"labsjdk-ee-latest": {"name": "labsjdk", "version": "ee-22+25-jvmci-b01", "platformspecific": true },
"labsjdk-ee-latestDebug": {"name": "labsjdk", "version": "ee-22+25-jvmci-b01-debug", "platformspecific": true },
"labsjdk-ee-latest-llvm": {"name": "labsjdk", "version": "ee-22+25-jvmci-b01-sulong", "platformspecific": true }
},

"eclipse": {
Expand Down
10 changes: 8 additions & 2 deletions docs/IDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ Download and install the latest IntelliJ IDEA Community Edition: [https://www.je

Change the IntelliJ maximum memory to 2 GB or more. As per the [instructions](https://www.jetbrains.com/idea/help/increasing-memory-heap.html#d1366197e127), from the main menu choose **Help | Edit Custom VM Options** and modify the **-Xmx** and **-Xms** options.

Enable parallel builds in **Preferences > Build, Execution, Deployment > Compiler > Compile independent modules in parallel**.

Open IntelliJ and go to **Preferences > Plugins > Browse Repositories**. Install the following plugins:

* [Eclipse Code Formatter](https://plugins.jetbrains.com/plugin/6546): formats code according to Eclipse
Expand All @@ -33,6 +31,14 @@ Recommended _Format on Save_ configuration (**IntelliJ IDEA > Preferences > Tool
2. Check "Optimize imports" (Files:Java)
3. Check "Run code cleanup". This removes unused imports.

At the moment, points 1 and 2 can be automatically configured by passing `--on-save-actions` to `mx intellijinit`.

Use `MX_INTELLIJINIT_DEFAULTS` environment variable to set default options and flags for the `mx intellijinit` command.
The value is split using spaces as delimiter and prepended to the arguments passed on the command line.

Use `mx intellijinit --help` to view all the options and flags that allow further customization
of the IntelliJ projects generation.

#### Making IntelliJ Feel Similar to Eclipse (Optional)

Set IntelliJ to use the Eclipse compiler by going to *IntelliJ IDEA > Preferences > Build, Execution, Deployment > Java Compiler*
Expand Down
2 changes: 1 addition & 1 deletion src/mx/_impl/mx.py
Original file line number Diff line number Diff line change
Expand Up @@ -19250,7 +19250,7 @@ def alarm_handler(signum, frame):
abort(1, killsig=signal.SIGINT)

# The version must be updated for every PR (checked in CI) and the comment should reflect the PR's issue
version = VersionSpec("7.3.2") # GR-50202 Make unittest configs accessible outside of mx_unittest
version = VersionSpec("7.3.3") # Minor improvements in mx intellijinit: option for max java compliance, etc.

_mx_start_datetime = datetime.utcnow()
_last_timestamp = _mx_start_datetime
Expand Down
Loading

0 comments on commit 99417fb

Please sign in to comment.