forked from Codetector1374/lc3-intelliJ
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
86 lines (73 loc) · 2.17 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
plugins {
id 'java'
id 'org.jetbrains.intellij' version '0.4.2'
id 'org.jetbrains.kotlin.jvm' version '1.3.21'
id "org.jetbrains.grammarkit" version "2018.3"
}
apply plugin: 'org.jetbrains.grammarkit'
group 'cn.codetector.lc3'
version '1.1.1'
sourceCompatibility = 1.8
// import is optional to make task creation easier
import org.jetbrains.grammarkit.tasks.GenerateParser
import org.jetbrains.grammarkit.tasks.GenerateLexer
import org.jetbrains.kotlin.gradle.plugin.KotlinSourceSet
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
grammarKit {
// version of IntelliJ patched JFlex (see bintray link below), Default is 1.7.0-1
jflexRelease = '1.7.0-1'
// tag or short commit hash of Grammar-Kit to use (see link below). Default is 2017.1.7
grammarKitRelease = '6452fde524'
}
task generateLc3AsmLexer(type: GenerateLexer) {
group = "lexer"
source = "grammar/lc3asm.flex"
targetDir = "gen/cn/codetector/lc3/lc3intellij/lang"
targetClass = "LC3ASMLexer"
purgeOldFiles = true
}
task generateLc3Parser(type: GenerateParser) {
group = "parser"
source = "grammar/LC3ASM.bnf"
targetRoot = "gen/"
pathToParser = "cn/codetector/lc3/lc3intellij/lang/LC3Parser.java"
pathToPsiRoot = "cn/codetector/lc3/lc3intellij/psi"
purgeOldFiles = true
}
sourceSets {
getByName("main") {
java.srcDirs("gen", "src/main/kotlin")
kotlin.srcDirs("src/main/kotlin", "gen")
resources.srcDirs("res")
}
}
repositories {
mavenCentral()
}
dependencies {
// implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
testCompile group: 'junit', name: 'junit', version: '4.12'
}
compileKotlin {
kotlinOptions.jvmTarget = "1.8"
}
tasks.withType(KotlinCompile) {
dependsOn(
generateLc3AsmLexer,
generateLc3Parser
)
}
compileTestKotlin {
kotlinOptions.jvmTarget = "1.8"
}
intellij {
version 'IC-2018.2'
sandboxDirectory = "$project.buildDir/myCustom-sandbox"
pluginName 'LC3-ASM'
intellij.updateSinceUntilBuild false
}
patchPluginXml {
changeNotes """
<p>1.1.1 - Fix some invalid instruction issues</p>
<p>1.1.0 - Add Symbolic execution engine</p>"""
}