Add a cpp dev run task. (#219)

This commit is contained in:
Thad House
2017-08-13 08:01:39 -07:00
committed by Peter Johnson
parent 0782164120
commit ea028a3822

View File

@@ -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'