summaryrefslogtreecommitdiff
path: root/main/build.gradle
diff options
context:
space:
mode:
Diffstat (limited to 'main/build.gradle')
-rw-r--r--main/build.gradle19
1 files changed, 17 insertions, 2 deletions
diff --git a/main/build.gradle b/main/build.gradle
index 2926795e..18fb1c50 100644
--- a/main/build.gradle
+++ b/main/build.gradle
@@ -29,6 +29,18 @@ dependencies {
testImplementation 'junit:junit:4.12'
}
+
+
+def openvpn3SwigFiles = new File(buildDir, "ovpn3swig/")
+
+task ("generateOpenVPN3Swig" ,type:Exec) {
+ doFirst {
+ mkdir openvpn3SwigFiles
+ }
+ commandLine "swig", "-outdir", openvpn3SwigFiles, "-c++", "-java", "-package", "net.openvpn.ovpn3",
+ "-Isrc/main/cpp/openvpn3/client", "-Isrc/main/cpp/openvpn3/", "src/main/cpp/openvpn3/javacli/ovpncli.i"
+}
+
android {
compileSdkVersion 27
buildToolsVersion '27.0.3'
@@ -61,7 +73,7 @@ android {
}
ovpn3 {
-
+ java.srcDirs += openvpn3SwigFiles
}
debug {
@@ -94,7 +106,6 @@ android {
productFlavors {
ovpn3 {
dimension "implementation"
-
}
normal {
@@ -126,3 +137,7 @@ if (project.hasProperty('keystoreFile') &&
android.applicationVariants.all { variant ->
variant.mergeAssets.dependsOn(variant.externalNativeBuildTasks)
}
+
+android.applicationVariants.all { variant ->
+ variant.getJavaCompiler().dependsOn(generateOpenVPN3Swig)
+}