Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MODELIX-533 Use repository content filtering #372

Merged
merged 3 commits into from
Dec 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 18 additions & 4 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,24 @@ subprojects {

allprojects {
repositories {
mavenLocal()
maven { url = uri("https://artifacts.itemis.cloud/repository/maven-mps/") }
maven { url = uri("https://maven.pkg.jetbrains.space/public/p/kotlinx-html/maven") }
mavenCentral()
val modelixRegex = "org\\.modelix.*"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe adding a $ in front would be even safer?

mavenLocal {
content {
includeGroupByRegex(modelixRegex)
}
}
maven {
url = uri("https://artifacts.itemis.cloud/repository/maven-mps/")
content {
includeGroupByRegex(modelixRegex)
includeGroup("com.jetbrains") // for our mps dependencies
}
}
mavenCentral {
content {
excludeGroupByRegex(modelixRegex)
}
}
}

publishing {
Expand Down
32 changes: 25 additions & 7 deletions bulk-model-sync-gradle-test/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,29 @@ val modelixCoreVersion: String = file("../version.txt").readText()
version = modelixCoreVersion

repositories {
mavenLocal()
maven { url = uri("https://repo.maven.apache.org/maven2") }
maven { url = uri("https://plugins.gradle.org/m2/") }
mavenCentral()
maven { url = uri("https://artifacts.itemis.cloud/repository/maven-mps/") }
val modelixRegex = "org\\.modelix.*"
mavenLocal {
content {
includeGroupByRegex(modelixRegex)
}
}
gradlePluginPortal {
content {
excludeGroupByRegex(modelixRegex)
}
}
maven {
url = uri("https://artifacts.itemis.cloud/repository/maven-mps/")
content {
includeGroupByRegex(modelixRegex)
includeGroup("com.jetbrains")
}
}
mavenCentral {
content {
excludeGroupByRegex(modelixRegex)
}
}
}

val kotlinGenDir = project.layout.buildDirectory.dir("metamodel/kotlin").get().asFile.apply { mkdirs() }
Expand Down Expand Up @@ -84,15 +102,15 @@ modelSync {
repositoryDir = repoDir
}
toModelServer {
url = "http://0.0.0.0:28309/v2"
url = "http://localhost:28309/v2"
repositoryId = "ci-test"
branchName = "master"
}
}
direction("testPull") {
includeModule("GraphSolution")
fromModelServer {
url = "http://0.0.0.0:28309/v2"
url = "http://localhost:28309/v2"
repositoryId = "ci-test"
branchName = "master"
}
Expand Down
2 changes: 1 addition & 1 deletion bulk-model-sync-gradle-test/ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ sleep 5

#CI needs more time
if [ "${CI}" = "true" ]; then
sleep 10
sleep 20
fi

curl -X POST http://127.0.0.1:28309/v2/repositories/ci-test/init
Expand Down
52 changes: 44 additions & 8 deletions bulk-model-sync-gradle-test/settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,58 @@

pluginManagement {
val modelixCoreVersion: String = file("../version.txt").readText()
val modelixRegex = "org\\.modelix.*"
plugins {
id("org.modelix.bulk-model-sync") version modelixCoreVersion
id("org.modelix.model-api-gen") version modelixCoreVersion
}
repositories {
mavenLocal()
gradlePluginPortal()
maven { url = uri("https://artifacts.itemis.cloud/repository/maven-mps/") }
mavenCentral()
mavenLocal {
content {
includeGroupByRegex(modelixRegex)
}
}
gradlePluginPortal {
content {
excludeGroupByRegex(modelixRegex)
}
}
maven {
url = uri("https://artifacts.itemis.cloud/repository/maven-mps/")
content {
includeGroupByRegex(modelixRegex)
}
}
mavenCentral {
content {
excludeGroupByRegex(modelixRegex)
}
}
}
dependencyResolutionManagement {
repositories {
mavenLocal()
gradlePluginPortal()
maven { url = uri("https://artifacts.itemis.cloud/repository/maven-mps/") }
mavenCentral()
mavenLocal {
content {
includeGroupByRegex(modelixRegex)
}
}
gradlePluginPortal {
content {
excludeGroupByRegex(modelixRegex)
}
}
maven {
url = uri("https://artifacts.itemis.cloud/repository/maven-mps/")
content {
includeGroupByRegex(modelixRegex)
includeGroup("com.jetbrains")
}
}
mavenCentral {
content {
excludeGroupByRegex(modelixRegex)
}
}
}
versionCatalogs {
create("libs") {
Expand Down
5 changes: 0 additions & 5 deletions bulk-model-sync-gradle/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@ plugins {
`java-gradle-plugin`
}

repositories {
mavenCentral()
mavenLocal()
}

dependencies {
implementation(project(":model-client", "jvmRuntimeElements"))
implementation(project(":bulk-model-sync-lib"))
Expand Down
4 changes: 0 additions & 4 deletions bulk-model-sync-lib/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@ plugins {
alias(libs.plugins.kotlin.multiplatform)
}

repositories {
mavenCentral()
}

kotlin {
js(IR) {
browser()
Expand Down
3 changes: 3 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ dokka = {id = "org.jetbrains.dokka", version = "1.9.10"}
node = {id = "com.github.node-gradle.node", version = "7.0.1"}
detekt = { id = "io.gitlab.arturbosch.detekt", version = "1.23.4" }
npm-publish = { id = "dev.petuska.npm.publish", version = "3.4.1" }
test-logger = { id = "com.adarshr.test-logger", version = "4.0.0" }
shadow = { id = "com.github.johnrengelman.shadow", version = "8.1.1" }
intellij = { id = "org.jetbrains.intellij", version = "1.16.1" }

[versions]
kotlin = "1.9.21"
Expand Down
14 changes: 6 additions & 8 deletions kotlin-utils/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
plugins {
`maven-publish`
id("org.jetbrains.kotlin.multiplatform")
kotlin("multiplatform")
}

kotlin {
jvm()
js(IR) {
browser {}
nodejs {
testTask(
Action {
useMocha {
timeout = "30s"
}
},
)
testTask {
useMocha {
timeout = "30s"
}
}
}
useCommonJs()
}
Expand Down
26 changes: 26 additions & 0 deletions model-api-gen-gradle-test/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,32 @@ plugins {
}

subprojects {
repositories {
val modelixRegex = "org\\.modelix.*"
mavenLocal {
content {
includeGroupByRegex(modelixRegex)
}
}
gradlePluginPortal {
content {
excludeGroupByRegex(modelixRegex)
}
}
maven {
url = uri("https://artifacts.itemis.cloud/repository/maven-mps/")
content {
includeGroupByRegex(modelixRegex)
includeGroup("com.jetbrains")
}
}
mavenCentral {
content {
excludeGroupByRegex(modelixRegex)
}
}
}

plugins.withType<NodePlugin> {
project.extensions.configure<NodeExtension> {
version.set(libs.versions.node)
Expand Down
54 changes: 44 additions & 10 deletions model-api-gen-gradle-test/settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,22 +1,56 @@
pluginManagement {
val modelixCoreVersion: String = file("../version.txt").readText()
val modelixRegex = "org\\.modelix.*"
plugins {
id("org.modelix.model-api-gen") version modelixCoreVersion
}
resolutionStrategy {
}
repositories {
mavenLocal()
gradlePluginPortal()
maven { url = uri("https://artifacts.itemis.cloud/repository/maven-mps/") }
mavenCentral()
mavenLocal {
content {
includeGroupByRegex(modelixRegex)
}
}
gradlePluginPortal {
content {
excludeGroupByRegex(modelixRegex)
}
}
maven {
url = uri("https://artifacts.itemis.cloud/repository/maven-mps/")
content {
includeGroupByRegex(modelixRegex)
includeGroup("com.jetbrains")
}
}
mavenCentral {
content {
excludeGroupByRegex(modelixRegex)
}
}
}
dependencyResolutionManagement {
repositories {
mavenLocal()
gradlePluginPortal()
maven { url = uri("https://artifacts.itemis.cloud/repository/maven-mps/") }
mavenCentral()
mavenLocal {
content {
includeGroupByRegex(modelixRegex)
}
}
gradlePluginPortal {
content {
excludeGroupByRegex(modelixRegex)
}
}
maven {
url = uri("https://artifacts.itemis.cloud/repository/maven-mps/")
content {
includeGroupByRegex(modelixRegex)
}
}
mavenCentral {
content {
excludeGroupByRegex(modelixRegex)
}
}
}
versionCatalogs {
create("libs") {
Expand Down
7 changes: 1 addition & 6 deletions model-api-gen-gradle/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,7 @@ plugins {
java

// Apply the Kotlin JVM plugin to add support for Kotlin.
id("org.jetbrains.kotlin.jvm")
}

repositories {
// Use Maven Central for resolving dependencies.
mavenCentral()
kotlin("jvm")
}

dependencies {
Expand Down
4 changes: 2 additions & 2 deletions model-api/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id("maven-publish")
id("org.jetbrains.kotlin.multiplatform")
`maven-publish`
kotlin("multiplatform")
kotlin("plugin.serialization")
}

Expand Down
6 changes: 3 additions & 3 deletions model-client/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import dev.petuska.npm.publish.task.NpmPackTask

plugins {
`maven-publish`
id("org.jetbrains.kotlin.multiplatform")
id("com.diffplug.spotless")
kotlin("multiplatform")
alias(libs.plugins.spotless)
alias(libs.plugins.npm.publish)
`java-library`
jacoco
alias(libs.plugins.npm.publish)
}

java {
Expand Down
2 changes: 1 addition & 1 deletion model-datastructure/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
`maven-publish`
id("org.jetbrains.kotlin.multiplatform")
kotlin("multiplatform")
}

kotlin {
Expand Down
8 changes: 4 additions & 4 deletions model-server/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import com.github.jengelman.gradle.plugins.shadow.transformers.PropertiesFileTra

plugins {
application
id("com.diffplug.spotless")
`maven-publish`
id("com.adarshr.test-logger") version "4.0.0"
id("org.jetbrains.kotlin.jvm")
id("com.github.johnrengelman.shadow") version "8.1.1"
alias(libs.plugins.spotless)
alias(libs.plugins.test.logger)
alias(libs.plugins.shadow)
kotlin("jvm")
kotlin("plugin.serialization")
}

Expand Down
4 changes: 2 additions & 2 deletions mps-model-server-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import org.jetbrains.kotlin.gradle.dsl.JvmTarget

plugins {
id("org.jetbrains.kotlin.jvm")
id("org.jetbrains.intellij") version "1.16.1"
kotlin("jvm")
alias(libs.plugins.intellij)
}

val mpsToIdeaMap = mapOf(
Expand Down
Loading
Loading