Compiling from source

Requirements

See the requirements.

Building from Source

Build the frontend files (optional)

./builder.bash build-frontend

Build and run the program

Jar file

$ ./gradlew clean build compTest shadowJar -i
$ java -jar dns-proxy-server-*-all.jar

Native Image

Generated possible necessary metadata

./gradlew clean -Pagent compTest
./gradlew metadataCopy

Generate the binary

$ ./gradlew -x check clean build nativeIntTest nativeImageJar nativeCompile
$ ./build/native/nativeCompile/dns-proxy-server

AMD64 Static

Compiling the source JAR

$ ./gradlew build -x check shadowJar nativeImageJar
$ mkdir -p build/artifacts/native-image-source && cp build/libs/native-image-*.jar ./build/artifacts/native-image-source/dns-proxy-server.jar
$ tree build/artifacts/
build/artifacts/
└── native-image-source
    └── dns-proxy-server.jar

1 directory, 1 file

Generating the native image

$ ./builder.bash build-backend amd64-static