backend: Use konan.dependencies property to set dependencies dir

This patch set default dependencies directory to ${konan.home}/
dependencies and allows one to override this setting using
konan.dependencies system property.
This commit is contained in:
Ilya Matveev
2017-03-21 16:03:57 +07:00
committed by ilmat192
parent 52a245bb10
commit 4a716fbf30
5 changed files with 13 additions and 10 deletions
@@ -12,6 +12,7 @@ abstract class KonanTest extends JavaExec {
def backendNative = project.project(":backend.native")
def runtimeProject = project.project(":runtime")
def dist = project.rootProject.file("dist")
def dependencies = project.findProject(":dependencies").file("all")
def runtimeBc = new File("${dist.canonicalPath}/lib/runtime.bc").absolutePath
def launcherBc = new File("${dist.canonicalPath}/lib/launcher.bc").absolutePath
def startKtBc = new File("${dist.canonicalPath}/lib/start.kt.bc").absolutePath
@@ -56,7 +57,9 @@ abstract class KonanTest extends JavaExec {
@Override
void setJvmArgs(Iterable<?> arguments) {
super.setJvmArgs(arguments + "-Dkonan.home=${dist.canonicalPath}" +
super.setJvmArgs(arguments +
"-Dkonan.home=${dist.canonicalPath}" +
"-Dkonan.dependencies=${dependencies.canonicalPat}",
"-Djava.library.path=${dist.canonicalPath}/konan/nativelib")
}
@@ -168,6 +168,7 @@ class NamedNativeInteropConfig implements Named {
new File(project.findProject(":Interop:Runtime").buildDir, "nativelibs")
).asPath
systemProperties "konan.home": project.rootProject.file("dist")
systemProperties "konan.dependencies": project.findProject(":dependencies").file("all")
environment "LIBCLANG_DISABLE_CRASH_RECOVERY": "1"
environment "DYLD_LIBRARY_PATH": "${project.llvmDir}/lib"
environment "LD_LIBRARY_PATH": "${project.llvmDir}/lib"