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

Bump Base #110

Merged
merged 6 commits into from
Dec 15, 2024
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
2 changes: 1 addition & 1 deletion .github/workflows/gradle-wrapper-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ jobs:
uses: actions/checkout@v4

- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v1
uses: gradle/actions/wrapper-validation@v4
73 changes: 73 additions & 0 deletions .github/workflows/remove-obsolete-artifacts-from-packages.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
#
# Periodically removes obsolete artifacts from GitHub Packages.
#
# Only non-release artifacts—those containing "SNAPSHOT" in their version name—are eligible
# for removal. The latest non-release artifacts will be retained, with the exact number determined
# by the `VERSION_COUNT_TO_KEEP` environment variable.
#
# Please note the following details:
#
# 1. An artifact cannot be deleted if it is public and has been downloaded more than 5,000 times.
# In this scenario, contact GitHub support for further assistance.
#
# 2. This workflow only applies to artifacts published from this repository.
#
# 3. A maximum of 100 artifacts can be removed per run from each package;
# if there are more than 100 obsolete artifacts, either manually restart the workflow
# or wait for the next scheduled removal.
#
# 4. When artifacts with version `x.x.x-SNAPSHOT` are published, GitHub automatically appends
# the current timestamp, resulting in versions like `x.x.x-SNAPSHOT.20241024.173759`.
# All such artifacts are grouped into one package and treated as a single package
# in GitHub Packages with the version `x.x.x-SNAPSHOT`. Consequently, it is not possible
# to remove obsolete versions within a package; only the entire package can be deleted.
#

name: Remove obsolete Maven artifacts from GitHub Packages

on:
schedule:
- cron: '0 0 * * *' # Run every day at midnight.

env:
VERSION_COUNT_TO_KEEP: 5 # Number of most recent SNAPSHOT versions to retain.

jobs:
retrieve-package-names:
name: Retrieve the package names published from this repository
runs-on: ubuntu-latest
outputs:
package-names: ${{ steps.request-package-names.outputs.package-names }}
steps:
- uses: actions/checkout@v4
with:
submodules: 'true'

- name: Retrieve the names of packages
id: request-package-names
shell: bash
run: |
repoName=$(echo ${{ github.repository }} | cut -d '/' -f2)
chmod +x ./config/scripts/request-package-names.sh
./config/scripts/request-package-names.sh ${{ github.token }} \
$repoName ${{ github.repository_owner }} ./package-names.json
echo "package-names=$(<./package-names.json)" >> $GITHUB_OUTPUT

delete-obsolete-artifacts:
name: Remove obsolete artifacts published from this repository to GitHub Packages
needs: retrieve-package-names
runs-on: ubuntu-latest
strategy:
matrix:
package-name: ${{ fromJson(needs.retrieve-package-names.outputs.package-names) }}
steps:
- name: Remove obsolete artifacts from '${{ matrix.package-name }}' package
uses: actions/delete-package-versions@v5
with:
owner: ${{ github.repository_owner }}
package-name: ${{ matrix.package-name }}
package-type: 'maven'
token: ${{ github.token }}
min-versions-to-keep: ${{ env.VERSION_COUNT_TO_KEEP }}
# Ignores artifacts that do not contain the word "SNAPSHOT".
ignore-versions: '^(?!.+SNAPSHOT).*$'
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@

# Gradle build files
**/build/**
!**/src/**/build/**

# Build files produced by the IDE
**/out/**
Expand Down
6 changes: 3 additions & 3 deletions .idea/kotlinc.xml

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

24 changes: 12 additions & 12 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@

@file:Suppress("RemoveRedundantQualifierName") // To prevent IDEA replacing FQN imports.

import io.spine.internal.dependency.Dokka
import io.spine.internal.gradle.publish.PublishingRepos
import io.spine.internal.gradle.publish.spinePublishing
import io.spine.internal.gradle.report.coverage.JacocoConfig
import io.spine.internal.gradle.report.license.LicenseReporter
import io.spine.internal.gradle.report.pom.PomGenerator
import io.spine.internal.gradle.standardToSpineSdk
import io.spine.dependency.build.Dokka
import io.spine.gradle.publish.PublishingRepos
import io.spine.gradle.publish.spinePublishing
import io.spine.gradle.report.coverage.JacocoConfig
import io.spine.gradle.report.license.LicenseReporter
import io.spine.gradle.report.pom.PomGenerator
import io.spine.gradle.standardToSpineSdk
import org.jetbrains.dokka.gradle.DokkaMultiModuleTask

buildscript {
Expand All @@ -43,11 +43,11 @@ buildscript {
resolutionStrategy {
@Suppress("DEPRECATION")
force(
io.spine.internal.dependency.spine.Spine.base,
io.spine.internal.dependency.spine.Spine.reflect,
io.spine.internal.dependency.spine.Validation.java,
io.spine.internal.dependency.Protobuf.GradlePlugin.lib,
io.spine.internal.dependency.Kotlin.stdLibJdk8
io.spine.dependency.local.Spine.base,
io.spine.dependency.local.Spine.reflect,
io.spine.dependency.local.Validation.java,
io.spine.dependency.lib.Protobuf.GradlePlugin.lib,
io.spine.dependency.lib.Kotlin.stdLibJdk8
)
}
}
Expand Down
24 changes: 13 additions & 11 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

import org.jetbrains.kotlin.gradle.dsl.JvmTarget

/**
* 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`.
Expand Down Expand Up @@ -51,7 +53,7 @@ repositories {
/**
* The version of Jackson used by `buildSrc`.
*
* Please keep this value in sync with [io.spine.internal.dependency.Jackson.version].
* Please keep this value in sync with [io.spine.dependency.lib.Jackson.version].
* It is not a requirement but would be good in terms of consistency.
*/
val jacksonVersion = "2.15.3"
Expand All @@ -73,23 +75,23 @@ val grGitVersion = "4.1.1"
/**
* The version of the Kotlin Gradle plugin and Kotlin binaries used by the build process.
*
* This version may change from the [version of Kotlin][io.spine.internal.dependency.Kotlin.version]
* This version may change from the [version of Kotlin][io.spine.dependency.lib.Kotlin.version]
* used by the project.
*/
val kotlinVersion = "1.8.22"

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

/**
* The version of ErrorProne Gradle plugin.
*
* Please keep in sync. with [io.spine.internal.dependency.ErrorProne.GradlePlugin.version].
* Please keep in sync. with [io.spine.dependency.build.ErrorProne.GradlePlugin.version].
*
* @see <a href="https://github.com/tbroyer/gradle-errorprone-plugin/releases">
* Error Prone Gradle Plugin Releases</a>
Expand All @@ -99,7 +101,7 @@ val errorPronePluginVersion = "3.1.0"
/**
* The version of Protobuf Gradle Plugin.
*
* Please keep in sync. with [io.spine.internal.dependency.Protobuf.GradlePlugin.version].
* Please keep in sync. with [io.spine.dependency.lib.Protobuf.GradlePlugin.version].
*
* @see <a href="https://github.com/google/protobuf-gradle-plugin/releases">
* Protobuf Gradle Plugins Releases</a>
Expand All @@ -109,7 +111,7 @@ val protobufPluginVersion = "0.9.4"
/**
* The version of Dokka Gradle Plugins.
*
* Please keep in sync with [io.spine.internal.dependency.Dokka.version].
* Please keep in sync with [io.spine.dependency.build.Dokka.version].
*
* @see <a href="https://github.com/Kotlin/dokka/releases">
* Dokka Releases</a>
Expand All @@ -124,12 +126,12 @@ val dokkaVersion = "1.9.20"
val detektVersion = "1.23.0"

/**
* @see [io.spine.internal.dependency.Kotest]
* @see [io.spine.dependency.test.Kotest]
*/
val kotestJvmPluginVersion = "0.4.10"

/**
* @see [io.spine.internal.dependency.Kover]
* @see [io.spine.dependency.test.Kover]
*/
val koverVersion = "0.7.2"

Expand Down Expand Up @@ -162,9 +164,9 @@ java {
toolchain.languageVersion.set(jvmVersion)
}

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

Expand Down
20 changes: 10 additions & 10 deletions buildSrc/src/main/kotlin/BuildExtensions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,16 @@

@file:Suppress("UnusedReceiverParameter", "unused", "TopLevelPropertyNaming", "ObjectPropertyName")

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.Protobuf
import io.spine.internal.dependency.spine.McJava
import io.spine.internal.dependency.spine.ProtoData
import io.spine.internal.dependency.spine.ProtoTap
import io.spine.internal.gradle.standardToSpineSdk
import io.spine.dependency.build.ErrorProne
import io.spine.dependency.build.GradleDoctor
import io.spine.dependency.build.Ksp
import io.spine.dependency.lib.Protobuf
import io.spine.dependency.local.McJava
import io.spine.dependency.local.ProtoData
import io.spine.dependency.local.ProtoTap
import io.spine.dependency.test.Kotest
import io.spine.dependency.test.Kover
import io.spine.gradle.standardToSpineSdk
import org.gradle.api.Project
import org.gradle.api.Task
import org.gradle.api.tasks.JavaExec
Expand Down
61 changes: 31 additions & 30 deletions buildSrc/src/main/kotlin/DependencyResolution.kt
Original file line number Diff line number Diff line change
Expand Up @@ -24,34 +24,35 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

import io.spine.internal.dependency.AnimalSniffer
import io.spine.internal.dependency.Asm
import io.spine.internal.dependency.AutoCommon
import io.spine.internal.dependency.AutoService
import io.spine.internal.dependency.AutoValue
import io.spine.internal.dependency.CheckerFramework
import io.spine.internal.dependency.CommonsCli
import io.spine.internal.dependency.CommonsCodec
import io.spine.internal.dependency.CommonsLogging
import io.spine.internal.dependency.Dokka
import io.spine.internal.dependency.ErrorProne
import io.spine.internal.dependency.FindBugs
import io.spine.internal.dependency.Gson
import io.spine.internal.dependency.Guava
import io.spine.internal.dependency.Hamcrest
import io.spine.internal.dependency.J2ObjC
import io.spine.internal.dependency.JUnit
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.Okio
import io.spine.internal.dependency.OpenTest4J
import io.spine.internal.dependency.Plexus
import io.spine.internal.dependency.Protobuf
import io.spine.internal.dependency.Slf4J
import io.spine.internal.dependency.Truth
import io.spine.internal.dependency.spine.Spine
import io.spine.dependency.build.AnimalSniffer
import io.spine.dependency.build.CheckerFramework
import io.spine.dependency.build.Dokka
import io.spine.dependency.build.ErrorProne
import io.spine.dependency.build.FindBugs
import io.spine.dependency.lib.Asm
import io.spine.dependency.lib.AutoCommon
import io.spine.dependency.lib.AutoService
import io.spine.dependency.lib.AutoValue
import io.spine.dependency.lib.CommonsCli
import io.spine.dependency.lib.CommonsCodec
import io.spine.dependency.lib.CommonsLogging
import io.spine.dependency.lib.Gson
import io.spine.dependency.lib.Guava
import io.spine.dependency.lib.J2ObjC
import io.spine.dependency.lib.Jackson
import io.spine.dependency.lib.JavaDiffUtils
import io.spine.dependency.lib.Kotlin
import io.spine.dependency.lib.Okio
import io.spine.dependency.lib.Plexus
import io.spine.dependency.lib.Protobuf
import io.spine.dependency.lib.Slf4J
import io.spine.dependency.local.Base
import io.spine.dependency.local.Spine
import io.spine.dependency.test.Hamcrest
import io.spine.dependency.test.JUnit
import io.spine.dependency.test.Kotest
import io.spine.dependency.test.OpenTest4J
import io.spine.dependency.test.Truth
import org.gradle.api.NamedDomainObjectContainer
import org.gradle.api.Project
import org.gradle.api.artifacts.Configuration
Expand Down Expand Up @@ -186,7 +187,7 @@ fun ModuleDependency.excludeSpineBase() {
fun Project.forceSpineBase() {
configurations.all {
resolutionStrategy {
force(Spine.base)
force(Base.lib)
}
}
}
Expand All @@ -200,7 +201,7 @@ fun Project.forceBaseInProtoTasks() {
configurations.configureEach {
if (name.lowercased().contains("proto")) {
resolutionStrategy {
force(Spine.baseForBuildScript)
force(Base.libForBuildScript)
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions buildSrc/src/main/kotlin/DokkaExts.kt
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

import io.spine.internal.dependency.Dokka
import io.spine.internal.gradle.publish.getOrCreate
import io.spine.dependency.build.Dokka
import io.spine.gradle.publish.getOrCreate
import java.io.File
import java.time.LocalDate
import org.gradle.api.Project
Expand Down
4 changes: 2 additions & 2 deletions buildSrc/src/main/kotlin/compile-protobuf.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

import io.spine.internal.dependency.Protobuf
import io.spine.internal.gradle.protobuf.setup
import io.spine.dependency.lib.Protobuf
import io.spine.gradle.protobuf.setup

plugins {
id("java-library")
Expand Down
6 changes: 3 additions & 3 deletions buildSrc/src/main/kotlin/config-tester.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

import io.spine.internal.gradle.ConfigTester
import io.spine.internal.gradle.SpineRepos
import io.spine.internal.gradle.cleanFolder
import io.spine.gradle.ConfigTester
import io.spine.gradle.SpineRepos
import io.spine.gradle.cleanFolder
import java.nio.file.Path
import java.nio.file.Paths

Expand Down
10 changes: 5 additions & 5 deletions buildSrc/src/main/kotlin/intellij-platform-jar.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@
@file:Suppress("UnstableApiUsage") // `configurations` block.

import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import io.spine.internal.dependency.Kotlin
import io.spine.internal.gradle.publish.IncrementGuard
import io.spine.internal.gradle.publish.SpinePublishing
import io.spine.internal.gradle.publish.spinePublishing
import io.spine.internal.gradle.report.license.LicenseReporter
import io.spine.dependency.lib.Kotlin
import io.spine.gradle.publish.IncrementGuard
import io.spine.gradle.publish.SpinePublishing
import io.spine.gradle.publish.spinePublishing
import io.spine.gradle.report.license.LicenseReporter

plugins {
`java-library`
Expand Down
Loading
Loading