Skip to content

Commit b0e83f6

Browse files
Merge pull request #49 from SpineEventEngine/policy-as-deprecated-alias
Restore `Policy` as a deprecated class
2 parents 61f4e45 + bd4ae77 commit b0e83f6

File tree

7 files changed

+80
-529
lines changed

7 files changed

+80
-529
lines changed

api-tests/build.gradle.kts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
import io.spine.dependency.lib.Protobuf
2828

2929
plugins {
30-
module
3130
protobuf
3231
prototap
3332
`test-module`
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/*
2+
* Copyright 2025, TeamDev. All rights reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Redistribution and use in source and/or binary forms, with or without
11+
* modification, must retain the above copyright notice and the following
12+
* disclaimer.
13+
*
14+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
15+
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
16+
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
17+
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
18+
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
19+
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
20+
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21+
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22+
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23+
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
24+
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25+
*/
26+
27+
package io.spine.tools.compiler.plugin
28+
29+
import io.spine.base.EventMessage
30+
31+
/**
32+
* Provided for backward compatibility during migration to [Reaction].
33+
*/
34+
@Deprecated("Use `Reaction` instead.", ReplaceWith("Reaction"))
35+
public abstract class Policy<E : EventMessage> : Reaction<E>()

api/src/main/kotlin/io/spine/tools/compiler/plugin/Reaction.kt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,23 +58,23 @@ import io.spine.tools.compiler.type.TypeSystem
5858
* }
5959
* ```
6060
*
61-
* Please note that when reacting on Protobuf Compiler events, one should mark them as
61+
* Note that when reacting on Protobuf Compiler events, one should mark them as
6262
* [@External][io.spine.core.External]. See the whole list of Protobuf compiler events
6363
* in `spine/compiler/events.proto`.
6464
*
6565
* One reaction only accepts one kind of events. Declaring multiple methods with
6666
* the [@React][io.spine.server.event.React] annotation causes a runtime error.
6767
*
68-
* The `whenever` method accepts a single event and produces an `Iterable` of events. In case if
69-
* you need to return a single event, use [Just][io.spine.server.event.Just].
68+
* The `whenever` method accepts a single event and produces an `Iterable` of events.
69+
* If you need to return a single event, use [Just][io.spine.server.event.Just].
7070
*
71-
* If there are a few events, see the descendants of [Tuple][io.spine.server.tuple.Tuple].
71+
* To return a few events, see the descendants of [Tuple][io.spine.server.tuple.Tuple].
7272
*
7373
* If there can be a few alternative events, see the descendants of
7474
* [Either][io.spine.server.tuple.Either].
7575
*
76-
* In case if one of the options does nothing at all, please use [io.spine.server.event.NoReaction]
77-
* as one of the event types.
76+
* If one of the options does nothing at all, use [io.spine.server.event.NoReaction]
77+
* as the event type.
7878
*
7979
* Finally, if there are multiple events of the same type, use a typed list,
8080
* e.g. `List<SomethingHappened>`.

buildSrc/src/main/kotlin/module.gradle.kts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ import io.spine.dependency.build.Ksp
3030
import io.spine.dependency.lib.Jackson
3131
import io.spine.dependency.lib.Protobuf
3232
import io.spine.dependency.local.Base
33-
import io.spine.dependency.local.CoreJava
3433
import io.spine.dependency.local.CoreJvm
3534
import io.spine.dependency.local.ToolBase
3635
import io.spine.dependency.local.Validation
36+
import io.spine.gradle.github.pages.updateGitHubPages
3737
import io.spine.gradle.javac.configureErrorProne
3838
import io.spine.gradle.javac.configureJavac
3939
import io.spine.gradle.javadoc.JavadocConfig
@@ -72,6 +72,7 @@ project.run {
7272

7373
afterEvaluate {
7474
configureTaskDependencies()
75+
setupDocPublishing()
7576
}
7677
}
7778

@@ -140,3 +141,16 @@ fun Module.configureKotlin() {
140141
}
141142
}
142143
}
144+
145+
/**
146+
* Configures documentation publishing for this subproject.
147+
*/
148+
fun Module.setupDocPublishing() {
149+
updateGitHubPages {
150+
rootFolder.set(rootDir)
151+
}
152+
153+
tasks.named("publish") {
154+
dependsOn("${project.path}:updateGitHubPages")
155+
}
156+
}

0 commit comments

Comments
 (0)