aboutsummaryrefslogtreecommitdiffstats
path: root/find_java/build.gradle
blob: b1dfa793d886b6105462b4b51756ad642177046e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
apply plugin: 'cpp'
apply plugin: 'sdk-files'
apply plugin: 'windows-setup'

executables {
    findJava {}
}

sources {
    findJava {
        cpp {
            source {
                srcDir "src/source"
                include "**/*.cpp"
            }
        }
    }
}

sdk {
    windows {
        item( { getExeName("windows") } ) {
            into 'lib'
            name 'find_java.exe'
            builtBy 'findJavaExecutable'
            notice 'NOTICE'
        }
        item('find_java.bat') {
            into 'lib'
            notice 'NOTICE'
        }
    }
}

def getExeName(String platform) {
    // binaries will return a set of binaries
    def binaries = executables.findJava.binaries.matching { it.name == "findJavaExecutable" }
    // calling .exeFile on the set returns an array with the result from each item in the set...
    return binaries.executableFile.get(0)
}