From ea028a3822d78be9c6968d933c382e676edcb78c Mon Sep 17 00:00:00 2001 From: Thad House Date: Sun, 13 Aug 2017 08:01:39 -0700 Subject: [PATCH] Add a cpp dev run task. (#219) --- build.gradle | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index 50bff14564..1da36f0dce 100644 --- a/build.gradle +++ b/build.gradle @@ -125,7 +125,7 @@ model { ext = 'zip' version = '+' sharedConfigs = [ ntcore: [], - ntcoreExe: [], + ntcoreDev: [], ntcoreTestingBaseTest: [] ] staticConfigs = [ ntcoreJNI: [] ] } @@ -159,7 +159,7 @@ model { } } if (!project.hasProperty('skipTestExe')) { - ntcoreExe(NativeExecutableSpec) { + ntcoreDev(NativeExecutableSpec) { sources { cpp { lib library: "ntcore" @@ -200,6 +200,26 @@ model { } } } + tasks { + def c = $.components + project.tasks.create('runCpp', Exec) { + def found = false + c.each { + if (it in NativeExecutableSpec && it.name == 'ntcoreDev') { + it.binaries.each { + if (!found) { + def arch = it.targetPlatform.architecture.name + if (arch == 'x86-64' || arch == 'x86') { + dependsOn it.tasks.install + commandLine it.tasks.install.runScript + found = true + } + } + } + } + } + } + } } apply from: 'publish.gradle'