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?marcoferrer
01/06/2020, 11:04 PMMalachi de Ælfweald
01/07/2020, 3:40 PMmarcoferrer
01/07/2020, 3:42 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"
}
}
}
}
}
id("kroto") {
when {
it.isTest -> option("ConfigPath=$krotoTestConfig")
else -> option("ConfigPath=$krotoConfig")
}
outputSubDir = "java"
}
build/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")
}
}
}
}
}
Malachi de Ælfweald
01/07/2020, 4:34 PMmarcoferrer
01/07/2020, 4:39 PMandroid {
sourceSets {
test {
proto {
srcDir 'src/main/proto'
}
}
}
}
google-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 PMproto
above supposed to be a ProtobufConfigurator?marcoferrer
01/07/2020, 4:49 PMMalachi de Ælfweald
01/07/2020, 4:50 PMsourceSets {
getByName("test").java.srcDirs("src/main/proto")
}
Malachi de Ælfweald
01/07/2020, 4:56 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 PMMalachi de Ælfweald
01/07/2020, 5:01 PMmarcoferrer
01/07/2020, 5:02 PMMalachi de Ælfweald
01/07/2020, 5:03 PM