wire
5.5.1-okio-fork-2indexedSchema compiler and runtime for protobuf: generates strongly-typed message models, handles binary encoding/decoding, offers Moshi/Gson JSON adapters, and supports Okio relocation for compatibility.
Schema compiler and runtime for protobuf: generates strongly-typed message models, handles binary encoding/decoding, offers Moshi/Gson JSON adapters, and supports Okio relocation for compatibility.
See the project website for documentation and APIs.
Wire is the best solution to manage your protobuf schemas!
This fork is based on the wire_5.x branch and publishes artifacts under the
io.github.wangbax namespace.
It is being adapted to work with a source-level shaded Okio fork so
applications that still depend on okio 1.x can use Wire without depending on
the original okio 3.x package name at runtime.
This fork is currently published as 5.5.1-okio-fork-2.
If your client only uses Wire-generated Message types and protobuf
encoding/decoding, wire-runtime is enough.
If you also need Moshi or Gson adapters, add the corresponding adapter module.
Gradle
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath("io.github.wangbax:wire-gradle-plugin:5.5.1-okio-fork-2")
}
}
apply(plugin = "com.squareup.wire")
dependencies {
implementation("io.github.wangbax:wire-runtime:5.5.1-okio-fork-2")
// Optional JSON adapters.
// implementation("io.github.wangbax:wire-gson-support:5.5.1-okio-fork-2")
// implementation("io.github.wangbax:wire-moshi-adapter:5.5.1-okio-fork-2")
}
wire {
kotlin {
okioPackage = "com.squareup.wire.shaded.okio"
}
}
wire-grpc-client is intentionally not published in this fork yet. If your
client only needs protobuf model generation, protobuf encoding/decoding, or
JSON adapters, you do not need it.
CLI
wire-compiler \
--proto_path=src/main/proto \
--kotlin_out=build/generated/source/wire \
--okio_package=com.squareup.wire.shaded.okio \
path/to/your.proto
After regeneration, the generated models will import
com.squareup.wire.shaded.okio.ByteString, so they can run alongside
applications that still depend on okio 1.x.
Copyright 2013 Square, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance the License.
You may obtain a copy of the License at
https:
Unless applicable law agreed to writing, software
distributed under the License distributed an BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express implied.
See the License the specific language governing permissions
limitations under the License.
io.github.wangbax:okio and generated code targets
com.squareup.wire.shaded.okio.*.wire-grpc-api so
codegen is less tightly coupled to the OkHttp-backed wire-grpc-client
implementation.--okio_package=com.squareup.wire.shaded.okio.okioPackage = "com.squareup.wire.shaded.okio".wire-runtime,
wire-gson-support, and wire-moshi-adapter.wire-grpc-client is not part of the current integration yet because
OkHttp's public JVM APIs still expose original okio.* types.wire-grpc-api
directly; it is primarily an internal split to support generators and build
tooling.Surfaced from shared tags and platforms — no rankings paid for.