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: BUILDING.md
+19-22Lines changed: 19 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,6 @@ Prerequisites:
5
5
6
6
* A [Java 21-compatible (or higher) Java development kit (JDK)](http://www.oracle.com/technetwork/java/javase/downloads/index.html).
7
7
* If `JAVA_HOME` is not set on Mac OS X: `export JAVA_HOME=$(/usr/libexec/java_home)`
8
-
*[Maven](https://maven.apache.org/download.cgi) 3.3.0+ (Maven Wrapper provided with `./mvnw`)
9
8
10
9
For running tests, you will need Ant:
11
10
@@ -25,21 +24,19 @@ command to execute is:
25
24
./mvnw
26
25
```
27
26
28
-
This will run the default "install" goal (`mvn install`) and will do all of the following:
27
+
This will run the default "install" goal (`./mvnw install`) and will do all of the following:
29
28
30
29
* Compile JRuby
31
30
* Build `lib/jruby.jar`, needed for running at command line
32
31
* It will install the default gems specifications `lib/pom.rb` and the ruby files of those gems in `lib/ruby/stdlib/`.
33
32
34
33
The environment is now suitable for running Ruby applications.
35
34
36
-
If you have Maven installed in your PATH, you can just use `mvn` instead of `./mvnw`.
37
-
38
35
Incremental Builds
39
36
------------------
40
37
41
38
When working on JRuby sources, it is helpful to incrementally rebuild only the `lib/jruby.jar` file rather than also
42
-
re-assembling the standard library. You can add `-Dcore` to the `mvn` command line to speed up incremental builds:
39
+
re-assembling the standard library. You can add `-Dcore` to the `./mvnw` command line to speed up incremental builds:
43
40
44
41
```
45
42
./mvnw -Dcore
@@ -92,7 +89,7 @@ environment. This will do the following:
92
89
needed to run integration tests.
93
90
94
91
```
95
-
mvn -Pbootstrap
92
+
./mvnw -Pbootstrap
96
93
```
97
94
98
95
In case there is a problem with installing the jruby-launcher (due to missing compiler or so) use
@@ -110,7 +107,7 @@ After changing Java code, you can recompile quickly by running one of the
110
107
jar files by
111
108
112
109
```
113
-
mvn -pl core
110
+
./mvnw -pl core
114
111
```
115
112
116
113
### Day to Day Testing
@@ -160,7 +157,7 @@ Most of the specs under the spec/ directory are written for rspec, and can be ru
160
157
161
158
The notable exception is the "Ruby specs" under spec/ruby, which are run with mspec as described later in this document.
162
159
163
-
rspec will be installed with `mvn package -Pbootstrap` or you can install it manually.
160
+
rspec will be installed with `./mvnw package -Pbootstrap` or you can install it manually.
164
161
165
162
```
166
163
./bin/jruby -S rspec spec/path/to/spec
@@ -193,17 +190,17 @@ If you are making changes that would affect JRuby's core runtime
193
190
or embedding APIs, you should run JRuby's Java-based unit tests via
194
191
195
192
```
196
-
mvn -Ptest
193
+
./mvnw -Ptest
197
194
```
198
195
199
196
#### Tests for other ways of deploying and packaging JRuby
200
197
201
198
There are some maven integration tests (i.e. consistency test if all gems are included, osgi test, etc) for the various distributions of JRuby which can be invoked with
202
199
203
200
```
204
-
mvn -Pmain -Dinvoker.skip=false
205
-
mvn -Pcomplete -Dinvoker.skip=false
206
-
mvn -Pdist -Dinvoker.skip=false
201
+
./mvnw -Pmain -Dinvoker.skip=false
202
+
./mvnw -Pcomplete -Dinvoker.skip=false
203
+
./mvnw -Pdist -Dinvoker.skip=false
207
204
```
208
205
209
206
#### Just Like CI
@@ -224,18 +221,18 @@ maven/jruby-dist/src/it
224
221
To trigger the tests with the build:
225
222
226
223
```
227
-
mvn -Pmain -Dinvoker.skip=false
228
-
mvn -Pcomplete -Dinvoker.skip=false
229
-
mvn -Pdist -Dinvoker.skip=false
230
-
mvn -Pjruby-jars -Dinvoker.skip=false
224
+
./mvnw -Pmain -Dinvoker.skip=false
225
+
./mvnw -Pcomplete -Dinvoker.skip=false
226
+
./mvnw -Pdist -Dinvoker.skip=false
227
+
./mvnw -Pjruby-jars -Dinvoker.skip=false
231
228
```
232
229
233
230
To pick a particular test, add the name of the directory inside the respective *src/it* folder, like (wildcards are possible):
To clean the build it is important to use the same profile for the clean as what you want to build. The best way to clean build something is, i.e. jruby-jars
245
242
246
243
```
247
-
mvn clean install -Pjruby-jars
244
+
./mvnw clean install -Pjruby-jars
248
245
```
249
246
250
247
This first cleans everything and then starts the new build in one go!
@@ -253,12 +250,12 @@ Cleaning the build may be necessary after switching to a different
253
250
version of JRuby (for example, after switching git branches) to ensure
254
251
that everything is rebuilt properly.
255
252
256
-
NOTE: `mvn clean` just cleans the **jruby-core** artifact and the **./lib/jruby.jar**!
253
+
NOTE: `./mvnw clean` just cleans the **jruby-core** artifact and the **./lib/jruby.jar**!
0 commit comments