-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
52 lines (44 loc) · 1.53 KB
/
build.gradle.kts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
plugins {
id("org.jetbrains.kotlin.jvm") version ("1.4.32")
id("generate-models")
id("com.google.cloud.artifactregistry.gradle-plugin") version ("2.1.1")
}
group = "ir.amv.snippets"
version = "1.0-SNAPSHOT"
repositories {
// maven (url="http://localhost:8081/repository/maven-snapshots/")
maven(url = "https://projects.itemis.de/nexus/content/repositories/mbeddr")
maven(url = "artifactregistry://europe-west1-maven.pkg.dev/loco-repo-298115/loco-repo-langs")
jcenter()
}
val mpsVersion = "2020.1.6"
val mps = configurations.create("mps")
dependencies {
compile("amirmv2006:Zargari:v1.1")
mps("com.jetbrains:mps:$mpsVersion")
}
val mpsLocation = File(buildDir, "mps")
val pluginsDir = File(mpsLocation, "plugins")
val genExt = extensions.getByType<de.itemis.mps.gradle.generate.GeneratePluginExtensions>().apply {
projectLocation = projectDir
mpsConfig = mps
pluginLocation = pluginsDir
plugins = configurations.runtime.dependencies.asSequence()
.onEach { logger.lifecycle("My Dear Dependency: {}", it) }
.flatMap { configurations.runtime.files(it).asSequence() }
.map { toPlugin(it) }
.onEach { logger.lifecycle("My Dear Plugin: {}", it) }
.toList()
}
val copyMpsPluginsTask = tasks.register<Copy>("copyMpsPluginsTask") {
dependsOn(tasks.named("fakeBuildNumber"))
into(genExt.pluginLocation!!)
configurations.runtime.asFileTree.forEach {
from(zipTree(it))
}
}
afterEvaluate {
tasks.named("generate") {
dependsOn(copyMpsPluginsTask)
}
}