-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.gradle
More file actions
85 lines (71 loc) · 2.38 KB
/
Copy pathbuild.gradle
File metadata and controls
85 lines (71 loc) · 2.38 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
85
plugins {
id 'org.jetbrains.kotlin.jvm' version "${kotlinVersion}"
id "org.jlleitschuh.gradle.ktlint" version "10.1.0"
id "antlr"
id "idea"
}
repositories {
mavenCentral()
mavenLocal()
}
def generatedMain = "generated-src/antlr/main"
def generatedMainFile = file(generatedMain)
dependencies {
antlr "org.antlr:antlr4:$antlrVersion"
implementation "org.antlr:antlr4-runtime:$antlrVersion"
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion"
implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlinVersion"
implementation "org.apache.logging.log4j:log4j-api-kotlin:1.0.0"
implementation "org.apache.logging.log4j:log4j-api:2.12.1"
implementation "org.apache.logging.log4j:log4j-core:2.12.1"
implementation 'com.strumenta.kolasu:kolasu-core:1.3.3'
testImplementation "org.jetbrains.kotlin:kotlin-test:$kotlinVersion"
testImplementation "org.jetbrains.kotlin:kotlin-test-junit:$kotlinVersion"
}
configurations.all() {
resolutionStrategy.force "org.antlr:antlr4-runtime:$antlrVersion"
resolutionStrategy.force "org.antlr:antlr4-tool:$antlrVersion"
}
generateGrammarSource {
inputs.files fileTree('src/main/antlr').include('**/*.g4')
maxHeapSize = "64m"
arguments += ['-package', 'com.strumenta.python3parser']
outputDirectory = file(generatedMain + "/com/strumenta/python3parser")
}
compileJava {
sourceCompatibility = "$jvmVersion"
targetCompatibility = "$jvmVersion"
dependsOn generateGrammarSource
source generatedMainFile, sourceSets.main.java
}
compileTestKotlin {
sourceCompatibility = "$jvmVersion"
targetCompatibility = "$jvmVersion"
kotlinOptions.jvmTarget = "$jvmVersion"
}
compileKotlin {
sourceCompatibility = "$jvmVersion"
targetCompatibility = "$jvmVersion"
source generatedMainFile, sourceSets.main.java, sourceSets.main.kotlin
kotlinOptions.jvmTarget = "$jvmVersion"
dependsOn generateGrammarSource
}
clean {
delete file(generatedMain)
mkdir generatedMain
}
idea {
module {
mkdir generatedMain
sourceDirs += generatedMainFile
println sourceDirs
}
}
ktlint {
version = "0.41.0"
verbose = true
outputToConsole = true
enableExperimentalRules = true
disabledRules = ["no-wildcard-imports", "experimental:argument-list-wrapping"]
}