Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add beta to reflect and fix publishing #257

Merged
merged 1 commit into from
May 12, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
distribution: corretto
java-version: 17
- name: Publish
run: publishAllPublicationsToMavenCentral publishPlugins --no-configuration-cache --no-stacktrace
run: ./gradlew publishAllPublicationsToMavenCentral publishPlugins --no-configuration-cache --no-stacktrace
env:
PGP_KEY: ${{ secrets.PGP_KEY }}
PGP_PASSWORD: ${{ secrets.PGP_PASSWORD }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,15 @@ package protokt.v1.google.protobuf
import com.google.protobuf.Descriptors.FieldDescriptor
import com.google.protobuf.Descriptors.FieldDescriptor.Type
import com.google.protobuf.DynamicMessage
import protokt.v1.Beta
import protokt.v1.Bytes
import protokt.v1.Message

@Beta
fun Message.toDynamicMessage(context: RuntimeContext): DynamicMessage =
context.convertValue(this) as DynamicMessage

@Beta
fun Message.hasField(field: FieldDescriptor): Boolean {
val value = getField(field)

Expand All @@ -36,6 +39,7 @@ fun Message.hasField(field: FieldDescriptor): Boolean {
}
}

@Beta
fun Message.getField(field: FieldDescriptor) =
ProtoktReflect.getField(this, field)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import com.google.protobuf.UnknownFieldSet.Field
import com.google.protobuf.UnsafeByteOperations
import com.google.protobuf.WireFormat
import com.toasttab.protokt.v1.ProtoktProtos
import protokt.v1.Beta
import protokt.v1.Bytes
import protokt.v1.Converter
import protokt.v1.Enum
Expand All @@ -39,6 +40,7 @@ import protokt.v1.reflect.typeName
import kotlin.Any
import kotlin.reflect.full.findAnnotation

@Beta
class RuntimeContext internal constructor(
descriptors: Iterable<Descriptors.Descriptor>,
private val classLookup: ClassLookup
Expand Down