Skip to content

Commit 2a00009

Browse files
committed
build: use repository content filtering
1 parent 63c4aa5 commit 2a00009

File tree

9 files changed

+179
-47
lines changed

9 files changed

+179
-47
lines changed

build.gradle.kts

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -168,10 +168,24 @@ subprojects {
168168

169169
allprojects {
170170
repositories {
171-
mavenLocal()
172-
maven { url = uri("https://artifacts.itemis.cloud/repository/maven-mps/") }
173-
maven { url = uri("https://maven.pkg.jetbrains.space/public/p/kotlinx-html/maven") }
174-
mavenCentral()
171+
val modelixRegex = "org\\.modelix.*"
172+
mavenLocal {
173+
content {
174+
includeGroupByRegex(modelixRegex)
175+
}
176+
}
177+
maven {
178+
url = uri("https://artifacts.itemis.cloud/repository/maven-mps/")
179+
content {
180+
includeGroupByRegex(modelixRegex)
181+
includeGroup("com.jetbrains") // for our mps dependencies
182+
}
183+
}
184+
mavenCentral {
185+
content {
186+
excludeGroupByRegex(modelixRegex)
187+
}
188+
}
175189
}
176190

177191
publishing {

bulk-model-sync-gradle-test/build.gradle.kts

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,29 @@ val modelixCoreVersion: String = file("../version.txt").readText()
2424
version = modelixCoreVersion
2525

2626
repositories {
27-
mavenLocal()
28-
maven { url = uri("https://repo.maven.apache.org/maven2") }
29-
maven { url = uri("https://plugins.gradle.org/m2/") }
30-
mavenCentral()
31-
maven { url = uri("https://artifacts.itemis.cloud/repository/maven-mps/") }
27+
val modelixRegex = "org\\.modelix.*"
28+
mavenLocal {
29+
content {
30+
includeGroupByRegex(modelixRegex)
31+
}
32+
}
33+
gradlePluginPortal {
34+
content {
35+
excludeGroupByRegex(modelixRegex)
36+
}
37+
}
38+
maven {
39+
url = uri("https://artifacts.itemis.cloud/repository/maven-mps/")
40+
content {
41+
includeGroupByRegex(modelixRegex)
42+
includeGroup("com.jetbrains")
43+
}
44+
}
45+
mavenCentral {
46+
content {
47+
excludeGroupByRegex(modelixRegex)
48+
}
49+
}
3250
}
3351

3452
val kotlinGenDir = project.layout.buildDirectory.dir("metamodel/kotlin").get().asFile.apply { mkdirs() }
@@ -84,15 +102,15 @@ modelSync {
84102
repositoryDir = repoDir
85103
}
86104
toModelServer {
87-
url = "http://0.0.0.0:28309/v2"
105+
url = "http://localhost:28309/v2"
88106
repositoryId = "ci-test"
89107
branchName = "master"
90108
}
91109
}
92110
direction("testPull") {
93111
includeModule("GraphSolution")
94112
fromModelServer {
95-
url = "http://0.0.0.0:28309/v2"
113+
url = "http://localhost:28309/v2"
96114
repositoryId = "ci-test"
97115
branchName = "master"
98116
}

bulk-model-sync-gradle-test/settings.gradle.kts

Lines changed: 44 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,58 @@
1616

1717
pluginManagement {
1818
val modelixCoreVersion: String = file("../version.txt").readText()
19+
val modelixRegex = "org\\.modelix.*"
1920
plugins {
2021
id("org.modelix.bulk-model-sync") version modelixCoreVersion
2122
id("org.modelix.model-api-gen") version modelixCoreVersion
2223
}
2324
repositories {
24-
mavenLocal()
25-
gradlePluginPortal()
26-
maven { url = uri("https://artifacts.itemis.cloud/repository/maven-mps/") }
27-
mavenCentral()
25+
mavenLocal {
26+
content {
27+
includeGroupByRegex(modelixRegex)
28+
}
29+
}
30+
gradlePluginPortal {
31+
content {
32+
excludeGroupByRegex(modelixRegex)
33+
}
34+
}
35+
maven {
36+
url = uri("https://artifacts.itemis.cloud/repository/maven-mps/")
37+
content {
38+
includeGroupByRegex(modelixRegex)
39+
}
40+
}
41+
mavenCentral {
42+
content {
43+
excludeGroupByRegex(modelixRegex)
44+
}
45+
}
2846
}
2947
dependencyResolutionManagement {
3048
repositories {
31-
mavenLocal()
32-
gradlePluginPortal()
33-
maven { url = uri("https://artifacts.itemis.cloud/repository/maven-mps/") }
34-
mavenCentral()
49+
mavenLocal {
50+
content {
51+
includeGroupByRegex(modelixRegex)
52+
}
53+
}
54+
gradlePluginPortal {
55+
content {
56+
excludeGroupByRegex(modelixRegex)
57+
}
58+
}
59+
maven {
60+
url = uri("https://artifacts.itemis.cloud/repository/maven-mps/")
61+
content {
62+
includeGroupByRegex(modelixRegex)
63+
includeGroup("com.jetbrains")
64+
}
65+
}
66+
mavenCentral {
67+
content {
68+
excludeGroupByRegex(modelixRegex)
69+
}
70+
}
3571
}
3672
versionCatalogs {
3773
create("libs") {

bulk-model-sync-gradle/build.gradle.kts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,6 @@ plugins {
33
`java-gradle-plugin`
44
}
55

6-
repositories {
7-
mavenCentral()
8-
mavenLocal()
9-
}
10-
116
dependencies {
127
implementation(project(":model-client", "jvmRuntimeElements"))
138
implementation(project(":bulk-model-sync-lib"))

bulk-model-sync-lib/build.gradle.kts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@ plugins {
22
alias(libs.plugins.kotlin.multiplatform)
33
}
44

5-
repositories {
6-
mavenCentral()
7-
}
8-
95
kotlin {
106
js(IR) {
117
browser()

model-api-gen-gradle-test/build.gradle.kts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,32 @@ plugins {
77
}
88

99
subprojects {
10+
repositories {
11+
val modelixRegex = "org\\.modelix.*"
12+
mavenLocal {
13+
content {
14+
includeGroupByRegex(modelixRegex)
15+
}
16+
}
17+
gradlePluginPortal {
18+
content {
19+
excludeGroupByRegex(modelixRegex)
20+
}
21+
}
22+
maven {
23+
url = uri("https://artifacts.itemis.cloud/repository/maven-mps/")
24+
content {
25+
includeGroupByRegex(modelixRegex)
26+
includeGroup("com.jetbrains")
27+
}
28+
}
29+
mavenCentral {
30+
content {
31+
excludeGroupByRegex(modelixRegex)
32+
}
33+
}
34+
}
35+
1036
plugins.withType<NodePlugin> {
1137
project.extensions.configure<NodeExtension> {
1238
version.set(libs.versions.node)

model-api-gen-gradle-test/settings.gradle.kts

Lines changed: 44 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,56 @@
11
pluginManagement {
22
val modelixCoreVersion: String = file("../version.txt").readText()
3+
val modelixRegex = "org\\.modelix.*"
34
plugins {
45
id("org.modelix.model-api-gen") version modelixCoreVersion
56
}
6-
resolutionStrategy {
7-
}
87
repositories {
9-
mavenLocal()
10-
gradlePluginPortal()
11-
maven { url = uri("https://artifacts.itemis.cloud/repository/maven-mps/") }
12-
mavenCentral()
8+
mavenLocal {
9+
content {
10+
includeGroupByRegex(modelixRegex)
11+
}
12+
}
13+
gradlePluginPortal {
14+
content {
15+
excludeGroupByRegex(modelixRegex)
16+
}
17+
}
18+
maven {
19+
url = uri("https://artifacts.itemis.cloud/repository/maven-mps/")
20+
content {
21+
includeGroupByRegex(modelixRegex)
22+
includeGroup("com.jetbrains")
23+
}
24+
}
25+
mavenCentral {
26+
content {
27+
excludeGroupByRegex(modelixRegex)
28+
}
29+
}
1330
}
1431
dependencyResolutionManagement {
1532
repositories {
16-
mavenLocal()
17-
gradlePluginPortal()
18-
maven { url = uri("https://artifacts.itemis.cloud/repository/maven-mps/") }
19-
mavenCentral()
33+
mavenLocal {
34+
content {
35+
includeGroupByRegex(modelixRegex)
36+
}
37+
}
38+
gradlePluginPortal {
39+
content {
40+
excludeGroupByRegex(modelixRegex)
41+
}
42+
}
43+
maven {
44+
url = uri("https://artifacts.itemis.cloud/repository/maven-mps/")
45+
content {
46+
includeGroupByRegex(modelixRegex)
47+
}
48+
}
49+
mavenCentral {
50+
content {
51+
excludeGroupByRegex(modelixRegex)
52+
}
53+
}
2054
}
2155
versionCatalogs {
2256
create("libs") {

model-api-gen-gradle/build.gradle.kts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,6 @@ plugins {
88
id("org.jetbrains.kotlin.jvm")
99
}
1010

11-
repositories {
12-
// Use Maven Central for resolving dependencies.
13-
mavenCentral()
14-
}
15-
1611
dependencies {
1712
// Align versions of all Kotlin components
1813
implementation(platform("org.jetbrains.kotlin:kotlin-bom"))

settings.gradle.kts

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,27 @@
11
pluginManagement {
22
repositories {
3-
mavenLocal()
4-
gradlePluginPortal()
5-
maven { url = uri("https://artifacts.itemis.cloud/repository/maven-mps/") }
6-
mavenCentral()
3+
val modelixRegex = "org\\.modelix.*"
4+
mavenLocal {
5+
content {
6+
includeGroupByRegex(modelixRegex)
7+
}
8+
}
9+
gradlePluginPortal {
10+
content {
11+
excludeGroupByRegex(modelixRegex)
12+
}
13+
}
14+
maven {
15+
url = uri("https://artifacts.itemis.cloud/repository/maven-mps/")
16+
content {
17+
includeGroupByRegex(modelixRegex)
18+
}
19+
}
20+
mavenCentral {
21+
content {
22+
excludeGroupByRegex(modelixRegex)
23+
}
24+
}
725
}
826
}
927
plugins {

0 commit comments

Comments
 (0)