| Xavier Ducrohet | 53a6029 | 2014-06-11 21:28:58 -0700 | [diff] [blame] | 1 | apply plugin: 'cpp' |
| 2 | apply plugin: 'sdk-files' |
| 3 | apply plugin: 'windows-setup' |
| 4 | |
| 5 | executables { |
| 6 | findJava {} |
| 7 | } |
| 8 | |
| 9 | sources { |
| 10 | findJava { |
| 11 | cpp { |
| 12 | source { |
| 13 | srcDir "src/source" |
| 14 | include "**/*.cpp" |
| 15 | } |
| 16 | } |
| 17 | } |
| 18 | } |
| 19 | |
| 20 | sdk { |
| 21 | windows { |
| 22 | item( { getExeName("windows") } ) { |
| Xavier Ducrohet | f94d89c | 2014-06-18 13:47:47 -0700 | [diff] [blame] | 23 | into 'lib' |
| Xavier Ducrohet | 53a6029 | 2014-06-11 21:28:58 -0700 | [diff] [blame] | 24 | name 'find_java.exe' |
| 25 | builtBy 'findJavaExecutable' |
| Xavier Ducrohet | f94d89c | 2014-06-18 13:47:47 -0700 | [diff] [blame] | 26 | notice 'NOTICE' |
| 27 | } |
| 28 | item('find_java.bat') { |
| 29 | into 'lib' |
| 30 | notice 'NOTICE' |
| Xavier Ducrohet | 53a6029 | 2014-06-11 21:28:58 -0700 | [diff] [blame] | 31 | } |
| 32 | } |
| 33 | } |
| 34 | |
| 35 | def getExeName(String platform) { |
| 36 | // binaries will return a set of binaries |
| 37 | def binaries = executables.findJava.binaries.matching { it.name == "findJavaExecutable" } |
| 38 | // calling .exeFile on the set returns an array with the result from each item in the set... |
| 39 | return binaries.executableFile.get(0) |
| 40 | } |
| 41 | |