-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
84 lines (64 loc) · 2.26 KB
/
build.gradle
File metadata and controls
84 lines (64 loc) · 2.26 KB
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
description = "MontiCore: Java DSL EMF"
def srcMainDir = "$buildDir/copied-sources/main"
def srcTestDir = "$buildDir/copied-sources/test"
def grammarsDir = "${project(":javaDSL").projectDir}/src/main/grammars"
sourceSets {
main.java.srcDirs("$srcMainDir/java", "$buildDir/generated-sources/monticore/sourcecode")
test.java.srcDirs("$srcTestDir/java")
grammars {
resources {
srcDir(grammarsDir)
include "**/*.mc4"
}
}
}
java {
registerFeature("grammars") {
usingSourceSet(sourceSets.grammars)
}
}
task copyMainSources(type: Copy) {
destinationDir = file srcMainDir
from "${project(':javaDSL').projectDir}/src/main"
}
task copyTestSources(type: Copy) {
destinationDir = file srcTestDir
from "${project(':javaDSL').projectDir}/src/main"
}
tasks.register("generateTextBlock", MCTask) {
dependsOn(copyMainSources, copyTestSources)
grammar = file "$grammarsDir/de/monticore/java/TextBlock.mc4"
outputDir = file "$buildDir/generated-sources/monticore/sourcecode"
handcodedPath "$srcMainDir/java"
script = "de/monticore/monticore_emf.groovy"
def upToDate = incCheck("de/monticore/java/TextBlock.mc4")
outputs.upToDateWhen { upToDate }
}
tasks.register("generate", MCTask) {
dependsOn(tasks.generateTextBlock)
dependsOn(copyMainSources, copyTestSources)
grammar = file "$grammarsDir/de/monticore/java/JavaDSL.mc4"
outputDir = file "$buildDir/generated-sources/monticore/sourcecode"
modelPath "$grammarsDir"
handcodedPath "$srcMainDir/java"
script = "de/monticore/monticore_emf.groovy"
def upToDate = incCheck("de/monticore/java/JavaDSL.mc4")
outputs.upToDateWhen { upToDate }
}
dependencies {
implementation(platform(libs.junit.bom))
implementation "de.monticore.lang:cd4analysis:7.7.0-SNAPSHOT"
api(libs.monticore.grammar.emf)
api(libs.monticore.runtime.emf)
api(libs.emf.common)
api(libs.emf.ecore)
api(libs.emf.ecore.xmi)
grammar(libs.monticore.grammar) {
capabilities {
requireCapability("de.monticore:monticore-grammar-grammars")
}
}
testImplementation(libs.junit.jupiter.api)
testImplementation(libs.junit.jupiter.params)
testRuntimeOnly(libs.junit.jupiter.engine)
}