Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,19 @@ dependencies {
testImplementation(libs.kotlin.test)
}

tasks.jar {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
archiveClassifier = "all"

// Protoc plugins are all fat jars basically (the ones built on jvm)
// be really careful of what you put in the classpath here
from(
configurations.runtimeClasspath.map { prop ->
prop.map { if (it.isDirectory()) it else zipTree(it) }
}
)
if (project.name != "common") {
tasks.jar {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
archiveClassifier = "all"

// Protoc plugins are all fat jars basically (the ones built on jvm)
// be really careful of what you put in the classpath here
from(
configurations.runtimeClasspath.map { prop ->
prop.map { if (it.isDirectory()) it else zipTree(it) }
}
)
}
}

kotlin {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import org.gradle.kotlin.dsl.provideDelegate
import java.util.Properties
import java.util.concurrent.atomic.AtomicReference
import kotlin.io.path.Path
import kotlin.io.path.exists
import kotlin.io.path.inputStream

private val ref = AtomicReference<Properties>()
Expand All @@ -19,7 +20,13 @@ fun Project.localProperties(): Properties {
ref.compareAndSet(null, Properties().apply {
val globalRootDir: String by extra

load(Path(globalRootDir, "local.properties").inputStream())
val filepath = Path(globalRootDir, "local.properties")

if (!filepath.exists()) {
return@apply
}

load(filepath.inputStream())
})
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ public class AnyInternal: com.google.protobuf.kotlin.Any, kotlinx.rpc.protobuf.i
kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException {
com.google.protobuf.kotlin.AnyInternal.decodeWith(msg, it)
}
msg.checkRequiredFields()
return msg
}
}
Expand Down Expand Up @@ -81,6 +80,8 @@ public fun com.google.protobuf.kotlin.AnyInternal.Companion.decodeWith(msg: com.
}
}
}

msg.checkRequiredFields()
}

private fun com.google.protobuf.kotlin.AnyInternal.computeSize(): Int {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ public class ApiInternal: com.google.protobuf.kotlin.Api, kotlinx.rpc.protobuf.i
kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException {
com.google.protobuf.kotlin.ApiInternal.decodeWith(msg, it)
}
msg.checkRequiredFields()
return msg
}
}
Expand Down Expand Up @@ -79,7 +78,6 @@ public class MethodInternal: com.google.protobuf.kotlin.Method, kotlinx.rpc.prot
kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException {
com.google.protobuf.kotlin.MethodInternal.decodeWith(msg, it)
}
msg.checkRequiredFields()
return msg
}
}
Expand Down Expand Up @@ -114,7 +112,6 @@ public class MixinInternal: com.google.protobuf.kotlin.Mixin, kotlinx.rpc.protob
kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException {
com.google.protobuf.kotlin.MixinInternal.decodeWith(msg, it)
}
msg.checkRequiredFields()
return msg
}
}
Expand Down Expand Up @@ -194,7 +191,7 @@ public fun com.google.protobuf.kotlin.ApiInternal.encodeWith(encoder: kotlinx.rp
}
}

if (com.google.protobuf.kotlin.Syntax.SYNTAX_PROTO2 != syntax) {
if (syntax != com.google.protobuf.kotlin.Syntax.SYNTAX_PROTO2) {
encoder.writeEnum(fieldNr = 7, value = syntax.number)
}
}
Expand Down Expand Up @@ -248,6 +245,8 @@ public fun com.google.protobuf.kotlin.ApiInternal.Companion.decodeWith(msg: com.
}
}
}

msg.checkRequiredFields()
}

private fun com.google.protobuf.kotlin.ApiInternal.computeSize(): Int {
Expand All @@ -257,11 +256,11 @@ private fun com.google.protobuf.kotlin.ApiInternal.computeSize(): Int {
}

if (methods.isNotEmpty()) {
__result = methods.sumOf { it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) }
__result += methods.sumOf { it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) }
}

if (options.isNotEmpty()) {
__result = options.sumOf { it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag(3, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) }
__result += options.sumOf { it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag(3, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) }
}

if (version.isNotEmpty()) {
Expand All @@ -273,10 +272,10 @@ private fun com.google.protobuf.kotlin.ApiInternal.computeSize(): Int {
}

if (mixins.isNotEmpty()) {
__result = mixins.sumOf { it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag(6, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) }
__result += mixins.sumOf { it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag(6, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) }
}

if (com.google.protobuf.kotlin.Syntax.SYNTAX_PROTO2 != syntax) {
if (syntax != com.google.protobuf.kotlin.Syntax.SYNTAX_PROTO2) {
__result += (kotlinx.rpc.protobuf.internal.WireSize.tag(7, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.enum(syntax.number))
}

Expand Down Expand Up @@ -324,7 +323,7 @@ public fun com.google.protobuf.kotlin.MethodInternal.encodeWith(encoder: kotlinx
}
}

if (com.google.protobuf.kotlin.Syntax.SYNTAX_PROTO2 != syntax) {
if (syntax != com.google.protobuf.kotlin.Syntax.SYNTAX_PROTO2) {
encoder.writeEnum(fieldNr = 7, value = syntax.number)
}
}
Expand Down Expand Up @@ -370,6 +369,8 @@ public fun com.google.protobuf.kotlin.MethodInternal.Companion.decodeWith(msg: c
}
}
}

msg.checkRequiredFields()
}

private fun com.google.protobuf.kotlin.MethodInternal.computeSize(): Int {
Expand All @@ -395,10 +396,10 @@ private fun com.google.protobuf.kotlin.MethodInternal.computeSize(): Int {
}

if (options.isNotEmpty()) {
__result = options.sumOf { it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag(6, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) }
__result += options.sumOf { it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag(6, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) }
}

if (com.google.protobuf.kotlin.Syntax.SYNTAX_PROTO2 != syntax) {
if (syntax != com.google.protobuf.kotlin.Syntax.SYNTAX_PROTO2) {
__result += (kotlinx.rpc.protobuf.internal.WireSize.tag(7, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.enum(syntax.number))
}

Expand Down Expand Up @@ -445,6 +446,8 @@ public fun com.google.protobuf.kotlin.MixinInternal.Companion.decodeWith(msg: co
}
}
}

msg.checkRequiredFields()
}

private fun com.google.protobuf.kotlin.MixinInternal.computeSize(): Int {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ public class DurationInternal: com.google.protobuf.kotlin.Duration, kotlinx.rpc.
kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException {
com.google.protobuf.kotlin.DurationInternal.decodeWith(msg, it)
}
msg.checkRequiredFields()
return msg
}
}
Expand Down Expand Up @@ -81,6 +80,8 @@ public fun com.google.protobuf.kotlin.DurationInternal.Companion.decodeWith(msg:
}
}
}

msg.checkRequiredFields()
}

private fun com.google.protobuf.kotlin.DurationInternal.computeSize(): Int {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ public class EmptyInternal: com.google.protobuf.kotlin.Empty, kotlinx.rpc.protob
kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException {
com.google.protobuf.kotlin.EmptyInternal.decodeWith(msg, it)
}
msg.checkRequiredFields()
return msg
}
}
Expand Down Expand Up @@ -64,6 +63,8 @@ public fun com.google.protobuf.kotlin.EmptyInternal.Companion.decodeWith(msg: co
}
}
}

msg.checkRequiredFields()
}

private fun com.google.protobuf.kotlin.EmptyInternal.computeSize(): Int {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ public class FieldMaskInternal: com.google.protobuf.kotlin.FieldMask, kotlinx.rp
kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException {
com.google.protobuf.kotlin.FieldMaskInternal.decodeWith(msg, it)
}
msg.checkRequiredFields()
return msg
}
}
Expand Down Expand Up @@ -75,12 +74,14 @@ public fun com.google.protobuf.kotlin.FieldMaskInternal.Companion.decodeWith(msg
}
}
}

msg.checkRequiredFields()
}

private fun com.google.protobuf.kotlin.FieldMaskInternal.computeSize(): Int {
var __result = 0
if (paths.isNotEmpty()) {
__result = paths.sumOf { kotlinx.rpc.protobuf.internal.WireSize.string(it) + kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) }
__result += paths.sumOf { kotlinx.rpc.protobuf.internal.WireSize.string(it) + kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) }
}

return __result
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ public class SourceContextInternal: com.google.protobuf.kotlin.SourceContext, ko
kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException {
com.google.protobuf.kotlin.SourceContextInternal.decodeWith(msg, it)
}
msg.checkRequiredFields()
return msg
}
}
Expand Down Expand Up @@ -72,6 +71,8 @@ public fun com.google.protobuf.kotlin.SourceContextInternal.Companion.decodeWith
}
}
}

msg.checkRequiredFields()
}

private fun com.google.protobuf.kotlin.SourceContextInternal.computeSize(): Int {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ public class StructInternal: com.google.protobuf.kotlin.Struct, kotlinx.rpc.prot
kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException {
com.google.protobuf.kotlin.StructInternal.decodeWith(msg, it)
}
msg.checkRequiredFields()
return msg
}
}
Expand Down Expand Up @@ -78,7 +77,6 @@ public class ValueInternal: com.google.protobuf.kotlin.Value, kotlinx.rpc.protob
kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException {
com.google.protobuf.kotlin.ValueInternal.decodeWith(msg, it)
}
msg.checkRequiredFields()
return msg
}
}
Expand Down Expand Up @@ -112,7 +110,6 @@ public class ListValueInternal: com.google.protobuf.kotlin.ListValue, kotlinx.rp
kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException {
com.google.protobuf.kotlin.ListValueInternal.decodeWith(msg, it)
}
msg.checkRequiredFields()
return msg
}
}
Expand Down Expand Up @@ -181,6 +178,8 @@ public fun com.google.protobuf.kotlin.StructInternal.Companion.decodeWith(msg: c
}
}
}

msg.checkRequiredFields()
}

private fun com.google.protobuf.kotlin.StructInternal.computeSize(): Int {
Expand Down Expand Up @@ -293,6 +292,8 @@ public fun com.google.protobuf.kotlin.ValueInternal.Companion.decodeWith(msg: co
}
}
}

msg.checkRequiredFields()
}

private fun com.google.protobuf.kotlin.ValueInternal.computeSize(): Int {
Expand Down Expand Up @@ -367,12 +368,14 @@ public fun com.google.protobuf.kotlin.ListValueInternal.Companion.decodeWith(msg
}
}
}

msg.checkRequiredFields()
}

private fun com.google.protobuf.kotlin.ListValueInternal.computeSize(): Int {
var __result = 0
if (values.isNotEmpty()) {
__result = values.sumOf { it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) }
__result += values.sumOf { it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) }
}

return __result
Expand Down Expand Up @@ -425,6 +428,8 @@ public fun com.google.protobuf.kotlin.StructInternal.FieldsEntryInternal.Compani
}
}
}

msg.checkRequiredFields()
}

private fun com.google.protobuf.kotlin.StructInternal.FieldsEntryInternal.computeSize(): Int {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ public class TimestampInternal: com.google.protobuf.kotlin.Timestamp, kotlinx.rp
kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException {
com.google.protobuf.kotlin.TimestampInternal.decodeWith(msg, it)
}
msg.checkRequiredFields()
return msg
}
}
Expand Down Expand Up @@ -81,6 +80,8 @@ public fun com.google.protobuf.kotlin.TimestampInternal.Companion.decodeWith(msg
}
}
}

msg.checkRequiredFields()
}

private fun com.google.protobuf.kotlin.TimestampInternal.computeSize(): Int {
Expand Down
Loading
Loading