Skip to content

Commit

Permalink
Add maven build support
Browse files Browse the repository at this point in the history
  • Loading branch information
meiMingle committed Jan 15, 2024
1 parent d47fbe5 commit 93ba41b
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# build directory
build/
builddir/
target/

# output.png
output.png
Expand Down
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,37 @@
Work-in-progress pure java JPEG XL decoder

## Compiling
### [Meson]

JXLatte is built with the [Meson build system](https://mesonbuild.com/).

To build, create a build directory, for example, with `mkdir build && cd build`.

Then run `meson setup ../` to set up the build directory, and `ninja` to compile JXLatte.

### [Maven]

Now you can also build JXLatte using Maven. Just run `mvn clean install`.

The artifact will be installed to the local repository and then you can reference it in your project like this

Maven
```xml
<dependency>
<groupId>com.traneptora</groupId>
<artifactId>jxlatte</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
```
Gradle
```groovy
implementation 'com.traneptora:jxlatte:0.0.1-SNAPSHOT'
```
Gradle(Kotlin)
```kotlin
implementation( "com.traneptora:jxlatte:0.0.1-SNAPSHOT")
```

## Running
JXLatte can be executed just like any normal jar file:

Expand Down
59 changes: 59 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>com.traneptora</groupId>
<artifactId>jxlatte</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
</dependencies>
<build>
<sourceDirectory>java</sourceDirectory>
<resources>
<resource>
<filtering>false</filtering>
<directory>java/resources</directory>
<includes>
<include>bt2020-d65-pq.icc</include>
<include>natural-order.dat</include>
<include>default-weights-float.dat</include>
</includes>
</resource>
</resources>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<configuration>
<excludeResources>true</excludeResources>
<excludes>
<exclude>meson.build</exclude>
<exclude>resources/default-weights-double.dat</exclude>
</excludes>
</configuration>
<executions>
<execution>
<id>attach-sources</id>
<phase>verify</phase>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

0 comments on commit 93ba41b

Please sign in to comment.