You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.adoc
+27-19Lines changed: 27 additions & 19 deletions
Original file line number
Diff line number
Diff line change
@@ -58,14 +58,16 @@ Once imported, you can apply eclipse settings by running:
58
58
59
59
NOTE: You'll need to close the `spring-javaformat-formatter-eclipse` and `spring-javaformat-formatter-eclipse-runtime` projects following import since they contain rewritten packages that aren't supported by the IDE
60
60
61
-
=== Importing into IntelliJ IDEA
62
61
62
+
63
+
=== Importing Into IntelliJ IDEA
63
64
You can import the code as a maven project into IntelliJ IDEA.
64
65
65
-
==== Module dependencies
66
66
67
+
68
+
==== Module Dependencies
67
69
When IntelliJ IDEA parses `pom.xml`, it automatically creates inter-module dependencies if dependent libraries are coming from other modules within the project.
68
-
However, when dependent modules perform repackaging (e.g. `spring-javaformat-formatter-eclipse-runtime` module), the current module cannot resolve all classes by module dependencies because repackaging(shade & binary manipulation) moves around classes.
70
+
However, when dependent modules perform repackaging (e.g. `spring-javaformat-formatter-eclipse-runtime` module), the current module cannot resolve all classes by module dependencies because repackaging(shade & binary manipulation) moves around classes.
69
71
Therefore, you need to manually update the dependencies from the module to the produced jars.
70
72
71
73
Following modules perform repackaging.
@@ -75,19 +77,21 @@ Following modules perform repackaging.
75
77
76
78
Modules that depend on these modules need jar dependencies instead of module dependencies.
77
79
78
-
===== Setting up jar dependencies
79
80
81
+
82
+
===== Setting up Jar Dependencies
80
83
The following steps define jar-based project libraries on IDE and add them to the modules that need jar dependencies.
81
84
82
85
*Add a jar file-based project library*
83
86
84
87
* "Project Settings" -> "Libraries"
85
88
* Click "+" sign, then select "Java"
86
-
* Specify the jar file +
87
-
For example, you can specifie the jar file in the target directory(`<PROJECT>/spring-javaformat/spring-javaformat-formatter-eclipse-runtime/target/spring-javaformat-formatter-eclipse-runtime-0.0.28-SNAPSHOT.jar`)
89
+
* Specify the jar file
90
+
91
+
For example, you can specify the jar file in the target directory(`<PROJECT>/spring-javaformat/spring-javaformat-formatter-eclipse-runtime/target/spring-javaformat-formatter-eclipse-runtime-0.0.28-SNAPSHOT.jar`)
88
92
or one in the local maven repository(`~/.m2/repository/io/spring/javaformat/spring-javaformat-formatter-eclipse-runtime/0.0.28-SNAPSHOT/spring-javaformat-formatter-eclipse-runtime-0.0.28-SNAPSHOT.jar`).
89
93
90
-
image::src/asciidoc/images/setup-idea-library.png[Setup IntelliJ IDEA library]
94
+
image::.github/images/setup-idea-library.png[Setup IntelliJ IDEA library]
91
95
92
96
*Add library dependencies to modules*
93
97
@@ -97,59 +101,62 @@ image::src/asciidoc/images/setup-idea-library.png[Setup IntelliJ IDEA library]
97
101
* "Choose Libraries" and select necessary libraries that have added in the previous step
98
102
* Move up the added libraries higher than the module dependencies (or remove the module dependencies)
99
103
100
-
image::src/asciidoc/images/setup-idea-dependency.png[Setup IntelliJ IDEA Dependencies]
104
+
image::.github/images/setup-idea-dependency.png[Setup IntelliJ IDEA Dependencies]
101
105
102
106
103
-
=== Setting up IntelliJ IDEA plugin development
104
107
105
-
==== Download images
108
+
=== Setting up IntelliJ IDEA Plugin Development
106
109
110
+
111
+
==== Download Images
107
112
To develop the `spring-javaformat-intellij-idea-plugin` module, you need an IntelliJ IDEA application on your local machine.
108
113
109
114
* Open the `pom.xml` in `spring-javaformat-intellij-idea/spring-javaformat-intellij-idea-runtime`.
110
115
* Check `intellij.binary` and `intellij.source` properties to find out the appropriate IntelliJ IDEA version.
111
-
* Download the binary from the url in `intellij.binary`. +
116
+
* Download the binary from the url in `intellij.binary`.
112
117
(For OSX, replace the `.tar.gz` to `.dmg` to download the image file.)
113
118
* Install the image to the local machine
114
119
* Download the source files from github specified in `intellij.source` and unzip it.
115
120
116
-
==== Setup SDK
117
121
122
+
123
+
==== Setup SDK
118
124
* Open "Project Structure" - "Platform Settings" - "SDKs"
* Specify the installed intellij image. (`/applications/IntelliJ IDEA CE` for OSX)
121
127
* On the right panel, "Sourcepath", Click "+" sign, specify unzipped intellij source directory
122
128
* Specify "Sandbox Home" directory
123
129
124
-
image::src/asciidoc/images/setup-idea-plugin-sdk.png[Setup IntelliJ IDEA Plugin SDK]
130
+
image::.github/images/setup-idea-plugin-sdk.png[Setup IntelliJ IDEA Plugin SDK]
125
131
126
132
Please see the https://plugins.jetbrains.com/docs/intellij/setting-up-environment.html[IntelliJ IDEA reference] for how to setup a plugin development in details.
127
133
128
-
==== Convert to Plugin Module
129
134
135
+
136
+
==== Convert to Plugin Module
130
137
The imported `spring-javaformat-intellij-idea-plugin` module is recognized as a java module.
131
138
This needs to be converted to a plugin module.
132
139
133
140
* Open `spring-javaformat-intellij-idea-plugin.iml` in `spring-javaformat-intellij-idea/spring-javaformat-intellij-idea-plugin`
134
141
* Change `type="JAVA_MODULE"` to `type="PLUGIN_MODULE"`
Reference https://stackoverflow.com/questions/18278440/how-to-import-and-run-existing-plugins-from-intellij-community-edition-repo[how to convert existing module to a plugin module]
142
149
143
150
* Open "Project Structure" - "Modules"
144
151
* Check `spring-javaformat-intellij-idea-plugin` icon turns to a plugin icon
145
152
* "Plugin Deployment" - "Path to META-INF/plugin.xml"
0 commit comments