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

Prototype migration of dependencies to a published Version Catalog #145

Draft
wants to merge 145 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 125 commits
Commits
Show all changes
145 commits
Select commit Hold shift + click to select a range
f13912a
Implement a plugin skeleton
yevhenii-nadtochii May 12, 2022
40de0cd
Link a skeleton to the project
yevhenii-nadtochii May 12, 2022
876e753
[temporarily] Make workflow publish dependencies plugin to mavenLocal
yevhenii-nadtochii May 13, 2022
cdacc66
Apply plugin in settings files
yevhenii-nadtochii May 13, 2022
f73d91a
Migrate first portion of dependencies
yevhenii-nadtochii May 13, 2022
6223f80
Update reports
yevhenii-nadtochii May 13, 2022
7bff623
[temporarily] Make workflow publish settings plugin to mavenLocal
yevhenii-nadtochii May 13, 2022
82fd9e8
Migrate second portion of dependencies
yevhenii-nadtochii May 16, 2022
3e2cf05
Resolve a provider
yevhenii-nadtochii May 16, 2022
e8658f8
Fetch contributors automatically
yevhenii-nadtochii May 16, 2022
e580c66
Rename a method
yevhenii-nadtochii May 16, 2022
14227a0
Implement SpineVersionCatalogBuilder.kt
yevhenii-nadtochii May 16, 2022
ac3713d
Simplify SpineVersionCatalogBuilder.kt
yevhenii-nadtochii May 16, 2022
e60dc17
Don't use a hyphen
yevhenii-nadtochii May 16, 2022
90769f9
Annotate `unused` where needed
yevhenii-nadtochii May 16, 2022
a9dbff9
Migrate third portion of dependencies
yevhenii-nadtochii May 16, 2022
52f19ee
Implement a primitive test
yevhenii-nadtochii May 16, 2022
213fbbf
Implement a full-fledged functional test
yevhenii-nadtochii May 16, 2022
5339b08
Better DSL
yevhenii-nadtochii May 17, 2022
54c8691
Shortage `library()` to `lib()`
yevhenii-nadtochii May 17, 2022
1636d63
Migrate fourth portion of dependencies
yevhenii-nadtochii May 17, 2022
8d7a569
Implement `VersionCatalogEntry`
yevhenii-nadtochii May 17, 2022
b062f39
Merge all `Auto*` into `GoogleAuto` dependency
yevhenii-nadtochii May 17, 2022
b6b9b97
Get rid of Kotlin runtime warnings of `buildSrc`
yevhenii-nadtochii May 17, 2022
63fafc9
Try out `VersionCatalogEntry`
yevhenii-nadtochii May 17, 2022
3e9190e
Substitute catalog contributor with entry
yevhenii-nadtochii May 18, 2022
671127c
Refactor `VersionCatalogEntry`
yevhenii-nadtochii May 18, 2022
2e973ff
Extract property delegates into a separate file
yevhenii-nadtochii May 18, 2022
e7f5e2f
Migrate fifth portion of dependencies
yevhenii-nadtochii May 18, 2022
1013f62
Simplify a self-generic
yevhenii-nadtochii May 18, 2022
bd2f73c
Migrate sixth portion of dependencies
yevhenii-nadtochii May 18, 2022
552978f
Ask entry finder to resolve nested objects
yevhenii-nadtochii May 18, 2022
65d1821
Migrate the last portion of dependencies
yevhenii-nadtochii May 18, 2022
1fe8751
Document a functional test
yevhenii-nadtochii May 19, 2022
ef8926c
Document `Actions` type
yevhenii-nadtochii May 19, 2022
f739530
Unify possibilities to declare entry parts
yevhenii-nadtochii May 19, 2022
950938f
Extract delegate providers
yevhenii-nadtochii May 19, 2022
f2b756d
Polish dependencies
yevhenii-nadtochii May 19, 2022
c1720e0
Drop superfluous imports
yevhenii-nadtochii May 19, 2022
1719780
Drop superfluous imports
yevhenii-nadtochii May 19, 2022
d9c80db
Move delegates back to entry
yevhenii-nadtochii May 19, 2022
1c36844
Document `VersionCatalogEntry`
yevhenii-nadtochii May 19, 2022
d8ccfac
Document `SpineVersionCatalog`
yevhenii-nadtochii May 19, 2022
c1d8f8f
Document property delegation stuff
yevhenii-nadtochii May 19, 2022
4863e86
The plugin is published to mavenLocal during its build
yevhenii-nadtochii May 19, 2022
644db5a
Try out soft margin at 80
yevhenii-nadtochii May 19, 2022
ff03310
Start tidying up build script
yevhenii-nadtochii May 19, 2022
d9dc357
Make the plugin to only register the extension
yevhenii-nadtochii May 20, 2022
51ba241
Use extension to fetch a version catalog from the plugin
yevhenii-nadtochii May 20, 2022
8c7c47a
Start implement `io.spine.internal.catalog` package
yevhenii-nadtochii May 20, 2022
1924ca8
Workable implementation of `io.spine.internal.catalog` package
yevhenii-nadtochii May 21, 2022
32a245c
Move dependencies to `entry` package
yevhenii-nadtochii May 21, 2022
ef9efca
Migrate dependencies to entry dsl
yevhenii-nadtochii May 21, 2022
c2c5905
Make API of `LibraryEntryDsl` more strict
yevhenii-nadtochii May 21, 2022
6811b88
Simplify `PluginEntryDsl`
yevhenii-nadtochii May 21, 2022
a0166ef
Clean up after the previous Entry impl
yevhenii-nadtochii May 21, 2022
9388a86
Enhance entry loading mechanism
yevhenii-nadtochii May 22, 2022
afe95c0
Prevent repeated initialization of `CatalogEntry` declarations
yevhenii-nadtochii May 22, 2022
cf9a21e
Work in progress
yevhenii-nadtochii May 22, 2022
c2f38b5
Fix version inheritance in entries
yevhenii-nadtochii May 22, 2022
ab351d7
Hardcore `bundle(...)` accept `Any`
yevhenii-nadtochii May 23, 2022
1c4ca3c
Fix `ConcurrentModification`
yevhenii-nadtochii May 23, 2022
0f4cf6a
Drop `version.gradle.kts`
yevhenii-nadtochii May 23, 2022
42ebd2e
Document build files
yevhenii-nadtochii May 23, 2022
bd1e135
Don't repeat yourself
yevhenii-nadtochii May 23, 2022
1cdd8f2
Document API of the plugin's apply
yevhenii-nadtochii May 23, 2022
3965f0d
Don't run the code for development purposes in tests
yevhenii-nadtochii May 23, 2022
7c6bf60
Fix a bug when `PluginEntry` inherits a version when should not
yevhenii-nadtochii May 23, 2022
ba8794d
Implement a showcase `Dummy` dependency
yevhenii-nadtochii May 23, 2022
c99d849
Document `Dummy` entry
yevhenii-nadtochii May 23, 2022
41be4cd
Fix a typo
yevhenii-nadtochii May 23, 2022
088fd37
Clarify a comment
yevhenii-nadtochii May 23, 2022
a4b0215
Polish comments
yevhenii-nadtochii May 24, 2022
5d91bdd
Don't use Gradle internal classes
yevhenii-nadtochii May 25, 2022
b17746d
Use a multi-line comment when a comment consists of one or more parag…
yevhenii-nadtochii May 25, 2022
5e665f8
Add a brief description on `CatalogAlias` inheritors
yevhenii-nadtochii May 25, 2022
d895b8a
Implement `VersionEntry`
yevhenii-nadtochii May 26, 2022
6dcd2a9
Implement base unit tests
yevhenii-nadtochii May 26, 2022
bdd6d84
Implement `LibraryEntry`
yevhenii-nadtochii May 27, 2022
902fa0c
Drop `*Dsl` interfaces
yevhenii-nadtochii May 27, 2022
95d7311
Implement `BundleEntry`
yevhenii-nadtochii May 27, 2022
3df319d
Complete records hierarchy
yevhenii-nadtochii May 27, 2022
19fe096
Introduce entry notations
yevhenii-nadtochii May 27, 2022
2c04ab9
Make concrete entries provide its type-specific records
yevhenii-nadtochii May 27, 2022
85049ad
Implement `DependencyEntry`
yevhenii-nadtochii May 30, 2022
f5aaf83
Implement tests for the base `CatalogEntry`
yevhenii-nadtochii May 30, 2022
c98cea7
Re-visit test for `LibraryEntry`
yevhenii-nadtochii May 30, 2022
debddef
Implement `PluginEntryTest`
yevhenii-nadtochii May 30, 2022
448540b
Implement `DependencyEntryTest`
yevhenii-nadtochii May 30, 2022
91cd22f
Use data classes for catalog records
yevhenii-nadtochii May 30, 2022
e5c808c
Use resources to store files for functional test
yevhenii-nadtochii May 31, 2022
60dad3b
Document entry points
yevhenii-nadtochii May 31, 2022
a7a7a96
Migrate dependencies to new API
yevhenii-nadtochii May 31, 2022
4416249
Make the version be inherited by alias instead of value
yevhenii-nadtochii May 31, 2022
a286993
We don't have an actual plugin anymore
yevhenii-nadtochii May 31, 2022
18a8da5
Fix publishing
yevhenii-nadtochii May 31, 2022
6a0254b
First part of documentation.
yevhenii-nadtochii May 31, 2022
5dc562f
Document notations
yevhenii-nadtochii Jun 1, 2022
110fa19
Polish and document entries
yevhenii-nadtochii Jun 1, 2022
e5bf358
Implement AbstractVersionInheritingEntry.kt
yevhenii-nadtochii Jun 2, 2022
1c249a7
Refactor tests
yevhenii-nadtochii Jun 2, 2022
1251230
Complete documenting
yevhenii-nadtochii Jun 2, 2022
b42b7ac
Rename `SpineDependencies` to `SpineVersionCatalog`
yevhenii-nadtochii Jun 3, 2022
19bec92
Proofread docs
yevhenii-nadtochii Jun 3, 2022
227957e
Update reports
yevhenii-nadtochii Jun 3, 2022
e0f9b8f
Clean up temporary directory
yevhenii-nadtochii Jun 3, 2022
ec2a58a
Write "Maven local" instead of "MavenLocal"
yevhenii-nadtochii Jun 3, 2022
81fee2f
Drop superfluous lines
yevhenii-nadtochii Jun 3, 2022
9ec6ddb
Match the framework's major version
yevhenii-nadtochii Jun 3, 2022
a646794
Rename `functionalTest` to `func-test`
yevhenii-nadtochii Jun 3, 2022
9c52bd9
Simplify name of functional test
yevhenii-nadtochii Jun 3, 2022
53eb9d7
Polish docs for SpineVersionCatalogTest.kt
yevhenii-nadtochii Jun 6, 2022
0839e2a
Split version-catalog into several modules
yevhenii-nadtochii Jun 6, 2022
8222c96
Drop unused imports
yevhenii-nadtochii Jun 6, 2022
06371b6
Publish `api` module
yevhenii-nadtochii Jun 6, 2022
69e2dc4
Extract func-test into a separate module
yevhenii-nadtochii Jun 6, 2022
4742e03
Fix builds
yevhenii-nadtochii Jun 6, 2022
658316a
Don't specify `build` explicitly on publish
yevhenii-nadtochii Jun 6, 2022
5dc5b7d
Clarify difference between `CatalogNotation` and `CatalogRecord`
yevhenii-nadtochii Jun 6, 2022
2fe43c6
Bring down `when` closure to names of nested tests
yevhenii-nadtochii Jun 7, 2022
00a9322
Polish docs
yevhenii-nadtochii Jun 7, 2022
1820e04
Refactor build files
yevhenii-nadtochii Jun 7, 2022
8586583
Drop a mention of "skeleton" from docs to `VersionInheritingEntry`
yevhenii-nadtochii Jun 7, 2022
8aa258a
Add `import` directive to example snippet
yevhenii-nadtochii Jun 7, 2022
7d3d397
Write a README.md
yevhenii-nadtochii Jun 7, 2022
94235bd
Use a full name of Gradle's settings file in README.md
yevhenii-nadtochii Jun 7, 2022
9486741
Place a comment closer to its target
yevhenii-nadtochii Jun 8, 2022
6c074b1
Split a comment into two in `build.gradle.kts`
yevhenii-nadtochii Jun 8, 2022
58c9884
Rename `AlwaysReturnDelegate` to `MemoizingDelegate`
yevhenii-nadtochii Jun 8, 2022
afa5519
Merge `api` module into `catalog`
yevhenii-nadtochii Jun 8, 2022
3ca8a35
Leave only a single `CatalogEntry`
yevhenii-nadtochii Jun 8, 2022
c9601de
Don't expose concrete records
yevhenii-nadtochii Jun 9, 2022
4619471
Update documentation to `Alias` and `CatalogRecords`
yevhenii-nadtochii Jun 9, 2022
5b1698d
Write top-level docs for `CatalogEntry`
yevhenii-nadtochii Jun 9, 2022
54c1d3f
Drop a special treatment for extra libs named after the entry
yevhenii-nadtochii Jun 9, 2022
66608d5
Adjust tests to a single `CatalogEntry`
yevhenii-nadtochii Jun 10, 2022
e2c6cbc
Extract Alias-related code to `Alias` class
yevhenii-nadtochii Jun 10, 2022
e21c29b
Document public properties and methods of `CatalogEntry`
yevhenii-nadtochii Jun 10, 2022
7786049
Polish code and docs
yevhenii-nadtochii Jun 13, 2022
391abf9
Add examples of override to README
yevhenii-nadtochii Jun 13, 2022
77c8585
Update modules structure in README
yevhenii-nadtochii Jun 13, 2022
17aaf48
Don't use too wide `code` term
yevhenii-nadtochii Jun 13, 2022
35eb30f
Adjust text wrapping in numerated lists
yevhenii-nadtochii Jun 13, 2022
b9e00ae
Minor improvements to README.md
yevhenii-nadtochii Jun 14, 2022
f5199ae
Better describe rules of override
yevhenii-nadtochii Jun 15, 2022
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
4 changes: 4 additions & 0 deletions .github/workflows/build-on-ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ jobs:
- name: Pull config
run: git submodule update --init --recursive

- name: Prepare a version catalog in Maven local
shell: bash
run: cd version-catalog && ./gradlew publishToMavenLocal

- name: Build project and run tests
shell: bash
run: ./gradlew build --stacktrace
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/build-on-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ jobs:
- name: Pull config
run: git submodule update --init --recursive

- name: Prepare a version catalog in Maven local
shell: bash
run: cd version-catalog && ./gradlew publishToMavenLocal

- name: Build project and run tests
shell: cmd
# For the reason on `--no-daemon` see https://github.com/actions/cache/issues/454
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/increment-guard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ jobs:
- name: Pull config
run: git submodule update --init --recursive

- name: Prepare a version catalog in Maven local
shell: bash
run: cd version-catalog && ./gradlew publishToMavenLocal

- name: Check version is not yet published
shell: bash
run: ./gradlew checkVersionIncrement --stacktrace
3 changes: 2 additions & 1 deletion .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 2 additions & 7 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

75 changes: 56 additions & 19 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@ import com.google.protobuf.gradle.generateProtoTasks
import com.google.protobuf.gradle.id
import com.google.protobuf.gradle.protobuf
import com.google.protobuf.gradle.protoc
import io.spine.internal.dependency.ErrorProne
import io.spine.internal.dependency.JUnit
import io.spine.internal.dependency.Protobuf
import io.spine.internal.gradle.publish.PublishingRepos
import io.spine.internal.gradle.applyGitHubPackages
import io.spine.internal.gradle.applyStandard
Expand All @@ -52,12 +49,19 @@ import io.spine.internal.gradle.test.registerTestTasks
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

buildscript {
apply(from = "$rootDir/version.gradle.kts")

io.spine.internal.gradle.doApplyStandard(repositories)
io.spine.internal.gradle.doForceVersions(configurations)
io.spine.internal.gradle.doForceVersions(configurations, libs)

/*
Due to a bug, we can't apply scripts.

`version.gradle.kts` file is not applied, thus the version of mcJava is
declared right here.

val mcJavaVersion: String by extra
See issue: https://github.com/gradle/gradle/issues/20717
*/

val mcJavaVersion = "2.0.0-SNAPSHOT.83"
dependencies {
classpath("io.spine.tools:spine-mc-java:$mcJavaVersion")
}
Expand All @@ -75,8 +79,20 @@ plugins {
idea
`project-report`

id(io.spine.internal.dependency.Protobuf.GradlePlugin.id)
id(io.spine.internal.dependency.ErrorProne.GradlePlugin.id)
/*
As for now, Gradle doesn't provide API for applying plugins without version.
This is why we resolve a provider by `get()`.

See a feature request: https://github.com/gradle/gradle/issues/17968

Also, for these two lines below, IDEA reports a false-positive error.

See issue in Gradle: https://github.com/gradle/gradle/issues/20839
See issue in IDEA: https://youtrack.jetbrains.com/issue/KTIJ-19369/False-positive-can-t-be-called-in-this-context-by-implicit-recei
*/

id(libs.plugins.protobuf.get().pluginId)
id(libs.plugins.errorProne.get().pluginId)
}

spinePublishing {
Expand All @@ -91,27 +107,39 @@ spinePublishing {
cloudArtifactRegistry
)
}

dokkaJar {
enabled = true
}
}

allprojects {
apply(from = "$rootDir/version.gradle.kts")

/*
Due to a bug, we can't apply scripts.

`version.gradle.kts` file is not applied, thus the versions of spine libs
are declared right here.

See issue: https://github.com/gradle/gradle/issues/20717
*/

/** Versions of the Spine libraries that `time` depends on. */
extra["spineBaseVersion"] = "2.0.0-SNAPSHOT.91"
extra["javadocToolsVersion"] = "2.0.0-SNAPSHOT.75"

/** The version of this library. */
val versionToPublish by extra("2.0.0-SNAPSHOT.93")

group = "io.spine"
version = extra["versionToPublish"]!!
version = versionToPublish
}

subprojects {

apply {
plugin("java-library")
plugin("kotlin")
plugin("com.google.protobuf")
plugin("net.ltgt.errorprone")
plugin("pmd")
plugin("checkstyle")
plugin("idea")
plugin("pmd-settings")
Expand All @@ -126,19 +154,28 @@ subprojects {

val spineBaseVersion: String by extra
dependencies {
errorprone(ErrorProne.core)

/*
Gradle discourages cross-configuration of projects.
Thus, the direct access to `libs` in `allprojects` and `subprojects`
blocks is unavailable. But we still can use it from `rootProject`.

See the closed issue: https://github.com/gradle/gradle/issues/16634
*/

errorprone(rootProject.libs.errorProne.core)
api(kotlin("stdlib-jdk8"))

testImplementation("io.spine.tools:spine-testlib:$spineBaseVersion")
testImplementation(JUnit.runner)
testImplementation(rootProject.libs.jUnit.runner)
}

/**
* Force Error Prone dependencies to `2.10.0`, because in `2.11.0` an empty constructor in
* [com.google.errorprone.bugpatterns.CheckReturnValue] was removed leading to breaking the API.
*/
configurations {
forceVersions()
forceVersions(rootProject.libs)
all {
resolutionStrategy {
force(
Expand Down Expand Up @@ -199,7 +236,7 @@ subprojects {
protobuf {
generatedFilesBaseDir = generatedRootDir
protoc {
artifact = Protobuf.compiler
artifact = rootProject.libs.protobuf.compiler.get().toString()
}
generateProtoTasks {
all().forEach { task ->
Expand All @@ -218,7 +255,7 @@ subprojects {
rootFolder.set(rootDir)
}

// Apply the same IDEA module configuration for each of sub-projects.
// Apply the same IDEA module configuration for each of subprojects.
idea {
module {
with(generatedSourceDirs) {
Expand Down
155 changes: 56 additions & 99 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,11 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

/**
* This script uses two declarations of the constant [licenseReportVersion] because
* currently there is no way to define a constant _before_ a build script of `buildSrc`.
* We cannot use imports or do something else before the `buildscript` or `plugin` clauses.
*/

plugins {
java
groovy
`kotlin-dsl`
pmd
val licenseReportVersion = "2.1"
id("com.github.jk1.dependency-license-report").version(licenseReportVersion)
}

repositories {
Expand All @@ -45,105 +37,70 @@ repositories {
mavenCentral()
}

/**
* The version of Jackson used by `buildSrc`.
*
* Please keep this value in sync. with `io.spine.internal.dependency.Jackson.version`.
* It's not a requirement, but would be good in terms of consistency.
*/
val jacksonVersion = "2.13.0"

val googleAuthToolVersion = "2.1.2"
val licenseReportVersion = "2.1"
val grGitVersion = "3.1.1"

/**
* The version of the Kotlin Gradle plugin.
*
* Please check that this value matches one defined in
* [io.spine.internal.dependency.Kotlin.version].
*/
val kotlinVersion = "1.6.21"

/**
* The version of Guava used in `buildSrc`.
*
* Always use the same version as the one specified in [io.spine.internal.dependency.Guava].
* Otherwise, when testing Gradle plugins, clashes may occur.
*/
val guavaVersion = "31.1-jre"

/**
* The version of ErrorProne Gradle plugin.
*
* Please keep in sync. with [io.spine.internal.dependency.ErrorProne.GradlePlugin.version].
*
* @see <a href="https://github.com/tbroyer/gradle-errorprone-plugin/releases">
* Error Prone Gradle Plugin Releases</a>
*/
val errorProneVersion = "2.0.2"

/**
* The version of Protobuf Gradle Plugin.
*
* Please keep in sync. with [io.spine.internal.dependency.Protobuf.GradlePlugin.version].
*
* @see <a href="https://github.com/google/protobuf-gradle-plugin/releases">
* Protobuf Gradle Plugins Releases</a>
*/
val protobufPluginVersion = "0.8.18"

/**
* The version of Dokka Gradle Plugins.
*
* Please keep in sync with [io.spine.internal.dependency.Dokka.version].
*
* @see <a href="https://github.com/Kotlin/dokka/releases">
* Dokka Releases</a>
*/
val dokkaVersion = "1.6.20"
// Let's get rid of warnings about different Kotlin version on the classpath.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reading it again, I am thinking now, to which piece of code this comment relates? Perhaps, it is misplaced?

// Also, builds are more reproducible when dynamic version resolution is suppressed.

configurations.all {
resolutionStrategy {
// Force Kotlin lib versions avoiding using those bundled with Gradle.
failOnVersionConflict()
force(
"org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion",
"org.jetbrains.kotlin:kotlin-stdlib-common:$kotlinVersion",
"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlinVersion",
"org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlinVersion",
"org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion"
libs.apacheHttp.core,
libs.guava,
libs.httpClient.google,
libs.jackson.core,
libs.jackson.databind,
libs.jackson.dataformatXml,
libs.jackson.moduleKotlin,
libs.kotlin.reflect,
libs.kotlin.stdLib,
libs.kotlin.stdLib.common,
libs.kotlin.stdLib.jdk8,
libs.kotlinX.coroutines.core,
libs.kotlinX.coroutines.core.jvm,
libs.slf4J.api,
)
}
}

val jvmVersion = JavaLanguageVersion.of(11)

java {
toolchain.languageVersion.set(jvmVersion)
}

tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
kotlinOptions {
jvmTarget = jvmVersion.toString()
}
}

dependencies {
implementation("com.fasterxml.jackson.core:jackson-databind:$jacksonVersion")
implementation("com.fasterxml.jackson.dataformat:jackson-dataformat-xml:$jacksonVersion")
implementation("com.google.cloud.artifactregistry:artifactregistry-auth-common:$googleAuthToolVersion") {
exclude(group = "com.google.guava")
}
implementation("com.google.guava:guava:$guavaVersion")
api("com.github.jk1:gradle-license-report:$licenseReportVersion")
implementation("org.ajoberstar.grgit:grgit-core:${grGitVersion}")
implementation("net.ltgt.gradle:gradle-errorprone-plugin:${errorProneVersion}")

// Add explicit dependency to avoid warning on different Kotlin runtime versions.
implementation("org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion")
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion")

implementation("gradle.plugin.com.google.protobuf:protobuf-gradle-plugin:$protobufPluginVersion")
implementation("org.jetbrains.dokka:dokka-gradle-plugin:${dokkaVersion}")
implementation("org.jetbrains.dokka:dokka-base:${dokkaVersion}")
/*
We add the implementation dependency on the class of `libs` extension
in order to make the generated `LibrariesForLibs` available in `main`
source set.

It does not mean our dependencies will be available in `main` sources.
It means we can fetch them in a type-safe manner from a `Project` instance,
in which this extension is registered.

For example:
val libs = project.extensions.getByType<LibrariesForLibs>()
*/

implementation(files(libs.javaClass.superclass.protectionDomain.codeSource.location))

implementation(libs.errorProne.gradlePlugin)
implementation(libs.googleCloud.artifactRegistry.authCommon)
implementation(libs.grGit.core)
implementation(libs.guava)
implementation(libs.jackson.databind)
implementation(libs.jackson.dataformatXml)
implementation(libs.kotlin.gradlePlugin)
implementation(libs.licenseReport.gradlePlugin)
implementation(libs.protobuf.gradlePlugin)

/*
These guys below use a fat jar with Kotlin runtime inside. One more
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's be more polite and format here. They aren't "these guys".

Kotlin version. This is a reason for two warnings.

I'm not sure if we can just exclude those jars. It should be checked on
a repo where Dokka is used. And if not, leave a comment here, describing
why it is so.
*/

implementation(libs.dokka.gradlePlugin)
implementation(libs.dokka.basePlugin) {
exclude("org.jetbrains.dokka", "kotlin-analysis-compiler")
exclude("org.jetbrains.dokka", "kotlin-analysis-intellij")
}
}
Loading