Skip to content

Commit 9008ccb

Browse files
authored
Merge pull request #372 from modelix/build/repository-content-filtering
MODELIX-533 Use repository content filtering
2 parents 1949db7 + fd30dda commit 9008ccb

File tree

18 files changed

+203
-73
lines changed

18 files changed

+203
-73
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/ci.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ sleep 5
2525

2626
#CI needs more time
2727
if [ "${CI}" = "true" ]; then
28-
sleep 10
28+
sleep 20
2929
fi
3030

3131
curl -X POST http://127.0.0.1:28309/v2/repositories/ci-test/init

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()

gradle/libs.versions.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ dokka = {id = "org.jetbrains.dokka", version = "1.9.10"}
1919
node = {id = "com.github.node-gradle.node", version = "7.0.1"}
2020
detekt = { id = "io.gitlab.arturbosch.detekt", version = "1.23.4" }
2121
npm-publish = { id = "dev.petuska.npm.publish", version = "3.4.1" }
22+
test-logger = { id = "com.adarshr.test-logger", version = "4.0.0" }
23+
shadow = { id = "com.github.johnrengelman.shadow", version = "8.1.1" }
24+
intellij = { id = "org.jetbrains.intellij", version = "1.16.1" }
2225

2326
[versions]
2427
kotlin = "1.9.21"

kotlin-utils/build.gradle.kts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
11
plugins {
22
`maven-publish`
3-
id("org.jetbrains.kotlin.multiplatform")
3+
kotlin("multiplatform")
44
}
55

66
kotlin {
77
jvm()
88
js(IR) {
99
browser {}
1010
nodejs {
11-
testTask(
12-
Action {
13-
useMocha {
14-
timeout = "30s"
15-
}
16-
},
17-
)
11+
testTask {
12+
useMocha {
13+
timeout = "30s"
14+
}
15+
}
1816
}
1917
useCommonJs()
2018
}

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") {

0 commit comments

Comments
 (0)