timob / jnigi

Golang Java JNI library
BSD 2-Clause "Simplified" License
163 stars 44 forks source link

Compile time script #24

Closed timob closed 4 years ago

timob commented 4 years ago

This removes the install.sh script and adds compilevars.sh.

You source the compilevars.sh <path to jdk> in your app's build script, which sets the CGO_CFLAGS environment variable as needed to compile jnigi.

The reason is that the current onetime run of install.sh script doesnt fit into the way Go builds packages, because often the package will get recompiled which will fail with out the environment variable set.

timob commented 4 years ago

This works for me because i usually use shell scripts for building, would be good to know if it works with makefiles too.