Skip to content
This repository has been archived by the owner on Sep 21, 2020. It is now read-only.

Commit

Permalink
Add a cpp dev run task. (#219)
Browse files Browse the repository at this point in the history
  • Loading branch information
ThadHouse authored and PeterJohnson committed Aug 13, 2017
1 parent 0782164 commit ea028a3
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ model {
ext = 'zip'
version = '+'
sharedConfigs = [ ntcore: [],
ntcoreExe: [],
ntcoreDev: [],
ntcoreTestingBaseTest: [] ]
staticConfigs = [ ntcoreJNI: [] ]
}
Expand Down Expand Up @@ -159,7 +159,7 @@ model {
}
}
if (!project.hasProperty('skipTestExe')) {
ntcoreExe(NativeExecutableSpec) {
ntcoreDev(NativeExecutableSpec) {
sources {
cpp {
lib library: "ntcore"
Expand Down Expand Up @@ -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'
Expand Down

0 comments on commit ea028a3

Please sign in to comment.