-
Notifications
You must be signed in to change notification settings - Fork 2
Emit events for all known types #127
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
Merged
Merged
Changes from all commits
Commits
Show all changes
46 commits
Select commit
Hold shift + click to select a range
fdc909b
Emit events about all types
dmdashenkov a4f32df
Add a test for non-request files
dmdashenkov 1534077
Bump version
dmdashenkov 77a711d
Add doc
dmdashenkov c551eb9
Add definitions for a dependency-based view
dmdashenkov 643ad58
Implement a view collecting dependency file data
dmdashenkov b5963fd
Move some implementation details to `:compiler`
dmdashenkov f8ca578
Emit events for dependencies
dmdashenkov 9811ba2
More testing
dmdashenkov a412d59
Add file path in services and remove the `shouldGenerate` flag
dmdashenkov ea7025a
Split new model-building code into a separate file
dmdashenkov 47884bb
Assemble separate functions into a context-class
dmdashenkov b363bf2
Add missing type details
dmdashenkov 7a0617e
Add a test for ensuring event-based and procedure-based model builder…
dmdashenkov 85c211e
Clean up Proto definition
dmdashenkov b105840
Fix imports
dmdashenkov e078f86
More doc
dmdashenkov 281d9b1
Revert changes from `config`
dmdashenkov 2527f70
More details on the new compiler event
dmdashenkov 040fb73
Better naming
dmdashenkov ee687ae
Style fixes
dmdashenkov d6d2708
Make a destructing call more obvious
dmdashenkov f4c7a76
Fix a typo
dmdashenkov 83f51c7
Improve naming and add static imports
dmdashenkov 5de89bc
More static imports
dmdashenkov 514ce41
Yet more static imports
dmdashenkov e88a6bd
Yet more static imports
dmdashenkov 342ecc2
Use Kotlin DSL for Proto messages where possible
dmdashenkov 37ad5f3
Revert `config` changes
dmdashenkov 1a25dbd
Kotlinize message building
dmdashenkov 5ebf770
Use Kotest asasertions
dmdashenkov 6dddbbe
Better naming for the new view
dmdashenkov 796127d
Extract common functionality
dmdashenkov 51ed614
Simplify proto definition construction
dmdashenkov 07dea0f
Improve readability
dmdashenkov c477f1b
Fix type nullability
dmdashenkov c8b2a60
Refactor functions to avoid `this@smth`-s
dmdashenkov 0fa23c7
Extract duplicates
dmdashenkov d6133ec
Repackage event factories
dmdashenkov af59295
Fix typo
dmdashenkov cd18964
Add doc
dmdashenkov 113e558
Fix typo
dmdashenkov 518c8b2
Clear up imports and use Kotest where possible
dmdashenkov 8e207c1
Remove redundant `Companion` specifier
dmdashenkov 5a11ddd
Add static imports
dmdashenkov ff3ab1e
Use `val` instead of `fun`
dmdashenkov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
api/src/main/kotlin/io/spine/protodata/ProtoDeclaration.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| /* | ||
| * Copyright 2023, 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 | ||
| * | ||
| * http://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.protodata | ||
|
|
||
| import com.google.protobuf.Message | ||
| import io.spine.annotation.GeneratedMixin | ||
| import io.spine.annotation.Internal | ||
|
|
||
| /** | ||
| * A high-level Protobuf declaration, such as a message, an enum, or a service. | ||
| */ | ||
| @Internal | ||
| @GeneratedMixin | ||
| public interface ProtoDeclaration : Message { | ||
|
|
||
| /** | ||
| * Obtains the name of this Protobuf declaration. | ||
| */ | ||
| public val name: ProtoDeclarationName | ||
|
|
||
| /** | ||
| * The type URL of the type. | ||
| * | ||
| * A type URL contains the type URL prefix and the qualified name of the type separated by | ||
| * the slash (`/`) symbol. See the docs of `google.protobuf.Any.type_url` for more info. | ||
| */ | ||
| public val typeUrl: String | ||
| get() = name.typeUrl | ||
| } |
46 changes: 46 additions & 0 deletions
46
api/src/main/kotlin/io/spine/protodata/ProtoDeclarationName.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| /* | ||
| * Copyright 2023, 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 | ||
| * | ||
| * http://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.protodata | ||
|
|
||
| import com.google.protobuf.Message | ||
| import io.spine.annotation.GeneratedMixin | ||
| import io.spine.annotation.Internal | ||
|
|
||
| /** | ||
| * Name of a high-level Protobuf declaration. | ||
| */ | ||
| @Internal | ||
| @GeneratedMixin | ||
| public interface ProtoDeclarationName : Message { | ||
|
|
||
| /** | ||
| * Prints this name as a type URL. | ||
| * | ||
| * A type URL contains the type URL prefix and the qualified name of the type separated by | ||
| * the slash (`/`) symbol. See the docs of `google.protobuf.Any.type_url` for more info. | ||
| */ | ||
| public val typeUrl: String | ||
| } |
40 changes: 40 additions & 0 deletions
40
api/src/main/kotlin/io/spine/protodata/ServiceNameMixin.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| /* | ||
| * Copyright 2023, 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 | ||
| * | ||
| * http://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.protodata | ||
|
|
||
| import io.spine.annotation.GeneratedMixin | ||
| import io.spine.annotation.Internal | ||
|
|
||
| /** | ||
| * Name of a service declared in Protobuf. | ||
| */ | ||
| @Internal | ||
| @GeneratedMixin | ||
| public interface ServiceNameMixin : ProtoDeclarationName, ServiceNameOrBuilder { | ||
|
|
||
| override val typeUrl: String | ||
| get() = "$typeUrlPrefix/$packageName.$simpleName" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| /* | ||
| * Copyright 2023, 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 | ||
| * | ||
| * http://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.protodata | ||
|
|
||
| import io.spine.annotation.GeneratedMixin | ||
| import io.spine.annotation.Internal | ||
|
|
||
| /** | ||
| * Name of a message or enum type. | ||
| */ | ||
| @Internal | ||
| @GeneratedMixin | ||
| public interface TypeNameMixin : ProtoDeclarationName, TypeNameOrBuilder { | ||
|
|
||
| override val typeUrl: String | ||
| get() = "$typeUrlPrefix/${qualifiedName()}" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would be more precise with this name, so that Java- and Proto-level dependencies could be distinguished.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've updated the doc somewhat. I'd like to avoid adding the
Protoprefix because:TypeEntered,OptionDiscovered, etc., which do not specify the language either.