Skip to content
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
14 changes: 7 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,23 @@ jobs:
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: 'true'

- uses: actions/setup-java@v3
- uses: actions/setup-java@v4
with:
java-version: 11
java-version: 17
distribution: zulu

- name: Substitute Gradle settings file
shell: bash
run: ./substitute-settings.py
env:
MC_JAVA_VERSION: "2.0.0-SNAPSHOT.151"
CORE_VERSION: "2.0.0-SNAPSHOT.141"
PROTO_DATA_VERSION: "0.8.5"
VALIDATION_VERSION: "2.0.0-SNAPSHOT.81"
MC_JAVA_VERSION: "2.0.0-SNAPSHOT.266"
CORE_VERSION: "2.0.0-SNAPSHOT.201"
PROTO_DATA_VERSION: "0.92.11"
VALIDATION_VERSION: "2.0.0-SNAPSHOT.301"

- name: Build project
shell: bash
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/gradle-wrapper-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ on:

jobs:
validation:
name: Validation
name: Validate Gradle Wrapper
runs-on: ubuntu-latest
steps:
- name: Checkout latest code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v1
- name: Gradle Wrapper Validation
uses: gradle/actions/wrapper-validation@v4
9 changes: 7 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#
# Copyright 2023, TeamDev. All rights reserved.
# Copyright 2025, 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
# 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 @@ -31,6 +31,10 @@
#
# Therefore, instructions below are superset of instructions required for all the projects.

.java-version

buildSrc/.kotlin/

# IntelliJ IDEA modules and interim config files.
*.iml
.idea/*.xml
Expand All @@ -55,6 +59,7 @@

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

# Build files produced by the IDE
**/out/**
Expand Down
5 changes: 1 addition & 4 deletions .idea/codeStyles/Project.xml

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

2 changes: 1 addition & 1 deletion .idea/copyright/TeamDev_Open_Source.xml

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

8 changes: 6 additions & 2 deletions .idea/copyright/profiles_settings.xml

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

14 changes: 3 additions & 11 deletions .idea/inspectionProfiles/Project_Default.xml

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

8 changes: 4 additions & 4 deletions .idea/kotlinc.xml

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

5 changes: 3 additions & 2 deletions .idea/misc.xml

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

1 change: 0 additions & 1 deletion .lift.toml

This file was deleted.

62 changes: 33 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
This repository contains a set of Protobuf model definitions.

Unlike many other [Spine examples](https://github.com/spine-examples), this repo does not contain
Java or any other implementations. Instead, it focuses on the model definitions, providing
a sizable amount of various Proto definitions.
Java or any other implementations. Instead, it focuses on the model definitions,
providing a sizable number of various Proto definitions.

Using the definitions in this repo, we can test speed of our build tools, comparing it to
the past performance.
Using the definitions in this repo, we can test the speed of our build tools,
comparing it to the past performance.

The repo contains 1152 message declarations and 32 enum declarations in 192 `.proto` files.
This includes command, event, rejection, entity, ID, and value object types.
Expand All @@ -21,47 +21,51 @@ To use this repo locally for one-time tests, follow these steps.
1. Add the repo as a Git submodule to your project.
2. Copy the `settings.gradle.kts.template` file as `settings.gradle.kts`.
Replace all the placeholder versions with the required versions. Or, alternatively,
add a `dependencySubstitution` block and define which local projects should be used for which
dependencies.
add a `dependencySubstitution` block and define which local projects should be used
for which dependencies.
3. Build the project with the `build` task.

## Using with Gradle

To launch the build speed tests with Gradle, follow these steps.

1. Add the repo as a Git submodule to your project.

2. Create a Gradle task which would call the `substitute-settings.py` script, setting the versions
to the versions from the local environment:
```kotlin
val prepareBuildSpeedSettings by tasks.registering(Exec::class) {
environment(
"MC_JAVA_VERSION" to Spine.McJava.version,
"CORE_VERSION" to Spine.ArtifactVersion.core,
"PROTO_DATA_VERSION" to ProtoData.version,
"VALIDATION_VERSION" to Validation.version
)
workingDir = File(rootDir, "BuildSpeed")
commandLine("./substitute-settings.py")
}
```

```kotlin
val prepareBuildSpeedSettings by tasks.registering(Exec::class) {
environment(
"MC_JAVA_VERSION" to Spine.McJava.version,
"CORE_VERSION" to Spine.ArtifactVersion.core,
"PROTO_DATA_VERSION" to ProtoData.version,
"VALIDATION_VERSION" to Validation.version
)
workingDir = File(rootDir, "BuildSpeed")
commandLine("./substitute-settings.py")
}
```
This script creates/overrides the `settings.gradle.kts` file with the relevant
Spine dependency versions.

3. Create a task calls the `build` task on this project:
```kotlin
tasks.register<RunBuild>("checkSpeed") {
directory = "$rootDir/BuildSpeed"

dependsOn(prepareBuildSpeedSettings, localPublish)
shouldRunAfter(check)
}
```
4. Launch the `checkSpeed` task. It's not recommended to include this task into the build

```kotlin
tasks.register<RunBuild>("checkSpeed") {
directory = "$rootDir/BuildSpeed"

dependsOn(prepareBuildSpeedSettings, localPublish)
shouldRunAfter(check)
}
```
4. Launch the `checkSpeed` task. It's not recommended to include this task in the build
by default due to the long execution time. Instead, run it manually when needed and/or launch
it on CI.

## Extra Gradle configuration

If the speed tests require additional configuration, e.g. configuring the tested plugins,
If the speed tests require additional configuration, e.g., configuring the tested plugins,
add a file called `build-speed.gradle.kts` to the root of the project. This script plugin
will be applied to the `BuildSpeed` project.

Expand All @@ -72,5 +76,5 @@ info about the past builds, the speed of the task execution, the versions of Spi
the username (for specifying the machine which ran the build).

The journal file should be kept in the Git repository. If this repo is included as a submodule into
another repo and needs updating, the journal file should be preserved in its local form, so that
another repo and needs updating, the journal file should be preserved in its local form so that
less relevant build history doesn't overwrite the local build history.
Loading