Skip to content

Commit

Permalink
Add debug mode for native images
Browse files Browse the repository at this point in the history
  • Loading branch information
tibetiroka committed Mar 1, 2024
1 parent 4884d12 commit c2e05dc
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ jobs:
distribution: 'graalvm'
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Compile project
run: mvn -B test -Pnative,portable --file pom.xml
run: mvn -Ddebug=true -B test -Pnative,portable --file pom.xml
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,10 @@ This will produce the `sources`, `javadoc` and the library jar files. For a runn

```bash
mvn package -P native,portable
```

For development, you can also enable debug mode to greatly cut compile times for the native image. (Using the native image for development is not necessary, but is made a lot easier with this option.)

```bash
mvn package -Ddebug=true -Pnative
```
25 changes: 24 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,28 @@
</build>

<profiles>
<profile>
<id>release</id>
<activation>
<property>
<name>!debug</name>
</property>
</activation>
<properties>
<performance-options>-O3</performance-options>
</properties>
</profile>
<profile>
<id>debug</id>
<activation>
<property>
<name>debug</name>
</property>
</activation>
<properties>
<performance-options>-Ob</performance-options>
</properties>
</profile>
<profile>
<id>native</id>
<build>
Expand Down Expand Up @@ -170,7 +192,8 @@
<buildArgs>
<arg>--report-unsupported-elements-at-runtime</arg>
<arg>-H:+UnlockExperimentalVMOptions</arg>
<arg>-O3</arg>
<!--suppress UnresolvedMavenProperty -->
<arg>${performance-options}</arg>
<arg>--gc=G1</arg>
<arg>--strict-image-heap</arg>
<arg>--initialize-at-build-time=com.tibetiroka.deblint</arg>
Expand Down

0 comments on commit c2e05dc

Please sign in to comment.