1 apply plugin: 'java' 2 apply plugin: 'cpp' 3 4 sourceSets { 5 stub { 6 java.srcDirs = [ 7 'src/stub/java' 8 ] 9 } 10 } 11 // this is the "Unbundled Conscrypt jar" 12 sourceSets.main { 13 java.srcDirs = [ 14 'src/main/java', 15 'src/compat/java', 16 "${project.buildDir}/gen", 17 ] 18 compileClasspath += sourceSets.stub.output 19 } 20 21 compileJava.options.encoding = 'UTF-8' 22 compileJava.options.compilerArgs += ['-Xmaxwarns', '9999999'] 23 24 dependencies { 25 compile getAndroidPrebuilt('9') 26 compile files("${project.buildDir}/gen") { 27 builtBy 'gen_constants' 28 } 29 } 30 31 model { 32 components { 33 genconst(NativeExecutableSpec) { 34 sources { 35 cpp { 36 source { 37 srcDir "src/gen/native" 38 } 39 exportedHeaders { 40 srcDirs "../openssl/include", "../boringssl/include" 41 } 42 } 43 } 44 } 45 } 46 } 47 48 task gen_constants(type:Exec) { 49 File genDir = new File("${project.buildDir}", "gen") 50 genDir.mkdirs() 51 52 workingDir new File("${project.buildDir}") 53 executable 'binaries/genconstExecutable/genconst' 54 standardOutput = new FileOutputStream(new File(genDir, "NativeConstants.java")) 55 } 56 57 gen_constants.dependsOn 'genconstExecutable' 58