Malachi de Ælfweald
01/06/2020, 7:08 PMSecurity Alert: Your app contains embedded private keys or keystore files
due to kroto-plus-test depending on grpc-testing and ending up in the releaseRuntimeClasspath. Any thoughts on how to get the mock classes to exist only in the test classpath?Malachi de Ælfweald
01/06/2020, 10:57 PMmarcoferrer
01/06/2020, 11:04 PMmarcoferrer
01/06/2020, 11:06 PMMalachi de Ælfweald
01/07/2020, 3:40 PMmarcoferrer
01/07/2020, 3:42 PMmarcoferrer
01/07/2020, 3:43 PMMalachi de Ælfweald
01/07/2020, 3:46 PMprotobuf {
protoc { artifact = Libs.protoc }
plugins {
Libs.protocPlugins.forEach {
id(it.key) { artifact = it.value }
}
}
generateProtoTasks {
val krotoConfig = file("$projectDir/kroto.yml")
all().forEach {
// Allow config changes to affect UP-TO-DATE checks
it.inputs.files(krotoConfig)
it.generateDescriptorSet = true
it.descriptorSetOptions.apply {
includeImports = true
includeSourceInfo = true
}
it.builtins {
id("java") {
option("annotate_code")
outputSubDir = "java"
}
}
it.plugins {
id("grpc") {
outputSubDir = "java"
}
id("coroutines") {
outputSubDir = "java"
}
id("kroto") {
option("ConfigPath=$krotoConfig")
outputSubDir = "java"
}
}
}
}
}
Malachi de Ælfweald
01/07/2020, 4:07 PMMalachi de Ælfweald
01/07/2020, 4:07 PMid("kroto") {
when {
it.isTest -> option("ConfigPath=$krotoTestConfig")
else -> option("ConfigPath=$krotoConfig")
}
outputSubDir = "java"
}
Malachi de Ælfweald
01/07/2020, 4:08 PMbuild/generated/source/debug/java
and build/generated/source/release/java
are populated (without the mock services) and the build/generated/source/debugUnitTest/java
and build/generated/source/releaseUnitTest/java
are both empty.marcoferrer
01/07/2020, 4:24 PMprotobuf {
protoc { artifact = Libs.protoc }
plugins {
Libs.protocPlugins.forEach {
id(it.key) { artifact = it.value }
}
}
generateProtoTasks {
val krotoConfigMain = file("$projectDir/kroto_main.yml")
val krotoConfigTest = file("$projectDir/kroto_test.yml")
// For android projects use `ofNonTest()`
// For plain java / kotlin projects use `ofSourceSet("main")`
ofNonTest().forEach {
// Allow config changes to affect UP-TO-DATE checks
it.inputs.files(krotoConfigMain)
it.generateDescriptorSet = true
it.descriptorSetOptions.apply {
includeImports = true
includeSourceInfo = true
}
it.builtins {
id("java") {
option("annotate_code")
outputSubDir = "java"
}
}
it.plugins {
id("grpc") {
outputSubDir = "java"
}
id("coroutines") {
outputSubDir = "java"
}
id("kroto") {
option("ConfigPath=$krotoConfigMain")
outputSubDir = "java"
}
}
}
// For android projects use `ofTest()`
// For plain java / kotlin projects use `ofSourceSet("test")`
ofTest().forEach {
// Allow config changes to affect UP-TO-DATE checks
it.inputs.files(krotoConfigTest)
it.generateDescriptorSet = true
it.builtIns {
remove("java")
}
it.plugins {
id("kroto") {
option("ConfigPath=$krotoConfigTest")
}
}
}
}
}
marcoferrer
01/07/2020, 4:24 PMmarcoferrer
01/07/2020, 4:25 PMmarcoferrer
01/07/2020, 4:25 PMmarcoferrer
01/07/2020, 4:26 PMMalachi de Ælfweald
01/07/2020, 4:34 PMMalachi de Ælfweald
01/07/2020, 4:34 PMMalachi de Ælfweald
01/07/2020, 4:36 PMMalachi de Ælfweald
01/07/2020, 4:36 PMMalachi de Ælfweald
01/07/2020, 4:37 PMMalachi de Ælfweald
01/07/2020, 4:37 PMMalachi de Ælfweald
01/07/2020, 4:37 PMMalachi de Ælfweald
01/07/2020, 4:38 PMMalachi de Ælfweald
01/07/2020, 4:38 PMMalachi de Ælfweald
01/07/2020, 4:38 PMMalachi de Ælfweald
01/07/2020, 4:38 PMMalachi de Ælfweald
01/07/2020, 4:39 PMmarcoferrer
01/07/2020, 4:39 PMmarcoferrer
01/07/2020, 4:41 PMmarcoferrer
01/07/2020, 4:42 PMandroid {
sourceSets {
test {
proto {
srcDir 'src/main/proto'
}
}
}
}
marcoferrer
01/07/2020, 4:43 PMgoogle-common-proto
Malachi de Ælfweald
01/07/2020, 4:43 PMmarcoferrer
01/07/2020, 4:44 PMdependencies {
protobufTest "com.fkfkfk.kddkkkg"
}
Malachi de Ælfweald
01/07/2020, 4:45 PMMalachi de Ælfweald
01/07/2020, 4:48 PMproto
above supposed to be a ProtobufConfigurator?marcoferrer
01/07/2020, 4:49 PMMalachi de Ælfweald
01/07/2020, 4:50 PMMalachi de Ælfweald
01/07/2020, 4:52 PMsourceSets {
getByName("test").java.srcDirs("src/main/proto")
}
marcoferrer
01/07/2020, 4:55 PMmarcoferrer
01/07/2020, 4:55 PMmarcoferrer
01/07/2020, 4:56 PMmarcoferrer
01/07/2020, 4:56 PMMalachi de Ælfweald
01/07/2020, 4:56 PMMalachi de Ælfweald
01/07/2020, 4:57 PMMalachi de Ælfweald
01/07/2020, 4:57 PMMalachi de Ælfweald
01/07/2020, 4:57 PMMalachi de Ælfweald
01/07/2020, 4:59 PMMalachi de Ælfweald
01/07/2020, 4:59 PMMalachi de Ælfweald
01/07/2020, 4:59 PMMalachi de Ælfweald
01/07/2020, 4:59 PMMalachi de Ælfweald
01/07/2020, 4:59 PMmarcoferrer
01/07/2020, 4:59 PMMalachi de Ælfweald
01/07/2020, 5:00 PMmarcoferrer
01/07/2020, 5:00 PMMalachi de Ælfweald
01/07/2020, 5:00 PMmarcoferrer
01/07/2020, 5:00 PMmarcoferrer
01/07/2020, 5:01 PMMalachi de Ælfweald
01/07/2020, 5:01 PMMalachi de Ælfweald
01/07/2020, 5:02 PMmarcoferrer
01/07/2020, 5:02 PMMalachi de Ælfweald
01/07/2020, 5:03 PM