summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
authorArne Schwabe <arne@rfc2549.org>2018-03-16 11:02:22 +0100
committerArne Schwabe <arne@rfc2549.org>2018-03-16 11:02:22 +0100
commitae3cc8f568e4d6c6306a609bb8c6a88c15cc334d (patch)
tree5c84854e62fbc04ebcbbc415f10499d92f3da4a8 /main
parent948fd68b1ea8306de01d340923527c3ac8985b2a (diff)
Workaround for gradle not finding swig when executed from Android Studio
Diffstat (limited to 'main')
-rw-r--r--main/build.gradle11
1 files changed, 8 insertions, 3 deletions
diff --git a/main/build.gradle b/main/build.gradle
index ad18d002..cf677e5d 100644
--- a/main/build.gradle
+++ b/main/build.gradle
@@ -38,15 +38,20 @@ dependencies {
def openvpn3SwigFiles = new File(buildDir, "generated/source/ovpn3swig/ovpn3")
task ("generateOpenVPN3Swig" ,type:Exec) {
+ def swigcmd = "swig"
+ // Workaround for Mac OS X since it otherwise does not find swig and I cannot get
+ // the Exec task to respect the PATH environment :(
+ if (file("/usr/local/bin/swig").exists())
+ swigcmd = "/usr/local/bin/swig"
+
doFirst {
mkdir openvpn3SwigFiles
}
- commandLine "swig", "-outdir", openvpn3SwigFiles, "-outcurrentdir", "-c++", "-java", "-package", "net.openvpn.ovpn3",
+ commandLine swigcmd, "-outdir", openvpn3SwigFiles, "-outcurrentdir", "-c++", "-java", "-package", "net.openvpn.ovpn3",
"-Isrc/main/cpp/openvpn3/client", "-Isrc/main/cpp/openvpn3/",
"-o", "${openvpn3SwigFiles}/ovpncli_wrap.cxx", "-oh", "${openvpn3SwigFiles}/ovpncli_wrap.h",
"src/main/cpp/openvpn3/javacli/ovpncli.i"
- environment 'PATH', "${environment.PATH}:/usr/local/bin/"
-
+\
}
android {