Hi there,

the script below successfully creates a binding between a c library and java on 
MacOS. For Linux and Windows I'd need different convention parameters (see the 
jni closure below). Is it possible to make gradle automatically pick the right 
options depending on the operating system it is running on? I'd need differend 
jni blocks for different OS. Any idea is highly appreciated.

apply plugin: "java"

group = "com.hello2morrow"
version = "1.0"

buildscript
{
    repositories
    {
        //...
    }
    dependencies
    {
        classpath group: 'com.hello2morrow', name: 'jni-generator', version: 
'1.0'
    }
}

apply plugin: JNIGenerator

jar
{
    from: "build/jnilib"
}

// Those options are specific for MacOS ;-(
jni 
{
    rootClassName = "EDG"
    packageName = "com.hello2morrow.parsing.cpp.edg"
    includeDirectories += "src/main/edg"
    compileCommand = "gcc -c"
    compileIncludeDirectories += 
"/System/Library/Frameworks/JavaVM.framework/Headers"
    linkCommand = "gcc -bundle -framework JavaVM"
    nativeLibName = "lib${rootClassName.toLowerCase()}.jnilib"
}

Best regards

Alexander von Zitzewitz

hello2morrow Inc.
1 (877) 294-6327




---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to