Skip to content

Commit c30e1b9

Browse files
authored
Merge branch 'main' into build/do-not-update-version-before-publishing
2 parents edde16a + 9008ccb commit c30e1b9

File tree

46 files changed

+955
-606
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+955
-606
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
/bulk-model-sync-gradle/ @mhuster23
44
/bulk-model-sync-gradle-test/ @mhuster23
55
/bulk-model-sync-lib/ @mhuster23
6+
/bulk-model-sync-mps/ @mhuster23
67
/bulk-model-sync-solution/ @mhuster23
78
/light-model-client/ @slisson
89
/metamodel-export/ @slisson
Lines changed: 2 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
1-
name: Release
1+
name: Dry-Run Release
22
on:
3-
push:
4-
branches:
5-
- main
6-
pull_request: {}
3+
pull_request:
74

85
jobs:
96
lint-commits:
107
name: Lint PR commits
118
runs-on: ubuntu-latest
12-
if: ${{ github.event_name == 'pull_request' }}
139
steps:
1410
- uses: actions/checkout@v3
1511
with:
@@ -19,7 +15,6 @@ jobs:
1915
test-release:
2016
name: Dry-run semantic-release
2117
runs-on: ubuntu-latest
22-
if: ${{ github.event_name == 'pull_request' }}
2318
steps:
2419
- name: Checkout
2520
uses: actions/checkout@v3
@@ -48,29 +43,3 @@ jobs:
4843
# configuration from the CI environment by removing the variable that
4944
# is used for CI detection.
5045
run: unset GITHUB_ACTIONS && npx semantic-release --dry-run --ci false
51-
52-
release:
53-
name: Run semantic release
54-
runs-on: ubuntu-latest
55-
if: ${{ github.ref == 'refs/heads/main' }}
56-
steps:
57-
- name: Checkout
58-
uses: actions/checkout@v3
59-
with:
60-
fetch-depth: 0
61-
token: ${{ secrets.RELEASE_TOKEN }}
62-
- name: Setup Node.js
63-
uses: actions/setup-node@v3
64-
with:
65-
node-version: 18
66-
- name: Cache Node packages
67-
uses: actions/cache@v3
68-
with:
69-
path: node_modules
70-
key: release-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }}
71-
- name: Install dependencies
72-
run: npm ci
73-
- name: Release
74-
env:
75-
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
76-
run: npx semantic-release

.github/workflows/mps-compatibility.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,10 @@ jobs:
3333
- name: Set up Gradle
3434
uses: gradle/gradle-build-action@v2
3535
- name: Build with ${{ matrix.version }}
36-
run: ./gradlew --build-cache :mps-model-adapters:build :mps-model-server-plugin:build -Pmps.version=${{ matrix.version }}
36+
run: >-
37+
./gradlew --build-cache
38+
:bulk-model-sync-mps:build
39+
:metamodel-export:build
40+
:mps-model-adapters:build
41+
:mps-model-server-plugin:build
42+
-Pmps.version=${{ matrix.version }}

.github/workflows/release.yaml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Release
2+
on:
3+
workflow_dispatch:
4+
schedule:
5+
- cron: '0 2 * * *' # run at 2 AM UTC
6+
7+
jobs:
8+
release:
9+
name: Run semantic release
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v3
14+
with:
15+
fetch-depth: 0
16+
token: ${{ secrets.RELEASE_TOKEN }}
17+
- name: Setup Node.js
18+
uses: actions/setup-node@v3
19+
with:
20+
node-version: 18
21+
- name: Cache Node packages
22+
uses: actions/cache@v3
23+
with:
24+
path: node_modules
25+
key: release-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }}
26+
- name: Install dependencies
27+
run: npm ci
28+
- name: Release
29+
env:
30+
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
31+
run: npx semantic-release

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: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,6 @@
1414
* limitations under the License.
1515
*/
1616

17-
import org.modelix.model.server.Main
18-
19-
buildscript {
20-
val modelixCoreVersion: String = file("../version.txt").readText()
21-
dependencies {
22-
classpath("org.modelix:model-server:$modelixCoreVersion")
23-
classpath("org.modelix:graph-lang-api:$modelixCoreVersion")
24-
}
25-
}
26-
2717
plugins {
2818
alias(libs.plugins.kotlin.jvm)
2919
id("org.modelix.bulk-model-sync")
@@ -34,19 +24,34 @@ val modelixCoreVersion: String = file("../version.txt").readText()
3424
version = modelixCoreVersion
3525

3626
repositories {
37-
mavenLocal()
38-
maven { url = uri("https://repo.maven.apache.org/maven2") }
39-
maven { url = uri("https://plugins.gradle.org/m2/") }
40-
mavenCentral()
41-
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+
}
4250
}
4351

44-
val mps by configurations.creating
45-
val mpsDir = project.layout.buildDirectory.dir("mps").get().asFile.apply { mkdirs() }
4652
val kotlinGenDir = project.layout.buildDirectory.dir("metamodel/kotlin").get().asFile.apply { mkdirs() }
4753

4854
dependencies {
49-
mps("com.jetbrains:mps:2021.2.5")
5055
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.2")
5156
implementation("org.modelix:model-server:$modelixCoreVersion")
5257
implementation("org.modelix:model-api-gen-runtime:$modelixCoreVersion")
@@ -74,12 +79,7 @@ tasks.register("runModelServer", JavaExec::class) {
7479

7580
classpath = sourceSets["main"].runtimeClasspath
7681
mainClass.set("org.modelix.model.server.Main")
77-
args("-inmemory")
78-
}
79-
80-
val resolveMps by tasks.registering(Copy::class) {
81-
from(mps.resolve().map { zipTree(it) })
82-
into(mpsDir)
82+
args("-inmemory", "-port", "28309")
8383
}
8484

8585
val repoDir = project.layout.buildDirectory.dir("test-repo").get().asFile
@@ -89,32 +89,32 @@ val copyTestRepo by tasks.registering(Sync::class) {
8989
into(repoDir)
9090
}
9191

92+
mpsBuild {
93+
mpsVersion("2021.2.5")
94+
}
95+
9296
modelSync {
93-
dependsOn(resolveMps)
9497
dependsOn(copyTestRepo)
9598
direction("testPush") {
96-
org.modelix.model.sync.bulk.gradle.test.GraphLanguagesHelper.registerAll()
9799
includeModule("GraphSolution")
98100
fromLocal {
99-
mpsHome = mpsDir
100101
mpsHeapSize = "2g"
101102
repositoryDir = repoDir
102103
}
103104
toModelServer {
104-
url = "http://0.0.0.0:${Main.DEFAULT_PORT}/v2"
105+
url = "http://localhost:28309/v2"
105106
repositoryId = "ci-test"
106107
branchName = "master"
107108
}
108109
}
109110
direction("testPull") {
110111
includeModule("GraphSolution")
111112
fromModelServer {
112-
url = "http://0.0.0.0:${Main.DEFAULT_PORT}/v2"
113+
url = "http://localhost:28309/v2"
113114
repositoryId = "ci-test"
114115
branchName = "master"
115116
}
116117
toLocal {
117-
mpsHome = mpsDir
118118
repositoryDir = repoDir
119119
}
120120
}

bulk-model-sync-gradle-test/ci.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ sleep 5
2525

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

31-
curl -X POST http://127.0.0.1:28101/v2/repositories/ci-test/init
31+
curl -X POST http://127.0.0.1:28309/v2/repositories/ci-test/init
3232

3333
./gradlew runSyncTestPush --console=plain --stacktrace
3434
./gradlew test --tests 'PushTest'

bulk-model-sync-gradle-test/graph-lang-api/build.gradle.kts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,6 @@ val resolveMps by tasks.registering(Copy::class) {
3232

3333
val repoDir = projectDir.resolve("test-repo")
3434

35-
val copyMetamodelToMpsHome by tasks.registering(Copy::class) {
36-
from(file(projectDir.resolve("../test-repo/languages")))
37-
into(file(mpsDir.resolve("languages").apply { mkdirs() }))
38-
}
39-
4035
kotlin {
4136
sourceSets.named("main") {
4237
kotlin.srcDir(kotlinGenDir)
@@ -45,9 +40,9 @@ kotlin {
4540

4641
metamodel {
4742
dependsOn(resolveMps)
48-
dependsOn(copyMetamodelToMpsHome)
4943
mpsHome = mpsDir
5044
kotlinDir = kotlinGenDir
45+
modulesFrom(projectDir.parentFile.resolve("test-repo"))
5146
includeLanguage("GraphLang")
5247
registrationHelperName = "org.modelix.model.sync.bulk.gradle.test.GraphLanguagesHelper"
5348
}

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-test/src/test/kotlin/org/modelix/model/sync/bulk/gradle/test/PushTest.kt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import org.modelix.model.data.ModelData
2222
import org.modelix.model.data.NodeData
2323
import org.modelix.model.lazy.BranchReference
2424
import org.modelix.model.lazy.RepositoryId
25-
import org.modelix.model.server.Main
2625
import org.modelix.model.sync.bulk.asExported
2726
import java.io.File
2827
import kotlin.test.assertContentEquals
@@ -32,7 +31,7 @@ class PushTest {
3231
@Test
3332
fun `nodes were synced to server`() {
3433
val inputDir = File("build/model-sync/testPush")
35-
val files = inputDir.listFiles()?.filter { it.extension == "json" } ?: error("no json files found")
34+
val files = inputDir.listFiles()?.filter { it.extension == "json" } ?: error("no json files found in ${inputDir.absolutePath}")
3635

3736
val modules = files.map { ModelData.fromJson(it.readText()) }
3837
val inputModel = ModelData(root = NodeData(children = modules.map { it.root }))
@@ -42,7 +41,7 @@ class PushTest {
4241

4342
val repoId = RepositoryId("ci-test")
4443
val branchName = "master"
45-
val url = "http://0.0.0.0:${Main.DEFAULT_PORT}/v2"
44+
val url = "http://0.0.0.0:28309/v2"
4645

4746
val branchRef = ModelFacade.createBranchReference(repoId, branchName)
4847
val client = ModelClientV2PlatformSpecificBuilder().url(url).build().apply { runBlocking { init() } }

0 commit comments

Comments
 (0)