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
1 change: 0 additions & 1 deletion api-tests/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
import io.spine.dependency.lib.Protobuf

plugins {
module
protobuf
prototap
`test-module`
Expand Down
35 changes: 35 additions & 0 deletions api/src/main/kotlin/io/spine/tools/compiler/plugin/Policy.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
* Copyright 2025, TeamDev. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Redistribution and use in source and/or binary forms, with or without
* modification, must retain the above copyright notice and the following
* disclaimer.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

package io.spine.tools.compiler.plugin

import io.spine.base.EventMessage

/**
* Provided for backward compatibility during migration to [Reaction].
*/
@Deprecated("Use `Reaction` instead.", ReplaceWith("Reaction"))
public abstract class Policy<E : EventMessage> : Reaction<E>()
12 changes: 6 additions & 6 deletions api/src/main/kotlin/io/spine/tools/compiler/plugin/Reaction.kt
Original file line number Diff line number Diff line change
Expand Up @@ -58,23 +58,23 @@ import io.spine.tools.compiler.type.TypeSystem
* }
* ```
*
* Please note that when reacting on Protobuf Compiler events, one should mark them as
* Note that when reacting on Protobuf Compiler events, one should mark them as
* [@External][io.spine.core.External]. See the whole list of Protobuf compiler events
* in `spine/compiler/events.proto`.
*
* One reaction only accepts one kind of events. Declaring multiple methods with
* the [@React][io.spine.server.event.React] annotation causes a runtime error.
*
* The `whenever` method accepts a single event and produces an `Iterable` of events. In case if
* you need to return a single event, use [Just][io.spine.server.event.Just].
* The `whenever` method accepts a single event and produces an `Iterable` of events.
* If you need to return a single event, use [Just][io.spine.server.event.Just].
*
* If there are a few events, see the descendants of [Tuple][io.spine.server.tuple.Tuple].
* To return a few events, see the descendants of [Tuple][io.spine.server.tuple.Tuple].
*
* If there can be a few alternative events, see the descendants of
* [Either][io.spine.server.tuple.Either].
*
* In case if one of the options does nothing at all, please use [io.spine.server.event.NoReaction]
* as one of the event types.
* If one of the options does nothing at all, use [io.spine.server.event.NoReaction]
* as the event type.
*
* Finally, if there are multiple events of the same type, use a typed list,
* e.g. `List<SomethingHappened>`.
Expand Down
16 changes: 15 additions & 1 deletion buildSrc/src/main/kotlin/module.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ import io.spine.dependency.build.Ksp
import io.spine.dependency.lib.Jackson
import io.spine.dependency.lib.Protobuf
import io.spine.dependency.local.Base
import io.spine.dependency.local.CoreJava
import io.spine.dependency.local.CoreJvm
import io.spine.dependency.local.ToolBase
import io.spine.dependency.local.Validation
import io.spine.gradle.github.pages.updateGitHubPages
import io.spine.gradle.javac.configureErrorProne
import io.spine.gradle.javac.configureJavac
import io.spine.gradle.javadoc.JavadocConfig
Expand Down Expand Up @@ -72,6 +72,7 @@ project.run {

afterEvaluate {
configureTaskDependencies()
setupDocPublishing()
}
}

Expand Down Expand Up @@ -140,3 +141,16 @@ fun Module.configureKotlin() {
}
}
}

/**
* Configures documentation publishing for this subproject.
*/
fun Module.setupDocPublishing() {
updateGitHubPages {
rootFolder.set(rootDir)
}

tasks.named("publish") {
dependsOn("${project.path}:updateGitHubPages")
}
}
Loading
Loading