Skip to content

Dependencies and build configurations shared among subprojects

License

Notifications You must be signed in to change notification settings

SpineEventEngine/config

Folders and files

NameName
Last commit message
Last commit date
Nov 18, 2024
Dec 9, 2024
Jan 4, 2025
Jan 5, 2025
Mar 19, 2024
Jun 7, 2023
Nov 18, 2024
Sep 21, 2021
Jun 3, 2021
Nov 1, 2024
Sep 24, 2020
Aug 11, 2020
Jun 5, 2018
Jan 15, 2023
Oct 12, 2023
Jun 7, 2023
Jun 7, 2023
Oct 30, 2022
Oct 30, 2022
Oct 28, 2024

Repository files navigation

In Spine, dependencies and CI configurations are shared among the subprojects.

The code of this repository should be added to a target project as a Git submodule.

Adding a submodule to your project

To add a sub-module:

git submodule add https://github.com/SpineEventEngine/config config

This will only add a submodule with the reference to the repository.

In order to get the actual code for the config submodule, run the following command:

git submodule update --init --recursive

Updating project with new configuration

Run the following command from the root of your project:

./config/pull

It will get the latest code from the remote repo, and then copy shared files into the root of your project. The following files will be copied:

  • .idea - a directory with shared IntelliJ IDEA settings
  • .codecov.yml
  • .gitattributes
  • .gitignore
  • buildSrc — a folder containing the common build-time code, in Kotlin.

Checking updated configuration

When changing the configuration (e.g. a version of a dependency, or adding a build script plugin), it may be worth testing that the change does not break dependant projects. ConfigTester allows to automate this process. This tool serves to probe the Spine repositories for compatibility with the local changes in the config repository. The usage looks like this:

// A reference to `config` to use along with the `ConfigTester`.
val config = Paths.get("./")

// A temp folder to use to check out the sources of other repositories with the `ConfigTester`.
val tempFolder = File("./tmp")

// Creates a Gradle task which checks out and builds the selected Spine repositories
// with the local version of `config` and `config/buildSrc`.
ConfigTester(config, tasks, tempFolder)
    .addRepo(SpineRepos.baseTypes)  // Builds `base-types` at `master`.
    .addRepo(SpineRepos.base)       // Builds `base` at `master`.
    .addRepo(SpineRepos.coreJava)   // Builds `core-java` at `master`.

    // This is how one builds a specific branch of some repository:
    // .addRepo(SpineRepos.coreJava, Branch("grpc-concurrency-fixes"))

    // Register the produced task under the selected name to invoke manually upon need.
    .registerUnder("buildDependants")

The build.gradle.kts is already tuned to test changes against base, base-types, and core-java. This takes slightly over half an hour, depending on the local configuration. If you need to change the list of repositories, please update addRepo() calls to ConifigTester.

The command to start the build process is:

./gradlew clean buildDependants 

.github-workflows directory

This directory contains GitHub Workflow scripts that do not apply to the config repository, and as such cannot be placed under .github/workflows.

These scripts are copied by the pull script when config is applied to a new repository.

Further reading