-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
108 lines (85 loc) · 2.44 KB
/
build.gradle
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
buildscript {
ext.kotlin_version = '1.7.10'
repositories {
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
plugins {
id "org.jetbrains.intellij" version "1.13.3"
id "org.jetbrains.grammarkit" version "2022.3.1"
}
group 'org.cutejs'
version '1.1.2'
sourceCompatibility = "17"
targetCompatibility = "17"
apply plugin: 'kotlin'
apply plugin: 'org.jetbrains.intellij'
sourceSets {
all {
java.srcDirs += ['src/main/gen']
kotlin.srcDirs += ['src/main/kotlin']
resources.srcDirs = ['src/main/resources']
}
}
grammarKit {
jflexRelease = "1.7.0-1"
}
repositories {
mavenCentral()
}
dependencies {
testImplementation group: 'junit', name: 'junit', version: '4.13.1'
compileOnly fileTree(dir: '/opt/phpstorm/plugins/javascript-impl/lib', include: ['javascript-impl.jar', 'javascript-openapi.jar', 'resources_en.jar', 'js-test-common.jar'])
}
intellij {
version = '2023.1'
runIde { ideDir = file('/opt/phpstorm') }
downloadSources = true
pluginName = 'cutejs-intellij-plugin'
plugins = ['PsiViewer:231-SNAPSHOT']
}
patchPluginXml {
sinceBuild = "231"
changeNotes = """
<ul>
<li>Support for 2023.1 Intellij platform.</li>
</ul>
"""
}
apply plugin: 'org.jetbrains.grammarkit'
import org.jetbrains.grammarkit.tasks.GenerateLexerTask
import org.jetbrains.grammarkit.tasks.GenerateParserTask
def GENERATE_GROUP = 'Generate'
task generateCuteJSLexer(type: GenerateLexerTask) {
sourceFile = file('src/main/grammar/CuteJS.flex')
targetDir = 'src/main/gen/org/cutejs/lang/lexer'
targetClass = "_CuteLexer"
purgeOldFiles = true
description = 'Generate Lexer Java sources for CuteJS'
group = GENERATE_GROUP
}
task generateCuteJSParser(type: GenerateParserTask) {
sourceFile = file('src/main/grammar/CuteJS.bnf')
targetRoot = 'src/main/gen'
pathToParser = 'src/main/gen/org/cutejs/lang/CuteParser.java'
pathToPsiRoot = 'src/main/gen/org/cutejs/lang/psi'
purgeOldFiles = true
description = 'Generate Parser Java sources for CuteJS'
group = GENERATE_GROUP
// patch up to date check
outputs.upToDateWhen { false }
}
compileKotlin {
kotlinOptions.jvmTarget = "17"
}
compileJava {
dependsOn generateCuteJSLexer
dependsOn generateCuteJSParser
}
compileKotlin {
dependsOn generateCuteJSLexer
dependsOn generateCuteJSParser
}