Skip to content
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 .buildscript/prepare_mkdocs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
set -ex

# Generate the API docs
./gradlew dokkaHtml
./gradlew dokkaGenerateHtml

# Copy in special files that GitHub wants in the project root.
cp CHANGELOG.md docs/changelog.md
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ import org.gradle.kotlin.dsl.get
import org.gradle.kotlin.dsl.getByType
import org.gradle.kotlin.dsl.register
import org.gradle.kotlin.dsl.withType
import org.jetbrains.dokka.gradle.DokkaTask
import org.jetbrains.dokka.gradle.DokkaExtension
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.dsl.KotlinJsProjectExtension
import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension
Expand Down Expand Up @@ -370,14 +370,6 @@ private class WireBuildExtensionImpl(private val project: Project) : WireBuildEx

val mavenPublishing = project.extensions.getByName("mavenPublishing") as MavenPublishBaseExtension
mavenPublishing.apply {
// The Gradle plugin publish plugin configures `wire-gradle-plugin` for us, and we don't need
// to configure `wire-bom`.
if (!project.isWireGradlePlugin && !project.isWireBom) {
// TODO(Benoit) Fix, this is failing with
// `SoftwareComponent with name 'java' not found.`
// configure(KotlinJvm(javadocJar = Dokka("dokkaHtml"), sourcesJar = true))
}

publishToMavenCentral(automaticRelease = true)
val inMemoryKey = project.findProperty("signingInMemoryKey") as String?
if (!inMemoryKey.isNullOrEmpty()) {
Expand Down Expand Up @@ -416,8 +408,10 @@ private class WireBuildExtensionImpl(private val project: Project) : WireBuildEx

if (project.isWireBom) return

project.tasks.withType(DokkaTask::class.java).configureEach {
outputDirectory.set(project.file("${project.rootDir}/docs/3.x/${project.name}"))
project.extensions.configure(DokkaExtension::class.java) {
dokkaPublications.named("html") {
outputDirectory.set(project.file("${project.rootDir}/docs/3.x/${project.name}"))
}
dokkaSourceSets.configureEach {
reportUndocumented.set(false)
skipDeprecated.set(true)
Expand Down
3 changes: 3 additions & 0 deletions wire-compiler/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ plugins {
application
kotlin("jvm")
id("org.jetbrains.kotlin.plugin.serialization")
id("org.jetbrains.dokka")
id("com.gradleup.shadow").apply(false)
}

Expand Down Expand Up @@ -32,4 +33,6 @@ dependencies {
testImplementation(libs.assertk)
testImplementation(libs.kotlin.test.junit)
testImplementation(projects.wireTestUtils)

dokka(projects.wireGradlePlugin)
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,9 @@ interface ProtoReader32 {

/**
* Begin a nested message. A call to this method will restrict the reader so that [nextTag]
* returns -1 when the message is complete. An accompanying call to [endMessage] must then occur
* with the opaque token returned from this method.
* returns -1 when the message is complete. An accompanying call to
* [endMessageAndGetUnknownFields] must then occur with the opaque token returned from this
* method.
*/
@Throws(IOException::class)
fun beginMessage(): Int
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class RuntimeMessageAdapter<M : Any, B : Any>(

/**
* Field bindings by index. The indexes are consistent across all related fields including
* [jsonNames], [jsonAlternateNames], and the result of [jsonAdapters].
* [jsonNames], [jsonAlternateNames], and the result of [writeAllFields]'s `jsonAdapters`.
*/
val fieldBindingsArray: Array<FieldOrOneOfBinding<M, B>> = fields.values.toTypedArray()
val jsonNames: List<String> = fieldBindingsArray.map { it.jsonName }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,10 @@ abstract class JsonIntegration<F, A> {
/** Returns an adapter that applies [jsonStringAdapter] to each value. */
abstract fun formatterAdapter(jsonStringAdapter: JsonFormatter<*>): A

/** Returns a message type that supports encoding and decoding JSON objects of type [type]. */
/**
* Returns a list of adapters that support encoding and decoding JSON objects of each specific
* message type.
*/
fun <M : Any, B : Any> jsonAdapters(
adapter: RuntimeMessageAdapter<M, B>,
framework: F,
Expand Down
Loading