aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--build.gradle.kts6
-rw-r--r--buildSrc/src/main/java/tools/refinery/gradle/utils/EclipseUtils.java (renamed from buildSrc/src/main/java/tools/refinery/buildsrc/EclipseUtils.java)2
-rw-r--r--buildSrc/src/main/java/tools/refinery/gradle/utils/SonarPropertiesUtils.java (renamed from buildSrc/src/main/java/tools/refinery/buildsrc/SonarPropertiesUtils.java)2
-rw-r--r--buildSrc/src/main/kotlin/refinery-frontend-workspace.gradle.kts32
-rw-r--r--buildSrc/src/main/kotlin/refinery-frontend-worktree.gradle.kts84
-rw-r--r--buildSrc/src/main/kotlin/refinery-java-library.gradle.kts5
-rw-r--r--buildSrc/src/main/kotlin/refinery-xtext-conventions.gradle.kts21
-rw-r--r--buildSrc/src/main/kotlin/tools/refinery/gradle/eclipse.gradle.kts (renamed from buildSrc/src/main/kotlin/refinery-eclipse.gradle.kts)11
-rw-r--r--buildSrc/src/main/kotlin/tools/refinery/gradle/frontend-workspace.gradle.kts34
-rw-r--r--buildSrc/src/main/kotlin/tools/refinery/gradle/frontend-worktree.gradle.kts87
-rw-r--r--buildSrc/src/main/kotlin/tools/refinery/gradle/internal/frontend-conventions.gradle.kts (renamed from buildSrc/src/main/kotlin/refinery-frontend-conventions.gradle.kts)7
-rw-r--r--buildSrc/src/main/kotlin/tools/refinery/gradle/internal/java-conventions.gradle.kts (renamed from buildSrc/src/main/kotlin/refinery-java-conventions.gradle.kts)72
-rw-r--r--buildSrc/src/main/kotlin/tools/refinery/gradle/java-application.gradle.kts (renamed from buildSrc/src/main/kotlin/refinery-java-application.gradle.kts)7
-rw-r--r--buildSrc/src/main/kotlin/tools/refinery/gradle/java-library.gradle.kts6
-rw-r--r--buildSrc/src/main/kotlin/tools/refinery/gradle/java-test-fixtures.gradle.kts (renamed from buildSrc/src/main/kotlin/refinery-java-test-fixtures.gradle.kts)10
-rw-r--r--buildSrc/src/main/kotlin/tools/refinery/gradle/jmh.gradle.kts (renamed from buildSrc/src/main/kotlin/refinery-jmh.gradle.kts)34
-rw-r--r--buildSrc/src/main/kotlin/tools/refinery/gradle/mwe2.gradle.kts (renamed from buildSrc/src/main/kotlin/refinery-mwe2.gradle.kts)11
-rw-r--r--buildSrc/src/main/kotlin/tools/refinery/gradle/sonarqube.gradle.kts (renamed from buildSrc/src/main/kotlin/refinery-sonarqube.gradle.kts)2
-rw-r--r--buildSrc/src/main/kotlin/tools/refinery/gradle/xtext-generated.gradle.kts23
-rw-r--r--subprojects/frontend/build.gradle.kts140
-rw-r--r--subprojects/language-ide/build.gradle.kts4
-rw-r--r--subprojects/language-model/build.gradle.kts40
-rw-r--r--subprojects/language-semantics/build.gradle.kts2
-rw-r--r--subprojects/language-web/build.gradle.kts94
-rw-r--r--subprojects/language/build.gradle.kts64
-rw-r--r--subprojects/store-query-viatra/build.gradle.kts2
-rw-r--r--subprojects/store-query/build.gradle.kts4
-rw-r--r--subprojects/store-reasoning/build.gradle.kts2
-rw-r--r--subprojects/store/build.gradle.kts4
29 files changed, 416 insertions, 396 deletions
diff --git a/build.gradle.kts b/build.gradle.kts
index 8e50da65..5a673f33 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -2,7 +2,7 @@ plugins {
2 // Workaround for https://github.com/gradle/gradle/issues/22797 2 // Workaround for https://github.com/gradle/gradle/issues/22797
3 @Suppress("DSL_SCOPE_VIOLATION") 3 @Suppress("DSL_SCOPE_VIOLATION")
4 alias(libs.plugins.versions) 4 alias(libs.plugins.versions)
5 id("refinery-eclipse") 5 id("tools.refinery.gradle.eclipse")
6 id("refinery-frontend-worktree") 6 id("tools.refinery.gradle.frontend-worktree")
7 id("refinery-sonarqube") 7 id("tools.refinery.gradle.sonarqube")
8} 8}
diff --git a/buildSrc/src/main/java/tools/refinery/buildsrc/EclipseUtils.java b/buildSrc/src/main/java/tools/refinery/gradle/utils/EclipseUtils.java
index 0014a35d..1e33a95d 100644
--- a/buildSrc/src/main/java/tools/refinery/buildsrc/EclipseUtils.java
+++ b/buildSrc/src/main/java/tools/refinery/gradle/utils/EclipseUtils.java
@@ -1,4 +1,4 @@
1package tools.refinery.buildsrc; 1package tools.refinery.gradle.utils;
2 2
3import groovy.lang.Closure; 3import groovy.lang.Closure;
4import org.gradle.api.Action; 4import org.gradle.api.Action;
diff --git a/buildSrc/src/main/java/tools/refinery/buildsrc/SonarPropertiesUtils.java b/buildSrc/src/main/java/tools/refinery/gradle/utils/SonarPropertiesUtils.java
index 1d89841e..3810fccf 100644
--- a/buildSrc/src/main/java/tools/refinery/buildsrc/SonarPropertiesUtils.java
+++ b/buildSrc/src/main/java/tools/refinery/gradle/utils/SonarPropertiesUtils.java
@@ -1,4 +1,4 @@
1package tools.refinery.buildsrc; 1package tools.refinery.gradle.utils;
2 2
3import java.util.ArrayList; 3import java.util.ArrayList;
4import java.util.Collections; 4import java.util.Collections;
diff --git a/buildSrc/src/main/kotlin/refinery-frontend-workspace.gradle.kts b/buildSrc/src/main/kotlin/refinery-frontend-workspace.gradle.kts
deleted file mode 100644
index 198f73f3..00000000
--- a/buildSrc/src/main/kotlin/refinery-frontend-workspace.gradle.kts
+++ /dev/null
@@ -1,32 +0,0 @@
1import org.siouan.frontendgradleplugin.infrastructure.gradle.*
2
3plugins {
4 id("refinery-eclipse")
5 id("refinery-frontend-conventions")
6}
7
8tasks.named<NodeInstallTask>("installNode") {
9 dependsOn(rootProject.tasks.named("installNode"))
10 enabled = false
11}
12
13tasks.named<YarnGlobalInstallTask>("installYarnGlobally") {
14 dependsOn(rootProject.tasks.named("installYarnGlobally"))
15 enabled = false
16}
17
18tasks.named<InstallYarnTask>("installYarn") {
19 dependsOn(rootProject.tasks.named("installYarn"))
20 enabled = false
21}
22
23val rootInstallFrontend = rootProject.tasks.named("installFrontend")
24
25rootInstallFrontend.configure {
26 inputs.file("$projectDir/package.json")
27}
28
29tasks.named("installFrontend") {
30 dependsOn(rootInstallFrontend)
31 enabled = false
32}
diff --git a/buildSrc/src/main/kotlin/refinery-frontend-worktree.gradle.kts b/buildSrc/src/main/kotlin/refinery-frontend-worktree.gradle.kts
deleted file mode 100644
index d8c3d51f..00000000
--- a/buildSrc/src/main/kotlin/refinery-frontend-worktree.gradle.kts
+++ /dev/null
@@ -1,84 +0,0 @@
1import org.siouan.frontendgradleplugin.infrastructure.gradle.*
2import java.io.FileInputStream
3import java.io.FileNotFoundException
4import java.io.FileOutputStream
5import java.util.*
6
7plugins {
8 id("refinery-frontend-conventions")
9}
10
11val frontend = the<FrontendExtension>()
12
13val yarn1Version = providers.gradleProperty("frontend.yarn1Version")
14
15frontend.yarnGlobalInstallScript.set(yarn1Version.map { version -> "install -g yarn@$version" })
16frontend.yarnInstallScript.set(frontend.yarnVersion.map { version -> "set version $version --only-if-needed" })
17frontend.installScript.set(provider {
18 if (project.hasProperty("ci")) "install --immutable --inline-builds" else "install"
19})
20
21val frontendPropertiesFile = frontend.nodeInstallDirectory.map { dir -> "$dir/frontend.properties" }
22
23fun readFrontendProperties(): Properties {
24 val props = Properties()
25 try {
26 FileInputStream(frontendPropertiesFile.get()).use { inputStream ->
27 props.load(inputStream)
28 }
29 } catch (ignored: FileNotFoundException) {
30 // Ignore missing file.
31 }
32 return props
33}
34
35fun getFrontendProperty(propertyName: String): String? {
36 val props = readFrontendProperties()
37 return props[propertyName]?.toString()
38}
39
40fun putFrontedProperty(propertyName: String, propertyValue: String) {
41 val props = readFrontendProperties()
42 props[propertyName] = propertyValue
43 FileOutputStream(frontendPropertiesFile.get()).use { outputStream ->
44 props.store(outputStream, "generated by refinery-frontend-worktree")
45 }
46}
47
48tasks.named<NodeInstallTask>("installNode") {
49 onlyIf {
50 getFrontendProperty("installedNodeVersion") != frontend.nodeVersion.get()
51 }
52 doLast {
53 putFrontedProperty("installedNodeVersion", frontend.nodeVersion.get())
54 }
55}
56
57tasks.named<YarnGlobalInstallTask>("installYarnGlobally") {
58 onlyIf {
59 getFrontendProperty("installedYarn1Version") != yarn1Version.get()
60 }
61 doLast {
62 putFrontedProperty("installedYarn1Version", yarn1Version.get())
63 }
64 outputs.dir(frontend.nodeInstallDirectory.map { dir -> "$dir/lib/node_modules/yarn" })
65}
66
67tasks.named<InstallYarnTask>("installYarn") {
68 outputs.file(frontend.yarnVersion.map { version -> ".yarn/releases/yarn-$version.cjs" })
69}
70
71tasks.named<InstallDependenciesTask>("installFrontend") {
72 inputs.files("package.json", "yarn.lock")
73 outputs.files(".pnp.cjs", ".pnp.loader.mjs")
74}
75
76tasks.register("clobberFrontend", Delete::class) {
77 delete(frontend.nodeInstallDirectory)
78 delete(".yarn/cache")
79 delete(".yarn/install-state.gz")
80 delete(".yarn/sdks")
81 delete(".yarn/unplugged")
82 delete(".pnp.cjs")
83 delete(".pnp.loader.mjs")
84}
diff --git a/buildSrc/src/main/kotlin/refinery-java-library.gradle.kts b/buildSrc/src/main/kotlin/refinery-java-library.gradle.kts
deleted file mode 100644
index 5a6200e0..00000000
--- a/buildSrc/src/main/kotlin/refinery-java-library.gradle.kts
+++ /dev/null
@@ -1,5 +0,0 @@
1plugins {
2 `java-library`
3}
4
5apply(plugin = "refinery-java-conventions")
diff --git a/buildSrc/src/main/kotlin/refinery-xtext-conventions.gradle.kts b/buildSrc/src/main/kotlin/refinery-xtext-conventions.gradle.kts
deleted file mode 100644
index 34fbae99..00000000
--- a/buildSrc/src/main/kotlin/refinery-xtext-conventions.gradle.kts
+++ /dev/null
@@ -1,21 +0,0 @@
1import org.gradle.api.tasks.SourceSetContainer
2import org.sonarqube.gradle.SonarExtension
3import tools.refinery.buildsrc.SonarPropertiesUtils
4
5apply(plugin = "refinery-java-conventions")
6apply(plugin = "refinery-sonarqube")
7
8val xtextGenPath = "src/main/xtext-gen"
9
10the<SourceSetContainer>().named("main") {
11 java.srcDir(xtextGenPath)
12 resources.srcDir(xtextGenPath)
13}
14
15tasks.named<Delete>("clean") {
16 delete(xtextGenPath)
17}
18
19the<SonarExtension>().properties {
20 SonarPropertiesUtils.addToList(properties, "sonar.exclusions", "$xtextGenPath/**")
21}
diff --git a/buildSrc/src/main/kotlin/refinery-eclipse.gradle.kts b/buildSrc/src/main/kotlin/tools/refinery/gradle/eclipse.gradle.kts
index 85e47370..25e7e573 100644
--- a/buildSrc/src/main/kotlin/refinery-eclipse.gradle.kts
+++ b/buildSrc/src/main/kotlin/tools/refinery/gradle/eclipse.gradle.kts
@@ -1,5 +1,6 @@
1import org.gradle.plugins.ide.eclipse.model.EclipseModel 1package tools.refinery.gradle
2import java.util.* 2
3import java.util.Properties
3 4
4plugins { 5plugins {
5 eclipse 6 eclipse
@@ -23,14 +24,14 @@ val eclipseResourceEncoding by tasks.registering {
23 } 24 }
24} 25}
25 26
26val eclipse by tasks.existing { 27tasks.eclipse {
27 dependsOn(eclipseResourceEncoding) 28 dependsOn(eclipseResourceEncoding)
28} 29}
29 30
30the<EclipseModel>().synchronizationTasks(eclipseResourceEncoding) 31eclipse.synchronizationTasks(eclipseResourceEncoding)
31 32
32tasks.register<Delete>("clobberEclipse") { 33tasks.register<Delete>("clobberEclipse") {
33 mustRunAfter(eclipse) 34 mustRunAfter(tasks.eclipse)
34 delete(".classpath") 35 delete(".classpath")
35 delete(".project") 36 delete(".project")
36 delete(".settings") 37 delete(".settings")
diff --git a/buildSrc/src/main/kotlin/tools/refinery/gradle/frontend-workspace.gradle.kts b/buildSrc/src/main/kotlin/tools/refinery/gradle/frontend-workspace.gradle.kts
new file mode 100644
index 00000000..174a2d65
--- /dev/null
+++ b/buildSrc/src/main/kotlin/tools/refinery/gradle/frontend-workspace.gradle.kts
@@ -0,0 +1,34 @@
1package tools.refinery.gradle
2
3plugins {
4 id("tools.refinery.gradle.eclipse")
5 id("tools.refinery.gradle.internal.frontend-conventions")
6}
7
8tasks {
9 installNode {
10 dependsOn(rootProject.tasks.named("installNode"))
11 enabled = false
12 }
13
14 installYarnGlobally {
15 dependsOn(rootProject.tasks.named("installYarnGlobally"))
16 enabled = false
17 }
18
19 installYarn {
20 dependsOn(rootProject.tasks.named("installYarn"))
21 enabled = false
22 }
23
24 val rootInstallFrontend = rootProject.tasks.named("installFrontend")
25
26 rootInstallFrontend.configure {
27 inputs.file("$projectDir/package.json")
28 }
29
30 installFrontend {
31 dependsOn(rootInstallFrontend)
32 enabled = false
33 }
34}
diff --git a/buildSrc/src/main/kotlin/tools/refinery/gradle/frontend-worktree.gradle.kts b/buildSrc/src/main/kotlin/tools/refinery/gradle/frontend-worktree.gradle.kts
new file mode 100644
index 00000000..3225a1b1
--- /dev/null
+++ b/buildSrc/src/main/kotlin/tools/refinery/gradle/frontend-worktree.gradle.kts
@@ -0,0 +1,87 @@
1package tools.refinery.gradle
2
3import java.io.FileInputStream
4import java.io.FileNotFoundException
5import java.io.FileOutputStream
6import java.util.Properties
7
8plugins {
9 id("tools.refinery.gradle.internal.frontend-conventions")
10}
11
12val yarn1Version = providers.gradleProperty("frontend.yarn1Version")
13
14frontend {
15 yarnGlobalInstallScript.set(yarn1Version.map { version -> "install -g yarn@$version" })
16 yarnInstallScript.set(frontend.yarnVersion.map { version -> "set version $version --only-if-needed" })
17 installScript.set(provider {
18 if (project.hasProperty("ci")) "install --immutable --inline-builds" else "install"
19 })
20}
21
22val frontendPropertiesFile = frontend.nodeInstallDirectory.map { dir -> "$dir/frontend.properties" }
23
24fun readFrontendProperties(): Properties {
25 val props = Properties()
26 try {
27 FileInputStream(frontendPropertiesFile.get()).use { inputStream ->
28 props.load(inputStream)
29 }
30 } catch (ignored: FileNotFoundException) {
31 // Ignore missing file.
32 }
33 return props
34}
35
36fun getFrontendProperty(propertyName: String): String? {
37 val props = readFrontendProperties()
38 return props[propertyName]?.toString()
39}
40
41fun putFrontedProperty(propertyName: String, propertyValue: String) {
42 val props = readFrontendProperties()
43 props[propertyName] = propertyValue
44 FileOutputStream(frontendPropertiesFile.get()).use { outputStream ->
45 props.store(outputStream, "generated by refinery-frontend-worktree")
46 }
47}
48
49tasks {
50 installNode {
51 onlyIf {
52 getFrontendProperty("installedNodeVersion") != frontend.nodeVersion.get()
53 }
54 doLast {
55 putFrontedProperty("installedNodeVersion", frontend.nodeVersion.get())
56 }
57 }
58
59 installYarnGlobally {
60 onlyIf {
61 getFrontendProperty("installedYarn1Version") != yarn1Version.get()
62 }
63 doLast {
64 putFrontedProperty("installedYarn1Version", yarn1Version.get())
65 }
66 outputs.dir(frontend.nodeInstallDirectory.map { dir -> "$dir/lib/node_modules/yarn" })
67 }
68
69 installYarn {
70 outputs.file(frontend.yarnVersion.map { version -> ".yarn/releases/yarn-$version.cjs" })
71 }
72
73 installFrontend {
74 inputs.files("package.json", "yarn.lock")
75 outputs.files(".pnp.cjs", ".pnp.loader.mjs")
76 }
77
78 register("clobberFrontend", Delete::class) {
79 delete(frontend.nodeInstallDirectory)
80 delete(".yarn/cache")
81 delete(".yarn/install-state.gz")
82 delete(".yarn/sdks")
83 delete(".yarn/unplugged")
84 delete(".pnp.cjs")
85 delete(".pnp.loader.mjs")
86 }
87}
diff --git a/buildSrc/src/main/kotlin/refinery-frontend-conventions.gradle.kts b/buildSrc/src/main/kotlin/tools/refinery/gradle/internal/frontend-conventions.gradle.kts
index c4658948..b15de515 100644
--- a/buildSrc/src/main/kotlin/refinery-frontend-conventions.gradle.kts
+++ b/buildSrc/src/main/kotlin/tools/refinery/gradle/internal/frontend-conventions.gradle.kts
@@ -1,18 +1,17 @@
1import org.siouan.frontendgradleplugin.infrastructure.gradle.EnableYarnBerryTask 1package tools.refinery.gradle.internal
2import org.siouan.frontendgradleplugin.infrastructure.gradle.FrontendExtension
3 2
4plugins { 3plugins {
5 id("org.siouan.frontend-jdk11") 4 id("org.siouan.frontend-jdk11")
6} 5}
7 6
8configure<FrontendExtension> { 7frontend {
9 nodeVersion.set(providers.gradleProperty("frontend.nodeVersion")) 8 nodeVersion.set(providers.gradleProperty("frontend.nodeVersion"))
10 nodeInstallDirectory.set(file("$rootDir/.node")) 9 nodeInstallDirectory.set(file("$rootDir/.node"))
11 yarnEnabled.set(true) 10 yarnEnabled.set(true)
12 yarnVersion.set(providers.gradleProperty("frontend.yarnVersion")) 11 yarnVersion.set(providers.gradleProperty("frontend.yarnVersion"))
13} 12}
14 13
15tasks.named<EnableYarnBerryTask>("enableYarnBerry") { 14tasks.enableYarnBerry {
16 // There is no need to enable berry manually, because berry files are already committed to the repo. 15 // There is no need to enable berry manually, because berry files are already committed to the repo.
17 enabled = false 16 enabled = false
18} 17}
diff --git a/buildSrc/src/main/kotlin/refinery-java-conventions.gradle.kts b/buildSrc/src/main/kotlin/tools/refinery/gradle/internal/java-conventions.gradle.kts
index a55350df..67bb5d88 100644
--- a/buildSrc/src/main/kotlin/refinery-java-conventions.gradle.kts
+++ b/buildSrc/src/main/kotlin/tools/refinery/gradle/internal/java-conventions.gradle.kts
@@ -1,15 +1,15 @@
1package tools.refinery.gradle.internal
2
1import org.gradle.accessors.dm.LibrariesForLibs 3import org.gradle.accessors.dm.LibrariesForLibs
2import org.gradle.plugins.ide.eclipse.model.EclipseModel
3import org.gradle.plugins.ide.eclipse.model.ProjectDependency 4import org.gradle.plugins.ide.eclipse.model.ProjectDependency
4import tools.refinery.buildsrc.EclipseUtils 5import tools.refinery.gradle.utils.EclipseUtils
5 6
6plugins { 7plugins {
7 jacoco 8 jacoco
8 java 9 java
10 id("tools.refinery.gradle.eclipse")
9} 11}
10 12
11apply(plugin = "refinery-eclipse")
12
13repositories { 13repositories {
14 mavenCentral() 14 mavenCentral()
15 maven { 15 maven {
@@ -41,49 +41,47 @@ java.toolchain {
41 languageVersion.set(JavaLanguageVersion.of(19)) 41 languageVersion.set(JavaLanguageVersion.of(19))
42} 42}
43 43
44tasks.withType(JavaCompile::class) { 44tasks {
45 options.release.set(17) 45 withType(JavaCompile::class) {
46} 46 options.release.set(17)
47 47 }
48val test = tasks.named<Test>("test")
49
50val jacocoTestReport = tasks.named<JacocoReport>("jacocoTestReport")
51 48
52test.configure { 49 test {
53 useJUnitPlatform { 50 useJUnitPlatform {
54 excludeTags("slow") 51 excludeTags("slow")
55 } 52 }
56 finalizedBy(jacocoTestReport) 53 finalizedBy(tasks.jacocoTestReport)
57} 54 }
58 55
59jacocoTestReport.configure { 56 jacocoTestReport {
60 dependsOn(test) 57 dependsOn(tasks.test)
61 reports { 58 reports {
62 xml.required.set(true) 59 xml.required.set(true)
60 }
63 } 61 }
64}
65 62
66tasks.named<Jar>("jar") { 63 jar {
67 manifest { 64 manifest {
68 attributes( 65 attributes(
69 "Bundle-SymbolicName" to "${project.group}.${project.name}", 66 "Bundle-SymbolicName" to "${project.group}.${project.name}",
70 "Bundle-Version" to project.version 67 "Bundle-Version" to project.version
71 ) 68 )
69 }
72 } 70 }
73}
74 71
75val generateEclipseSourceFolders by tasks.registering 72 val generateEclipseSourceFolders by tasks.registering
76 73
77tasks.register("prepareEclipse") { 74 register("prepareEclipse") {
78 dependsOn(generateEclipseSourceFolders) 75 dependsOn(generateEclipseSourceFolders)
79 dependsOn(tasks.named("eclipseJdt")) 76 dependsOn(tasks.named("eclipseJdt"))
80} 77 }
81 78
82tasks.named("eclipseClasspath") { 79 eclipseClasspath {
83 dependsOn(generateEclipseSourceFolders) 80 dependsOn(generateEclipseSourceFolders)
81 }
84} 82}
85 83
86configure<EclipseModel> { 84eclipse {
87 EclipseUtils.patchClasspathEntries(this) { entry -> 85 EclipseUtils.patchClasspathEntries(this) { entry ->
88 if (entry.path.endsWith("-gen")) { 86 if (entry.path.endsWith("-gen")) {
89 entry.entryAttributes["ignore_optional_problems"] = true 87 entry.entryAttributes["ignore_optional_problems"] = true
diff --git a/buildSrc/src/main/kotlin/refinery-java-application.gradle.kts b/buildSrc/src/main/kotlin/tools/refinery/gradle/java-application.gradle.kts
index 65409acf..269af11c 100644
--- a/buildSrc/src/main/kotlin/refinery-java-application.gradle.kts
+++ b/buildSrc/src/main/kotlin/tools/refinery/gradle/java-application.gradle.kts
@@ -1,14 +1,15 @@
1package tools.refinery.gradle
2
1import org.gradle.accessors.dm.LibrariesForLibs 3import org.gradle.accessors.dm.LibrariesForLibs
2 4
3plugins { 5plugins {
4 application 6 application
5 id("com.github.johnrengelman.shadow") 7 id("com.github.johnrengelman.shadow")
8 id("tools.refinery.gradle.internal.java-conventions")
6} 9}
7 10
8apply(plugin = "refinery-java-conventions")
9
10// Use log4j-over-slf4j instead of log4j 1.x when running the application. 11// Use log4j-over-slf4j instead of log4j 1.x when running the application.
11configurations.named("runtimeClasspath") { 12configurations.runtimeClasspath {
12 exclude(group = "log4j", module = "log4j") 13 exclude(group = "log4j", module = "log4j")
13} 14}
14 15
diff --git a/buildSrc/src/main/kotlin/tools/refinery/gradle/java-library.gradle.kts b/buildSrc/src/main/kotlin/tools/refinery/gradle/java-library.gradle.kts
new file mode 100644
index 00000000..084f65ae
--- /dev/null
+++ b/buildSrc/src/main/kotlin/tools/refinery/gradle/java-library.gradle.kts
@@ -0,0 +1,6 @@
1package tools.refinery.gradle
2
3plugins {
4 `java-library`
5 id("tools.refinery.gradle.internal.java-conventions")
6}
diff --git a/buildSrc/src/main/kotlin/refinery-java-test-fixtures.gradle.kts b/buildSrc/src/main/kotlin/tools/refinery/gradle/java-test-fixtures.gradle.kts
index 86b0a04b..7e599c3f 100644
--- a/buildSrc/src/main/kotlin/refinery-java-test-fixtures.gradle.kts
+++ b/buildSrc/src/main/kotlin/tools/refinery/gradle/java-test-fixtures.gradle.kts
@@ -1,14 +1,14 @@
1package tools.refinery.gradle
2
1import org.gradle.plugins.ide.eclipse.model.AbstractClasspathEntry 3import org.gradle.plugins.ide.eclipse.model.AbstractClasspathEntry
2import org.gradle.plugins.ide.eclipse.model.EclipseModel 4import tools.refinery.gradle.utils.EclipseUtils
3import tools.refinery.buildsrc.EclipseUtils
4 5
5plugins { 6plugins {
6 `java-test-fixtures` 7 `java-test-fixtures`
8 id("tools.refinery.gradle.internal.java-conventions")
7} 9}
8 10
9apply(plugin = "refinery-java-conventions") 11eclipse.classpath {
10
11the<EclipseModel>().classpath {
12 containsTestFixtures.set(true) 12 containsTestFixtures.set(true)
13 13
14 EclipseUtils.whenClasspathFileMerged(file) { eclipseClasspath -> 14 EclipseUtils.whenClasspathFileMerged(file) { eclipseClasspath ->
diff --git a/buildSrc/src/main/kotlin/refinery-jmh.gradle.kts b/buildSrc/src/main/kotlin/tools/refinery/gradle/jmh.gradle.kts
index 6512ef23..eda7d5c6 100644
--- a/buildSrc/src/main/kotlin/refinery-jmh.gradle.kts
+++ b/buildSrc/src/main/kotlin/tools/refinery/gradle/jmh.gradle.kts
@@ -1,33 +1,31 @@
1package tools.refinery.gradle
2
1import org.gradle.accessors.dm.LibrariesForLibs 3import org.gradle.accessors.dm.LibrariesForLibs
2import org.gradle.plugins.ide.eclipse.model.EclipseModel 4import tools.refinery.gradle.utils.EclipseUtils
3import org.sonarqube.gradle.SonarExtension 5import tools.refinery.gradle.utils.SonarPropertiesUtils
4import tools.refinery.buildsrc.EclipseUtils
5import tools.refinery.buildsrc.SonarPropertiesUtils
6 6
7apply(plugin = "refinery-java-conventions") 7plugins {
8apply(plugin = "refinery-sonarqube") 8 id("tools.refinery.gradle.internal.java-conventions")
9 id("tools.refinery.gradle.sonarqube")
10}
9 11
10val sourceSets = the<SourceSetContainer>() 12val sourceSets = the<SourceSetContainer>()
11 13
12val main: SourceSet by sourceSets.getting
13
14val test: SourceSet by sourceSets.getting
15
16val jmh: SourceSet by sourceSets.creating { 14val jmh: SourceSet by sourceSets.creating {
17 compileClasspath += main.output 15 compileClasspath += sourceSets.main.get().output
18 runtimeClasspath += main.output 16 runtimeClasspath += sourceSets.main.get().output
19 // Allow using test classes in benchmarks for now. 17 // Allow using test classes in benchmarks for now.
20 compileClasspath += test.output 18 compileClasspath += sourceSets.test.get().output
21 runtimeClasspath += test.output 19 runtimeClasspath += sourceSets.test.get().output
22} 20}
23 21
24val jmhImplementation: Configuration by configurations.getting { 22val jmhImplementation: Configuration by configurations.getting {
25 extendsFrom(configurations["implementation"], configurations["testImplementation"]) 23 extendsFrom(configurations.implementation.get(), configurations.testImplementation.get())
26} 24}
27 25
28val jmhAnnotationProcessor: Configuration by configurations.getting 26val jmhAnnotationProcessor: Configuration by configurations.getting
29 27
30configurations["jmhRuntimeOnly"].extendsFrom(configurations["runtimeOnly"], configurations["testRuntimeOnly"]) 28configurations["jmhRuntimeOnly"].extendsFrom(configurations.runtimeOnly.get(), configurations.testRuntimeOnly.get())
31 29
32val libs = the<LibrariesForLibs>() 30val libs = the<LibrariesForLibs>()
33 31
@@ -42,7 +40,7 @@ tasks.register<JavaExec>("jmh") {
42 classpath = jmh.runtimeClasspath 40 classpath = jmh.runtimeClasspath
43} 41}
44 42
45EclipseUtils.patchClasspathEntries(the<EclipseModel>()) { entry -> 43EclipseUtils.patchClasspathEntries(eclipse) { entry ->
46 // Workaround from https://github.com/gradle/gradle/issues/4802#issuecomment-407902081 44 // Workaround from https://github.com/gradle/gradle/issues/4802#issuecomment-407902081
47 if (entry.entryAttributes["gradle_scope"] == "jmh") { 45 if (entry.entryAttributes["gradle_scope"] == "jmh") {
48 // Allow test helper classes to be used in benchmarks from Eclipse 46 // Allow test helper classes to be used in benchmarks from Eclipse
@@ -58,6 +56,6 @@ EclipseUtils.patchClasspathEntries(the<EclipseModel>()) { entry ->
58 } 56 }
59} 57}
60 58
61the<SonarExtension>().properties { 59sonarqube.properties {
62 SonarPropertiesUtils.addToList(properties, "sonar.tests", "src/jmh/java") 60 SonarPropertiesUtils.addToList(properties, "sonar.tests", "src/jmh/java")
63} 61}
diff --git a/buildSrc/src/main/kotlin/refinery-mwe2.gradle.kts b/buildSrc/src/main/kotlin/tools/refinery/gradle/mwe2.gradle.kts
index 26963837..8eeabf47 100644
--- a/buildSrc/src/main/kotlin/refinery-mwe2.gradle.kts
+++ b/buildSrc/src/main/kotlin/tools/refinery/gradle/mwe2.gradle.kts
@@ -1,12 +1,15 @@
1package tools.refinery.gradle
2
1import org.gradle.accessors.dm.LibrariesForLibs 3import org.gradle.accessors.dm.LibrariesForLibs
2import org.gradle.plugins.ide.eclipse.model.EclipseModel
3 4
4apply(plugin = "refinery-java-conventions") 5plugins {
6 id("tools.refinery.gradle.internal.java-conventions")
7}
5 8
6val mwe2: Configuration by configurations.creating { 9val mwe2: Configuration by configurations.creating {
7 isCanBeConsumed = false 10 isCanBeConsumed = false
8 isCanBeResolved = true 11 isCanBeResolved = true
9 extendsFrom(configurations["implementation"]) 12 extendsFrom(configurations.implementation.get())
10} 13}
11 14
12val libs = the<LibrariesForLibs>() 15val libs = the<LibrariesForLibs>()
@@ -15,4 +18,4 @@ dependencies {
15 mwe2(libs.mwe2.launch) 18 mwe2(libs.mwe2.launch)
16} 19}
17 20
18the<EclipseModel>().classpath.plusConfigurations += mwe2 21eclipse.classpath.plusConfigurations += mwe2
diff --git a/buildSrc/src/main/kotlin/refinery-sonarqube.gradle.kts b/buildSrc/src/main/kotlin/tools/refinery/gradle/sonarqube.gradle.kts
index 6a1dbbf6..ebd9170a 100644
--- a/buildSrc/src/main/kotlin/refinery-sonarqube.gradle.kts
+++ b/buildSrc/src/main/kotlin/tools/refinery/gradle/sonarqube.gradle.kts
@@ -1,3 +1,5 @@
1package tools.refinery.gradle
2
1plugins { 3plugins {
2 id("org.sonarqube") 4 id("org.sonarqube")
3} 5}
diff --git a/buildSrc/src/main/kotlin/tools/refinery/gradle/xtext-generated.gradle.kts b/buildSrc/src/main/kotlin/tools/refinery/gradle/xtext-generated.gradle.kts
new file mode 100644
index 00000000..25aeb826
--- /dev/null
+++ b/buildSrc/src/main/kotlin/tools/refinery/gradle/xtext-generated.gradle.kts
@@ -0,0 +1,23 @@
1package tools.refinery.gradle
2
3import tools.refinery.gradle.utils.SonarPropertiesUtils
4
5plugins {
6 id("tools.refinery.gradle.internal.java-conventions")
7 id("tools.refinery.gradle.sonarqube")
8}
9
10val xtextGenPath = "src/main/xtext-gen"
11
12sourceSets.main {
13 java.srcDir(xtextGenPath)
14 resources.srcDir(xtextGenPath)
15}
16
17tasks.clean {
18 delete(xtextGenPath)
19}
20
21sonarqube.properties {
22 SonarPropertiesUtils.addToList(properties, "sonar.exclusions", "$xtextGenPath/**")
23}
diff --git a/subprojects/frontend/build.gradle.kts b/subprojects/frontend/build.gradle.kts
index ab2f61c9..80f10f7e 100644
--- a/subprojects/frontend/build.gradle.kts
+++ b/subprojects/frontend/build.gradle.kts
@@ -1,18 +1,19 @@
1import org.siouan.frontendgradleplugin.infrastructure.gradle.RunYarn 1import org.siouan.frontendgradleplugin.infrastructure.gradle.RunYarn
2import tools.refinery.buildsrc.SonarPropertiesUtils 2import tools.refinery.gradle.utils.SonarPropertiesUtils
3 3
4plugins { 4plugins {
5 id("refinery-frontend-workspace") 5 id("tools.refinery.gradle.frontend-workspace")
6 id("refinery-sonarqube") 6 id("tools.refinery.gradle.sonarqube")
7} 7}
8 8
9val viteOutputDir = "$buildDir/vite"
10val productionResources = file("$viteOutputDir/production")
11
12frontend { 9frontend {
13 assembleScript.set("run build") 10 assembleScript.set("run build")
14} 11}
15 12
13val viteOutputDir = "$buildDir/vite"
14
15val productionResources = file("$viteOutputDir/production")
16
16val productionAssets: Configuration by configurations.creating { 17val productionAssets: Configuration by configurations.creating {
17 isCanBeConsumed = true 18 isCanBeConsumed = true
18 isCanBeResolved = false 19 isCanBeResolved = false
@@ -53,78 +54,81 @@ val assembleFiles = assembleSources + assembleConfigFiles
53 54
54val lintingFiles = sourcesWithTypes + buildScripts + sharedConfigFiles 55val lintingFiles = sourcesWithTypes + buildScripts + sharedConfigFiles
55 56
56val generateXStateTypes by tasks.registering(RunYarn::class) { 57tasks {
57 dependsOn(tasks.installFrontend) 58 val generateXStateTypes by registering(RunYarn::class) {
58 inputs.files(sourcesWithoutTypes) 59 dependsOn(installFrontend)
59 inputs.files(installationState) 60 inputs.files(sourcesWithoutTypes)
60 outputs.dir("src") 61 inputs.files(installationState)
61 script.set("run typegen") 62 outputs.dir("src")
62 description = "Generate TypeScript typings for XState state machines." 63 script.set("run typegen")
63} 64 description = "Generate TypeScript typings for XState state machines."
65 }
64 66
65tasks.assembleFrontend { 67 assembleFrontend {
66 dependsOn(generateXStateTypes) 68 dependsOn(generateXStateTypes)
67 inputs.files(assembleFiles) 69 inputs.files(assembleFiles)
68 outputs.dir(productionResources) 70 outputs.dir(productionResources)
69} 71 }
70 72
71artifacts { 73
72 add("productionAssets", productionResources) { 74 val typeCheckFrontend by registering(RunYarn::class) {
73 builtBy(tasks.assembleFrontend) 75 dependsOn(installFrontend)
76 dependsOn(generateXStateTypes)
77 inputs.files(lintingFiles)
78 outputs.dir("$buildDir/typescript")
79 script.set("run typecheck")
80 group = "verification"
81 description = "Check for TypeScript type errors."
74 } 82 }
75}
76 83
77val typeCheckFrontend by tasks.registering(RunYarn::class) { 84 val lintFrontend by registering(RunYarn::class) {
78 dependsOn(tasks.installFrontend) 85 dependsOn(installFrontend)
79 dependsOn(generateXStateTypes) 86 dependsOn(generateXStateTypes)
80 inputs.files(lintingFiles) 87 dependsOn(typeCheckFrontend)
81 outputs.dir("$buildDir/typescript") 88 inputs.files(lintingFiles)
82 script.set("run typecheck") 89 outputs.file("$buildDir/eslint.json")
83 group = "verification" 90 script.set("run lint")
84 description = "Check for TypeScript type errors." 91 group = "verification"
85} 92 description = "Check for TypeScript lint errors and warnings."
93 }
86 94
87val lintFrontend by tasks.registering(RunYarn::class) { 95 register<RunYarn>("fixFrontend") {
88 dependsOn(tasks.installFrontend) 96 dependsOn(installFrontend)
89 dependsOn(generateXStateTypes) 97 dependsOn(generateXStateTypes)
90 dependsOn(typeCheckFrontend) 98 dependsOn(typeCheckFrontend)
91 inputs.files(lintingFiles) 99 inputs.files(lintingFiles)
92 outputs.file("$buildDir/eslint.json") 100 script.set("run lint:fix")
93 script.set("run lint") 101 group = "verification"
94 group = "verification" 102 description = "Fix TypeScript lint errors and warnings."
95 description = "Check for TypeScript lint errors and warnings." 103 }
96}
97 104
98val fixFrontend by tasks.registering(RunYarn::class) { 105 check {
99 dependsOn(tasks.installFrontend) 106 dependsOn(typeCheckFrontend)
100 dependsOn(generateXStateTypes) 107 dependsOn(lintFrontend)
101 dependsOn(typeCheckFrontend) 108 }
102 inputs.files(lintingFiles)
103 script.set("run lint:fix")
104 group = "verification"
105 description = "Fix TypeScript lint errors and warnings."
106}
107 109
108tasks.check { 110 register<RunYarn>("serveFrontend") {
109 dependsOn(typeCheckFrontend) 111 dependsOn(installFrontend)
110 dependsOn(lintFrontend) 112 dependsOn(generateXStateTypes)
111} 113 inputs.files(assembleFiles)
114 outputs.dir("$viteOutputDir/development")
115 script.set("run serve")
116 group = "run"
117 description = "Start a Vite dev server with hot module replacement."
118 }
112 119
113tasks.register<RunYarn>("serveFrontend") { 120 clean {
114 dependsOn(tasks.installFrontend) 121 delete("dev-dist")
115 dependsOn(generateXStateTypes) 122 delete(fileTree("src") {
116 inputs.files(assembleFiles) 123 include("**/*.typegen.ts")
117 outputs.dir("$viteOutputDir/development") 124 })
118 script.set("run serve") 125 }
119 group = "run"
120 description = "Start a Vite dev server with hot module replacement."
121} 126}
122 127
123tasks.clean { 128artifacts {
124 delete("dev-dist") 129 add("productionAssets", productionResources) {
125 delete(fileTree("src") { 130 builtBy(tasks.assembleFrontend)
126 include("**/*.typegen.ts") 131 }
127 })
128} 132}
129 133
130sonarqube.properties { 134sonarqube.properties {
diff --git a/subprojects/language-ide/build.gradle.kts b/subprojects/language-ide/build.gradle.kts
index 28a460e8..f996c00d 100644
--- a/subprojects/language-ide/build.gradle.kts
+++ b/subprojects/language-ide/build.gradle.kts
@@ -1,6 +1,6 @@
1plugins { 1plugins {
2 id("refinery-java-library") 2 id("tools.refinery.gradle.java-library")
3 id("refinery-xtext-conventions") 3 id("tools.refinery.gradle.xtext-generated")
4} 4}
5 5
6dependencies { 6dependencies {
diff --git a/subprojects/language-model/build.gradle.kts b/subprojects/language-model/build.gradle.kts
index 2804c698..12b6bc13 100644
--- a/subprojects/language-model/build.gradle.kts
+++ b/subprojects/language-model/build.gradle.kts
@@ -1,9 +1,9 @@
1import tools.refinery.buildsrc.SonarPropertiesUtils 1import tools.refinery.gradle.utils.SonarPropertiesUtils
2 2
3plugins { 3plugins {
4 id("refinery-java-library") 4 id("tools.refinery.gradle.java-library")
5 id("refinery-mwe2") 5 id("tools.refinery.gradle.mwe2")
6 id("refinery-sonarqube") 6 id("tools.refinery.gradle.sonarqube")
7} 7}
8 8
9dependencies { 9dependencies {
@@ -22,24 +22,26 @@ sourceSets {
22 } 22 }
23} 23}
24 24
25val generateEPackage by tasks.registering(JavaExec::class) { 25tasks {
26 mainClass.set("org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher") 26 val generateEPackage by registering(JavaExec::class) {
27 classpath(configurations.mwe2) 27 mainClass.set("org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher")
28 inputs.file("src/main/java/tools/refinery/language/model/GenerateProblemModel.mwe2") 28 classpath(configurations.mwe2)
29 inputs.file("src/main/resources/model/problem.ecore") 29 inputs.file("src/main/java/tools/refinery/language/model/GenerateProblemModel.mwe2")
30 inputs.file("src/main/resources/model/problem.genmodel") 30 inputs.file("src/main/resources/model/problem.ecore")
31 outputs.dir("src/main/emf-gen") 31 inputs.file("src/main/resources/model/problem.genmodel")
32 args("src/main/java/tools/refinery/language/model/GenerateProblemModel.mwe2", "-p", "rootPath=/$projectDir") 32 outputs.dir("src/main/emf-gen")
33} 33 args("src/main/java/tools/refinery/language/model/GenerateProblemModel.mwe2", "-p", "rootPath=/$projectDir")
34 }
34 35
35for (taskName in listOf("compileJava", "processResources", "generateEclipseSourceFolders")) { 36 for (taskName in listOf("compileJava", "processResources", "generateEclipseSourceFolders")) {
36 tasks.named(taskName) { 37 named(taskName) {
37 dependsOn(generateEPackage) 38 dependsOn(generateEPackage)
39 }
38 } 40 }
39}
40 41
41tasks.clean { 42 clean {
42 delete("src/main/emf-gen") 43 delete("src/main/emf-gen")
44 }
43} 45}
44 46
45sonarqube.properties { 47sonarqube.properties {
diff --git a/subprojects/language-semantics/build.gradle.kts b/subprojects/language-semantics/build.gradle.kts
index e13e5e4a..bf016dc9 100644
--- a/subprojects/language-semantics/build.gradle.kts
+++ b/subprojects/language-semantics/build.gradle.kts
@@ -1,5 +1,5 @@
1plugins { 1plugins {
2 id("refinery-java-library") 2 id("tools.refinery.gradle.java-library")
3} 3}
4 4
5dependencies { 5dependencies {
diff --git a/subprojects/language-web/build.gradle.kts b/subprojects/language-web/build.gradle.kts
index b59763a8..d2a39d56 100644
--- a/subprojects/language-web/build.gradle.kts
+++ b/subprojects/language-web/build.gradle.kts
@@ -1,6 +1,6 @@
1plugins { 1plugins {
2 id("refinery-java-application") 2 id("tools.refinery.gradle.java-application")
3 id("refinery-xtext-conventions") 3 id("tools.refinery.gradle.xtext-generated")
4} 4}
5 5
6val webapp: Configuration by configurations.creating { 6val webapp: Configuration by configurations.creating {
@@ -21,64 +21,66 @@ dependencies {
21 testImplementation(libs.jetty.websocket.client) 21 testImplementation(libs.jetty.websocket.client)
22} 22}
23 23
24val generateXtextLanguage by project(":refinery-language").tasks.existing
25
26for (taskName in listOf("compileJava", "processResources")) {
27 tasks.named(taskName) {
28 dependsOn(generateXtextLanguage)
29 }
30}
31
32application { 24application {
33 mainClass.set("tools.refinery.language.web.ServerLauncher") 25 mainClass.set("tools.refinery.language.web.ServerLauncher")
34 // Enable JDK 19 preview features for virtual thread support. 26 // Enable JDK 19 preview features for virtual thread support.
35 applicationDefaultJvmArgs += "--enable-preview" 27 applicationDefaultJvmArgs += "--enable-preview"
36} 28}
37 29
38tasks.withType(JavaCompile::class) {
39 options.release.set(19)
40 // Enable JDK 19 preview features for virtual thread support.
41 options.compilerArgs.plusAssign("--enable-preview")
42}
43
44// Enable JDK 19 preview features for virtual thread support. 30// Enable JDK 19 preview features for virtual thread support.
45fun enablePreview(task: JavaForkOptions) { 31fun enablePreview(task: JavaForkOptions) {
46 task.jvmArgs("--enable-preview") 32 task.jvmArgs("--enable-preview")
47} 33}
48 34
49tasks.withType(Test::class) { 35tasks {
50 enablePreview(this) 36 val generateXtextLanguage by project(":refinery-language").tasks.existing
51}
52 37
53tasks.jar { 38 for (taskName in listOf("compileJava", "processResources")) {
54 dependsOn(webapp) 39 named(taskName) {
55 from(webapp) { 40 dependsOn(generateXtextLanguage)
56 into("webapp") 41 }
57 } 42 }
58}
59 43
60tasks.shadowJar { 44 withType(JavaCompile::class) {
61 dependsOn(webapp) 45 options.release.set(19)
62 from(project.sourceSets.main.map { it.output }) 46 // Enable JDK 19 preview features for virtual thread support.
63 exclude("META-INF/INDEX.LIST", "META-INF/*.SF", "META-INF/*.DSA", "META-INF/*.RSA","schema/*", 47 options.compilerArgs.plusAssign("--enable-preview")
64 ".options", ".api_description", "*.profile", "about.*", "about_*.html", "about_files/*", 48 }
65 "plugin.xml", "systembundle.properties", "profile.list", "META-INF/resources/xtext/**") 49
66 append("plugin.properties") 50 withType(Test::class) {
67 from(webapp) { 51 enablePreview(this)
68 into("webapp") 52 }
53
54 jar {
55 dependsOn(webapp)
56 from(webapp) {
57 into("webapp")
58 }
59 }
60
61 shadowJar {
62 dependsOn(webapp)
63 from(project.sourceSets.main.map { it.output })
64 exclude("META-INF/INDEX.LIST", "META-INF/*.SF", "META-INF/*.DSA", "META-INF/*.RSA", "schema/*",
65 ".options", ".api_description", "*.profile", "about.*", "about_*.html", "about_files/*",
66 "plugin.xml", "systembundle.properties", "profile.list", "META-INF/resources/xtext/**")
67 append("plugin.properties")
68 from(webapp) {
69 into("webapp")
70 }
69 } 71 }
70}
71 72
72tasks.register<JavaExec>("serveBackend") { 73 register<JavaExec>("serveBackend") {
73 dependsOn(webapp) 74 dependsOn(webapp)
74 val mainRuntimeClasspath = sourceSets.main.map { it.runtimeClasspath } 75 val mainRuntimeClasspath = sourceSets.main.map { it.runtimeClasspath }
75 dependsOn(mainRuntimeClasspath) 76 dependsOn(mainRuntimeClasspath)
76 classpath(mainRuntimeClasspath) 77 classpath(mainRuntimeClasspath)
77 mainClass.set(application.mainClass) 78 mainClass.set(application.mainClass)
78 enablePreview(this) 79 enablePreview(this)
79 standardInput = System.`in` 80 standardInput = System.`in`
80 val baseResource = webapp.incoming.artifacts.artifactFiles.first() 81 val baseResource = webapp.incoming.artifacts.artifactFiles.first()
81 environment("BASE_RESOURCE", baseResource) 82 environment("BASE_RESOURCE", baseResource)
82 group = "run" 83 group = "run"
83 description = "Start a Jetty web server serving the Xtex API and assets." 84 description = "Start a Jetty web server serving the Xtex API and assets."
85 }
84} 86}
diff --git a/subprojects/language/build.gradle.kts b/subprojects/language/build.gradle.kts
index ed4f95a5..4cfe6895 100644
--- a/subprojects/language/build.gradle.kts
+++ b/subprojects/language/build.gradle.kts
@@ -1,11 +1,11 @@
1import tools.refinery.buildsrc.SonarPropertiesUtils 1import tools.refinery.gradle.utils.SonarPropertiesUtils
2 2
3plugins { 3plugins {
4 id("refinery-java-library") 4 id("tools.refinery.gradle.java-library")
5 id("refinery-java-test-fixtures") 5 id("tools.refinery.gradle.java-test-fixtures")
6 id("refinery-sonarqube") 6 id("tools.refinery.gradle.mwe2")
7 id("refinery-mwe2") 7 id("tools.refinery.gradle.sonarqube")
8 id("refinery-xtext-conventions") 8 id("tools.refinery.gradle.xtext-generated")
9} 9}
10 10
11dependencies { 11dependencies {
@@ -26,36 +26,38 @@ sourceSets {
26 } 26 }
27} 27}
28 28
29tasks.jar { 29tasks {
30 from(sourceSets.main.map { it.allSource }) { 30 jar {
31 include("**/*.xtext") 31 from(sourceSets.main.map { it.allSource }) {
32 include("**/*.xtext")
33 }
32 } 34 }
33}
34 35
35val generateXtextLanguage by tasks.registering(JavaExec::class) { 36 val generateXtextLanguage by registering(JavaExec::class) {
36 mainClass.set("org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher") 37 mainClass.set("org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher")
37 classpath(configurations.mwe2) 38 classpath(configurations.mwe2)
38 inputs.file("src/main/java/tools/refinery/language/GenerateProblem.mwe2") 39 inputs.file("src/main/java/tools/refinery/language/GenerateProblem.mwe2")
39 inputs.file("src/main/java/tools/refinery/language/Problem.xtext") 40 inputs.file("src/main/java/tools/refinery/language/Problem.xtext")
40 outputs.dir("src/main/xtext-gen") 41 outputs.dir("src/main/xtext-gen")
41 outputs.dir("src/testFixtures/xtext-gen") 42 outputs.dir("src/testFixtures/xtext-gen")
42 outputs.dir("../language-ide/src/main/xtext-gen") 43 outputs.dir("../language-ide/src/main/xtext-gen")
43 outputs.dir("../language-web/src/main/xtext-gen") 44 outputs.dir("../language-web/src/main/xtext-gen")
44 args("src/main/java/tools/refinery/language/GenerateProblem.mwe2", "-p", "rootPath=/$projectDir/..") 45 args("src/main/java/tools/refinery/language/GenerateProblem.mwe2", "-p", "rootPath=/$projectDir/..")
45} 46 }
46 47
47for (taskName in listOf("compileJava", "processResources", "processTestFixturesResources", 48 for (taskName in listOf("compileJava", "processResources", "processTestFixturesResources",
48 "generateEclipseSourceFolders")) { 49 "generateEclipseSourceFolders")) {
49 tasks.named(taskName) { 50 named(taskName) {
50 dependsOn(generateXtextLanguage) 51 dependsOn(generateXtextLanguage)
52 }
51 } 53 }
52}
53 54
54tasks.clean { 55 clean {
55 delete("src/main/xtext-gen") 56 delete("src/main/xtext-gen")
56 delete("src/testFixtures/xtext-gen") 57 delete("src/testFixtures/xtext-gen")
57 delete("../language-ide/src/main/xtext-gen") 58 delete("../language-ide/src/main/xtext-gen")
58 delete("../language-web/src/main/xtext-gen") 59 delete("../language-web/src/main/xtext-gen")
60 }
59} 61}
60 62
61sonarqube.properties { 63sonarqube.properties {
diff --git a/subprojects/store-query-viatra/build.gradle.kts b/subprojects/store-query-viatra/build.gradle.kts
index 7451dd83..4a894f52 100644
--- a/subprojects/store-query-viatra/build.gradle.kts
+++ b/subprojects/store-query-viatra/build.gradle.kts
@@ -1,5 +1,5 @@
1plugins { 1plugins {
2 id("refinery-java-library") 2 id("tools.refinery.gradle.java-library")
3} 3}
4 4
5dependencies { 5dependencies {
diff --git a/subprojects/store-query/build.gradle.kts b/subprojects/store-query/build.gradle.kts
index 16dbd95d..889a0479 100644
--- a/subprojects/store-query/build.gradle.kts
+++ b/subprojects/store-query/build.gradle.kts
@@ -1,6 +1,6 @@
1plugins { 1plugins {
2 id("refinery-java-library") 2 id("tools.refinery.gradle.java-library")
3 id("refinery-java-test-fixtures") 3 id("tools.refinery.gradle.java-test-fixtures")
4} 4}
5 5
6dependencies { 6dependencies {
diff --git a/subprojects/store-reasoning/build.gradle.kts b/subprojects/store-reasoning/build.gradle.kts
index fe15fc42..bb37d9d3 100644
--- a/subprojects/store-reasoning/build.gradle.kts
+++ b/subprojects/store-reasoning/build.gradle.kts
@@ -1,5 +1,5 @@
1plugins { 1plugins {
2 id("refinery-java-library") 2 id("tools.refinery.gradle.java-library")
3} 3}
4 4
5dependencies { 5dependencies {
diff --git a/subprojects/store/build.gradle.kts b/subprojects/store/build.gradle.kts
index 5b4eac46..d62e5159 100644
--- a/subprojects/store/build.gradle.kts
+++ b/subprojects/store/build.gradle.kts
@@ -1,4 +1,4 @@
1plugins { 1plugins {
2 id("refinery-java-library") 2 id("tools.refinery.gradle.java-library")
3 id("refinery-jmh") 3 id("tools.refinery.gradle.jmh")
4} 4}