普通文本  |  60行  |  1.64 KB

description = 'Conscrypt: OpenJDK Integration Tests'

evaluationDependsOn(':conscrypt-openjdk')

def preferredNativeConfiguration = project(':conscrypt-openjdk').preferredNativeConfiguration
def preferredNativeFileDir = project(':conscrypt-openjdk').preferredNativeFileDir

sourceSets {
    main {
        resources {
            // This shouldn't be needed but seems to help IntelliJ locate the native artifact.
            srcDirs += preferredNativeFileDir
        }
    }
}

dependencies {
    compile project(':conscrypt-openjdk')

    // Add the preferred native openjdk configuration for this platform.
    compile project(path: ':conscrypt-openjdk', configuration: "$preferredNativeConfiguration")

    testCompile project(':conscrypt-constants'),
                project(':conscrypt-testing')
}

// Check which version
def javaError = new ByteArrayOutputStream()
exec {
    executable test.executable
    args = ['-version']
    ignoreExitValue true
    errorOutput = javaError
}

test {
    if (javaError.toString() =~ /"1[.]6[.].*"/) {
        include "org/conscrypt/ConscryptJava6Suite.class"
    } else {
        include "org/conscrypt/ConscryptSuite.class"
    }
}

// Add a second round of tests using the engine-based socket.
task testEngineSocket(type: Test) {
    dependsOn testClasses
    // Use the engine socket by default.
    jvmArgs "-Dorg.conscrypt.useEngineSocketByDefault=true"
    testClassesDir = test.testClassesDir
    includes = test.includes
    doFirst {
        classpath = test.classpath
    }
}
test.dependsOn testEngineSocket

// Don't include this artifact in the distribution.
tasks.install.enabled = false
tasks.uploadArchives.enabled = false;