Skip to content
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

Migrate to the latest version of ProtoData #12

Merged
merged 13 commits into from
Jul 31, 2024
Merged
Show file tree
Hide file tree
Changes from 12 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
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
[submodule "config"]
path = config
url = https://github.com/SpineEventEngine/config
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@
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
https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ git clone git@github.com:spine-examples/Hello-ProtoData.git
[ubuntu-build-badge]: https://github.com/spine-examples/Hello-ProtoData/actions/workflows/build-on-ubuntu.yml/badge.svg
[windows-build-badge]: https://github.com/spine-examples/Hello-ProtoData/actions/workflows/build-on-windows.yml/badge.svg
[license-badge]: https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg?style=flat
[apache-license]: http://www.apache.org/licenses/LICENSE-2.0
[apache-license]: https://www.apache.org/licenses/LICENSE-2.0

[proto3-options]: https://protobuf.dev/programming-guides/proto3/#options
[descriptor-proto]: https://github.com/protocolbuffers/protobuf/blob/main/src/google/protobuf/descriptor.proto
Expand Down
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 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
* 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
Expand Down Expand Up @@ -54,7 +54,7 @@ plugins {
id("net.ltgt.errorprone")
id("detekt-code-analysis")
id("com.google.protobuf")
id("io.spine.protodata") version "0.20.7"
id("io.spine.protodata") version "0.50.0"
idea
}

Expand Down
2 changes: 1 addition & 1 deletion buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 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
* 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
Expand Down
27 changes: 18 additions & 9 deletions buildSrc/src/main/kotlin/BuildExtensions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 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
* 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
Expand All @@ -30,7 +30,9 @@ import io.spine.internal.dependency.ErrorProne
import io.spine.internal.dependency.GradleDoctor
import io.spine.internal.dependency.Kotest
import io.spine.internal.dependency.Kover
import io.spine.internal.dependency.Ksp
import io.spine.internal.dependency.ProtoData
import io.spine.internal.dependency.ProtoTap
import io.spine.internal.dependency.Protobuf
import io.spine.internal.dependency.Spine
import io.spine.internal.gradle.standardToSpineSdk
Expand Down Expand Up @@ -63,9 +65,9 @@ fun ScriptHandlerScope.standardSpineSdkRepositories() {
*
* But for some plugins, it's impossible to apply them directly to a project.
* For example, when a plugin is not published to Gradle Portal, it can only be
* applied with buildscript's classpath. Thus, it's needed to leave some freedom
* applied with the buildscript's classpath. Thus, it's needed to leave some freedom
* upon how to apply them. In such cases, just a shortcut to a dependency object
* can be declared, without applying of the plugin in-place.
* can be declared without applying the plugin in-place.
*/
private const val ABOUT_DEPENDENCY_EXTENSIONS = ""

Expand All @@ -81,8 +83,9 @@ val PluginDependenciesSpec.mcJava: Spine.McJava
/**
* Shortcut to [ProtoData] dependency object.
*
* This plugin is in Gradle Portal. But when used in pair with [mcJava], it cannot be applied
* directly to a project. It is so, because [mcJava] uses [protoData] as its dependency.
* This plugin is published at Gradle Portal. But when used in a pair with [mcJava],
* it cannot be applied directly to a project.
* It is so, because [mcJava] uses [protoData] as its dependency.
* And buildscript's classpath ends up with both of them.
*/
val PluginDependenciesSpec.protoData: ProtoData
Expand All @@ -95,8 +98,8 @@ val PluginDependenciesSpec.protoData: ProtoData
* declared in auto-generated `org.gradle.kotlin.dsl.PluginAccessors.kt` file.
* It conflicts with our own declarations.
*
* Declaring of top-level shortcuts eliminates need in applying plugins
* using fully-qualified name of dependency objects.
* Declaring of top-level shortcuts eliminates the need in applying plugins
* using fully qualified name of dependency objects.
*
* It is still possible to apply a plugin with a custom version, if needed.
* Just declare a version again on the returned [PluginDependencySpec].
Expand All @@ -117,6 +120,9 @@ val PluginDependenciesSpec.errorprone: PluginDependencySpec
val PluginDependenciesSpec.protobuf: PluginDependencySpec
get() = id(Protobuf.GradlePlugin.id)

val PluginDependenciesSpec.prototap: PluginDependencySpec
get() = id(ProtoTap.gradlePluginId).version(ProtoTap.version)

val PluginDependenciesSpec.`gradle-doctor`: PluginDependencySpec
get() = id(GradleDoctor.pluginId).version(GradleDoctor.version)

Expand All @@ -128,13 +134,16 @@ val PluginDependenciesSpec.kotest: PluginDependencySpec
val PluginDependenciesSpec.kover: PluginDependencySpec
get() = id(Kover.id).version(Kover.version)

val PluginDependenciesSpec.ksp: PluginDependencySpec
get() = id(Ksp.id).version(Ksp.version)

/**
* Configures the dependencies between third-party Gradle tasks
* and those defined via ProtoData and Spine Model Compiler.
*
* It is required in order to avoid warnings in build logs, detecting the undeclared
* It is required to avoid warnings in build logs, detecting the undeclared
* usage of Spine-specific task output by other tasks,
* e.g. the output of `launchProtoData` is used by `compileKotlin`.
* e.g., the output of `launchProtoData` is used by `compileKotlin`.
*/
@Suppress("unused")
fun Project.configureTaskDependencies() {
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/src/main/kotlin/BuildSettings.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 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
* 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
Expand Down
7 changes: 6 additions & 1 deletion buildSrc/src/main/kotlin/DependencyResolution.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 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
* 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
Expand Down Expand Up @@ -43,6 +43,7 @@ import io.spine.internal.dependency.Jackson
import io.spine.internal.dependency.JavaDiffUtils
import io.spine.internal.dependency.Kotest
import io.spine.internal.dependency.Kotlin
import io.spine.internal.dependency.KotlinX
import io.spine.internal.dependency.OpenTest4J
import io.spine.internal.dependency.Protobuf
import io.spine.internal.dependency.Slf4J
Expand Down Expand Up @@ -78,6 +79,7 @@ fun doForceVersions(configurations: ConfigurationContainer) {
spine.toolBase,
spine.server,
protoData.pluginLib,
protoData.lib,
logging.lib,
validation.runtime
)
Expand Down Expand Up @@ -117,6 +119,9 @@ private fun ResolutionStrategy.forceProductionDependencies() {
Kotlin.stdLibCommon,
Kotlin.stdLibJdk7,
Kotlin.stdLibJdk8,
KotlinX.Coroutines.core,
KotlinX.Coroutines.jvm,
KotlinX.Coroutines.jdk8,
Protobuf.GradlePlugin.lib,
Protobuf.libs,
Slf4J.lib
Expand Down
45 changes: 45 additions & 0 deletions buildSrc/src/main/kotlin/build-proto-model.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/*
* 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
*
* 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.
*/

@file:Suppress("RemoveRedundantQualifierName")

import io.spine.internal.dependency.Protobuf
import io.spine.internal.dependency.Spine.McJava

/**
* The dependency onto Spine Validation causes the circular dependency in this Gradle project.
* Therefore, we disable the validation altogether.
*/
System.setProperty("spine.internal.validation.disabled", "true")

apply {
plugin(Protobuf.GradlePlugin.id)
plugin(McJava.pluginId)
}

dependencies {
Protobuf.libs.forEach { "api"(it) }
}
2 changes: 1 addition & 1 deletion buildSrc/src/main/kotlin/compile-protobuf.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 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
* 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
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/src/main/kotlin/config-tester.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 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
* 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
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/src/main/kotlin/detekt-code-analysis.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 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
* 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 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
* 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
Expand Down
14 changes: 13 additions & 1 deletion buildSrc/src/main/kotlin/io/spine/internal/dependency/Auto.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 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
* 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
Expand Down Expand Up @@ -47,3 +47,15 @@ object AutoValue {
private const val version = "1.10.2"
const val annotations = "com.google.auto.value:auto-value-annotations:${version}"
}


// https://github.com/ZacSweers/auto-service-ksp
object AutoServiceKsp {
/**
* The latest version compatible with Kotlin 1.8.22.
*
* @see Ksp.version
*/
private const val version = "1.1.0"
const val processor = "dev.zacsweers.autoservice:auto-service-ksp:$version"
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 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
* 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 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
* 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 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
* 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 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
* 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 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
* 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 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
* 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 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
* 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 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
* 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 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
* 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 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
* 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 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
* 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 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
* 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 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
* 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
Expand Down
Loading
Loading