Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .mvn/jvm.config

This file was deleted.

14 changes: 14 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,20 @@ the `dev` profile in your Maven command to use those artifacts instead of buildi
Modifying the native op generation code (not the annotation processor) or the JavaCPP configuration (not the abstract Pointers) will require a
complete build could be required to reflect the changes, otherwise `-Pdev` should be fine.

## JDK 16+

If you're using JDK 16+, you need to add some exports for the formatter plugin:

```
--add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED
--add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED
--add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED
--add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED
--add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED
```

This can be done in `.mvn/jvm.config` or `MAVEN_OPTS`.

### Native Builds

In some cases, like when adding GPU support or re-generating op classes, you will need to re-build the native library. 99% of this is building
Expand Down
41 changes: 29 additions & 12 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
<maven.javadoc.skip>true</maven.javadoc.skip>
<maven.source.skip>true</maven.source.skip>
<gpg.skip>true</gpg.skip>
<spotless.version>2.10.3</spotless.version>
<spotless.version>2.11.1</spotless.version>
</properties>

<repositories>
Expand Down Expand Up @@ -229,6 +229,33 @@
</plugins>
</build>
</profile>

<profile>
<id>format</id>
<activation>
<jdk>(,16)</jdk>
</activation>
<build>
<plugins>
<plugin>
<groupId>com.diffplug.spotless</groupId>
<artifactId>spotless-maven-plugin</artifactId>
<version>${spotless.version}</version>

<executions>
<execution>
<!-- Runs in initialize phase to fail fast in case of formatting issues (should be before codegen).-->
<id>spotless-check</id>
<phase>initialize</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>

<!-- http://central.sonatype.org/pages/requirements.html#developer-information -->
Expand Down Expand Up @@ -305,6 +332,7 @@
<artifactId>spotless-maven-plugin</artifactId>
<version>${spotless.version}</version>
<configuration>

<ratchetFrom>origin/master</ratchetFrom>

<lineEndings/>
Expand All @@ -318,17 +346,6 @@
</licenseHeader>
</java>
</configuration>

<executions>
<execution>
<!-- Runs in initialize phase to fail fast in case of formatting issues (should be before codegen).-->
<id>spotless-check</id>
<phase>initialize</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
<pluginManagement>
Expand Down