Skip to content

Commit 27e08af

Browse files
Merge pull request #164 from SpineEventEngine/add-custom-repositories
2 parents ff37667 + 83b62d2 commit 27e08af

6 files changed

Lines changed: 160 additions & 33 deletions

File tree

config

Submodule config updated 25 files

dependencies.md

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22

3-
# Dependencies of `io.spine.tools:classic-codegen:2.0.0-SNAPSHOT.371`
3+
# Dependencies of `io.spine.tools:classic-codegen:2.0.0-SNAPSHOT.372`
44

55
## Runtime
66
1. **Group** : com.google.code.findbugs. **Name** : jsr305. **Version** : 3.0.2.
@@ -888,14 +888,14 @@
888888

889889
The dependencies distributed under several licenses, are used according their commercial-use-friendly license.
890890

891-
This report was generated on **Tue Dec 02 18:51:33 WET 2025** using
891+
This report was generated on **Fri Feb 20 20:25:48 WET 2026** using
892892
[Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under
893893
[Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE).
894894

895895

896896

897897

898-
# Dependencies of `io.spine.tools:gradle-plugin-api:2.0.0-SNAPSHOT.371`
898+
# Dependencies of `io.spine.tools:gradle-plugin-api:2.0.0-SNAPSHOT.372`
899899

900900
## Runtime
901901
1. **Group** : com.fasterxml.jackson. **Name** : jackson-bom. **Version** : 2.20.0.
@@ -1838,14 +1838,14 @@ This report was generated on **Tue Dec 02 18:51:33 WET 2025** using
18381838

18391839
The dependencies distributed under several licenses, are used according their commercial-use-friendly license.
18401840

1841-
This report was generated on **Tue Dec 02 18:51:33 WET 2025** using
1841+
This report was generated on **Fri Feb 20 20:25:48 WET 2026** using
18421842
[Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under
18431843
[Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE).
18441844

18451845

18461846

18471847

1848-
# Dependencies of `io.spine.tools:gradle-plugin-api-test-fixtures:2.0.0-SNAPSHOT.371`
1848+
# Dependencies of `io.spine.tools:gradle-plugin-api-test-fixtures:2.0.0-SNAPSHOT.372`
18491849

18501850
## Runtime
18511851
1. **Group** : com.fasterxml.jackson. **Name** : jackson-bom. **Version** : 2.20.0.
@@ -2321,14 +2321,14 @@ This report was generated on **Tue Dec 02 18:51:33 WET 2025** using
23212321

23222322
The dependencies distributed under several licenses, are used according their commercial-use-friendly license.
23232323

2324-
This report was generated on **Tue Dec 02 18:51:33 WET 2025** using
2324+
This report was generated on **Fri Feb 20 20:25:48 WET 2026** using
23252325
[Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under
23262326
[Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE).
23272327

23282328

23292329

23302330

2331-
# Dependencies of `io.spine.tools:gradle-root-plugin:2.0.0-SNAPSHOT.371`
2331+
# Dependencies of `io.spine.tools:gradle-root-plugin:2.0.0-SNAPSHOT.372`
23322332

23332333
## Runtime
23342334
1. **Group** : com.google.code.findbugs. **Name** : jsr305. **Version** : 3.0.2.
@@ -3195,14 +3195,14 @@ This report was generated on **Tue Dec 02 18:51:33 WET 2025** using
31953195

31963196
The dependencies distributed under several licenses, are used according their commercial-use-friendly license.
31973197

3198-
This report was generated on **Tue Dec 02 18:51:33 WET 2025** using
3198+
This report was generated on **Fri Feb 20 20:25:48 WET 2026** using
31993199
[Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under
32003200
[Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE).
32013201

32023202

32033203

32043204

3205-
# Dependencies of `io.spine.tools:intellij-platform:2.0.0-SNAPSHOT.371`
3205+
# Dependencies of `io.spine.tools:intellij-platform:2.0.0-SNAPSHOT.372`
32063206

32073207
## Runtime
32083208
1. **Group** : be.cyberelf.nanoxml. **Name** : nanoxml. **Version** : 2.2.3.
@@ -4316,14 +4316,14 @@ This report was generated on **Tue Dec 02 18:51:33 WET 2025** using
43164316

43174317
The dependencies distributed under several licenses, are used according their commercial-use-friendly license.
43184318

4319-
This report was generated on **Tue Dec 02 18:51:33 WET 2025** using
4319+
This report was generated on **Fri Feb 20 20:25:48 WET 2026** using
43204320
[Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under
43214321
[Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE).
43224322

43234323

43244324

43254325

4326-
# Dependencies of `io.spine.tools:intellij-platform-java:2.0.0-SNAPSHOT.371`
4326+
# Dependencies of `io.spine.tools:intellij-platform-java:2.0.0-SNAPSHOT.372`
43274327

43284328
## Runtime
43294329
1. **Group** : be.cyberelf.nanoxml. **Name** : nanoxml. **Version** : 2.2.3.
@@ -6135,14 +6135,14 @@ This report was generated on **Tue Dec 02 18:51:33 WET 2025** using
61356135

61366136
The dependencies distributed under several licenses, are used according their commercial-use-friendly license.
61376137

6138-
This report was generated on **Tue Dec 02 18:51:34 WET 2025** using
6138+
This report was generated on **Fri Feb 20 20:25:49 WET 2026** using
61396139
[Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under
61406140
[Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE).
61416141

61426142

61436143

61446144

6145-
# Dependencies of `io.spine.tools:jvm-tool-plugins:2.0.0-SNAPSHOT.371`
6145+
# Dependencies of `io.spine.tools:jvm-tool-plugins:2.0.0-SNAPSHOT.372`
61466146

61476147
## Runtime
61486148
1. **Group** : com.google.code.findbugs. **Name** : jsr305. **Version** : 3.0.2.
@@ -7029,14 +7029,14 @@ This report was generated on **Tue Dec 02 18:51:34 WET 2025** using
70297029

70307030
The dependencies distributed under several licenses, are used according their commercial-use-friendly license.
70317031

7032-
This report was generated on **Tue Dec 02 18:51:33 WET 2025** using
7032+
This report was generated on **Fri Feb 20 20:25:48 WET 2026** using
70337033
[Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under
70347034
[Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE).
70357035

70367036

70377037

70387038

7039-
# Dependencies of `io.spine.tools:jvm-tools:2.0.0-SNAPSHOT.371`
7039+
# Dependencies of `io.spine.tools:jvm-tools:2.0.0-SNAPSHOT.372`
70407040

70417041
## Runtime
70427042
1. **Group** : org.jetbrains. **Name** : annotations. **Version** : 26.0.2.
@@ -7836,14 +7836,14 @@ This report was generated on **Tue Dec 02 18:51:33 WET 2025** using
78367836

78377837
The dependencies distributed under several licenses, are used according their commercial-use-friendly license.
78387838

7839-
This report was generated on **Tue Dec 02 18:51:33 WET 2025** using
7839+
This report was generated on **Fri Feb 20 20:25:48 WET 2026** using
78407840
[Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under
78417841
[Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE).
78427842

78437843

78447844

78457845

7846-
# Dependencies of `io.spine.tools:plugin-base:2.0.0-SNAPSHOT.371`
7846+
# Dependencies of `io.spine.tools:plugin-base:2.0.0-SNAPSHOT.372`
78477847

78487848
## Runtime
78497849
1. **Group** : com.google.code.findbugs. **Name** : jsr305. **Version** : 3.0.2.
@@ -8738,14 +8738,14 @@ This report was generated on **Tue Dec 02 18:51:33 WET 2025** using
87388738

87398739
The dependencies distributed under several licenses, are used according their commercial-use-friendly license.
87408740

8741-
This report was generated on **Tue Dec 02 18:51:33 WET 2025** using
8741+
This report was generated on **Fri Feb 20 20:25:48 WET 2026** using
87428742
[Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under
87438743
[Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE).
87448744

87458745

87468746

87478747

8748-
# Dependencies of `io.spine.tools:plugin-testlib:2.0.0-SNAPSHOT.371`
8748+
# Dependencies of `io.spine.tools:plugin-testlib:2.0.0-SNAPSHOT.372`
87498749

87508750
## Runtime
87518751
1. **Group** : com.google.auto.value. **Name** : auto-value-annotations. **Version** : 1.10.2.
@@ -9744,14 +9744,14 @@ This report was generated on **Tue Dec 02 18:51:33 WET 2025** using
97449744

97459745
The dependencies distributed under several licenses, are used according their commercial-use-friendly license.
97469746

9747-
This report was generated on **Tue Dec 02 18:51:33 WET 2025** using
9747+
This report was generated on **Fri Feb 20 20:25:48 WET 2026** using
97489748
[Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under
97499749
[Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE).
97509750

97519751

97529752

97539753

9754-
# Dependencies of `io.spine.tools:protobuf-setup-plugins:2.0.0-SNAPSHOT.371`
9754+
# Dependencies of `io.spine.tools:protobuf-setup-plugins:2.0.0-SNAPSHOT.372`
97559755

97569756
## Runtime
97579757
1. **Group** : com.google.code.findbugs. **Name** : jsr305. **Version** : 3.0.2.
@@ -10658,14 +10658,14 @@ This report was generated on **Tue Dec 02 18:51:33 WET 2025** using
1065810658

1065910659
The dependencies distributed under several licenses, are used according their commercial-use-friendly license.
1066010660

10661-
This report was generated on **Tue Dec 02 18:51:33 WET 2025** using
10661+
This report was generated on **Fri Feb 20 20:25:49 WET 2026** using
1066210662
[Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under
1066310663
[Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE).
1066410664

1066510665

1066610666

1066710667

10668-
# Dependencies of `io.spine.tools:psi:2.0.0-SNAPSHOT.371`
10668+
# Dependencies of `io.spine.tools:psi:2.0.0-SNAPSHOT.372`
1066910669

1067010670
## Runtime
1067110671
1. **Group** : be.cyberelf.nanoxml. **Name** : nanoxml. **Version** : 2.2.3.
@@ -11822,14 +11822,14 @@ This report was generated on **Tue Dec 02 18:51:33 WET 2025** using
1182211822

1182311823
The dependencies distributed under several licenses, are used according their commercial-use-friendly license.
1182411824

11825-
This report was generated on **Tue Dec 02 18:51:33 WET 2025** using
11825+
This report was generated on **Fri Feb 20 20:25:48 WET 2026** using
1182611826
[Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under
1182711827
[Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE).
1182811828

1182911829

1183011830

1183111831

11832-
# Dependencies of `io.spine.tools:psi-java:2.0.0-SNAPSHOT.371`
11832+
# Dependencies of `io.spine.tools:psi-java:2.0.0-SNAPSHOT.372`
1183311833

1183411834
## Runtime
1183511835
1. **Group** : be.cyberelf.nanoxml. **Name** : nanoxml. **Version** : 2.2.3.
@@ -13704,14 +13704,14 @@ This report was generated on **Tue Dec 02 18:51:33 WET 2025** using
1370413704

1370513705
The dependencies distributed under several licenses, are used according their commercial-use-friendly license.
1370613706

13707-
This report was generated on **Tue Dec 02 18:51:34 WET 2025** using
13707+
This report was generated on **Fri Feb 20 20:25:49 WET 2026** using
1370813708
[Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under
1370913709
[Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE).
1371013710

1371113711

1371213712

1371313713

13714-
# Dependencies of `io.spine.tools:tool-base:2.0.0-SNAPSHOT.371`
13714+
# Dependencies of `io.spine.tools:tool-base:2.0.0-SNAPSHOT.372`
1371513715

1371613716
## Runtime
1371713717
1. **Group** : com.google.code.findbugs. **Name** : jsr305. **Version** : 3.0.2.
@@ -14631,6 +14631,6 @@ This report was generated on **Tue Dec 02 18:51:34 WET 2025** using
1463114631

1463214632
The dependencies distributed under several licenses, are used according their commercial-use-friendly license.
1463314633

14634-
This report was generated on **Tue Dec 02 18:51:33 WET 2025** using
14634+
This report was generated on **Fri Feb 20 20:25:48 WET 2026** using
1463514635
[Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under
1463614636
[Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE).

gradle-root-plugin/src/main/kotlin/io/spine/tools/gradle/root/RootPlugin.kt

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,20 +24,30 @@
2424
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2525
*/
2626

27+
@file:Suppress("UnstableApiUsage") // We need to use unstable settings API.
28+
2729
package io.spine.tools.gradle.root
2830

2931
import io.spine.tools.gradle.DslSpec
32+
import io.spine.tools.gradle.applyStandard
3033
import io.spine.tools.gradle.project.ProjectPlugin
3134
import io.spine.tools.gradle.root.RootExtension.Companion.NAME
3235
import org.gradle.api.Project
3336
import org.gradle.api.file.Directory
37+
import org.gradle.api.initialization.resolve.RepositoriesMode
38+
import org.gradle.api.internal.GradleInternal
39+
import org.gradle.api.internal.SettingsInternal
3440
import org.gradle.api.plugins.ExtensionAware
3541

3642
/**
3743
* Creates [RootExtension] in a project, if it is not already present.
3844
*
3945
* The extension is used by Gradle plugins of libraries that extend
4046
* the [root extension][RootExtension] with custom configuration DSL.
47+
*
48+
* The plugin also applies repositories [standard for Spine SDK][applyStandard]
49+
* to the project IFF `dependencyResolutionManagement.repositoriesMode` property set
50+
* in `settings.gradle.kts` to [RepositoriesMode.PREFER_PROJECT] or assumed such.
4151
*/
4252
public class RootPlugin :
4353
ProjectPlugin<RootExtension>(DslSpec(NAME, RootExtension::class)) {
@@ -58,11 +68,12 @@ public class RootPlugin :
5868
}
5969

6070
/**
61-
* Applies the plugin to the given project by forcing creation of the [extension].
71+
* Applies the plugin to the given [project].
6272
*/
6373
override fun apply(project: Project) {
6474
super.apply(project)
6575
createExtension()
76+
project.tryApplyStandardRepositories()
6677
check(extension != null) {
6778
"The extension of the `${this::class.simpleName}` has not been created."
6879
}
@@ -76,3 +87,30 @@ public class RootPlugin :
7687
public const val ID: String = "io.spine.root"
7788
}
7889
}
90+
91+
/**
92+
* Attempts to apply repositories [standard for Spine SDK][applyStandard] to the project
93+
* by inspecting the `dependencyResolutionManagement.repositoriesMode` value set
94+
* in `settings.gradle.kts`.
95+
*
96+
* If the value set explicitly or assumed as [RepositoriesMode.PREFER_PROJECT],
97+
* the repositories are applied.
98+
*/
99+
private fun Project.tryApplyStandardRepositories() {
100+
val settings = project.settings
101+
if (settings == null) {
102+
repositories.applyStandard()
103+
return
104+
}
105+
val mode = settings.dependencyResolutionManagement.repositoriesMode.get()
106+
if (mode == RepositoriesMode.PREFER_PROJECT) {
107+
repositories.applyStandard()
108+
}
109+
}
110+
111+
private val Project.settings: SettingsInternal?
112+
get() = try {
113+
(project.gradle as GradleInternal).settings
114+
} catch (_: IllegalStateException) {
115+
null
116+
}

0 commit comments

Comments
 (0)