-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
134 lines (110 loc) · 3.46 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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
//Adapted from TA Shiyuan
//DEVELOPMENT
buildscript {
ext.kotlin_version = '1.7.21'
repositories {
// flatDir { dirs 'dependencies/plugins' }
//INCLUDE FOR DOWNLOAD
mavenCentral()
}
dependencies {
// classpath fileTree(dir: 'dependencies/plugins', include: '*.jar')
// classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
plugins {
//INCLUDE FOR DOWNLOAD
id "org.jetbrains.kotlin.jvm" version "$kotlin_version"
id 'java'
id "com.github.johnrengelman.shadow" version "7.1.2"
}
repositories {
//INCLUDE FOR DOWNLOAD
mavenCentral()
// flatDir(dir: 'dependencies/plugins')
// flatDir(dir: 'dependencies/test')
// flatDir(dir: 'dependencies/main')
}
apply plugin: 'java'
apply plugin: 'kotlin'
apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'org.jetbrains.kotlin.jvm'
test {
useJUnitPlatform()
}
dependencies {
implementation fileTree(dir: 'dependencies/custom', include: '*.jar')
//EXCLUDE FOR DOWNLOAD
// implementation fileTree(dir: 'dependencies/main', include: '*.jar')
// implementation fileTree(dir: 'dependencies/test', include: '*.jar')
// kotlinCompilerClasspath fileTree(dir: 'dependencies/plugins', include: '*.jar')
// kotlinCompilerClasspath fileTree(dir: 'dependencies/main', include: '*.jar')
//INCLUDE FOR DOWNLOAD
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
implementation "org.jetbrains.kotlin:kotlin-script-util:$kotlin_version"
implementation "org.jetbrains.kotlin:kotlin-script-runtime:$kotlin_version"
implementation "com.github.ajalt.clikt:clikt:3.5.1"
}
group 'com.jaek'
version '1.0'
sourceCompatibility = 1.8
task jflex(type: Exec) {
commandLine "jflex", "-q", "-d", "src/main/java", "src/main/jflex/Lexer.flex"
dependsOn 'cup'
mustRunAfter 'cup'
}
task cup(type: Exec) {
commandLine "./cup", "-destdir", "src/main/java", "-symbols", "SymbolTable", "src/main/cup/eta.cup"
}
build {
dependsOn 'jflex'
mustRunAfter 'jflex'
dependsOn 'cup'
mustRunAfter 'cup'
}
compileKotlin {
kotlinOptions.jvmTarget = "1.8"
}
compileTestKotlin {
kotlinOptions.jvmTarget = "1.8"
}
shadowJar {
dependsOn "build"
archiveBaseName.set('jaek')
manifest {
attributes 'Main-Class': 'MainKt'
}
}
task copyRuntimeDependenciesToLib(type: Copy) {
includeEmptyDirs = true
into "dependencies/runtime"
from configurations.runtimeClasspath
}
task copyMainDependenciesToLib(type: Copy) {
includeEmptyDirs = true
into "dependencies/main"
from configurations.runtimeClasspath
}
task copyTestDependenciesToLib(type: Copy) {
includeEmptyDirs = true
into "dependencies/test"
from configurations.testRuntimeClasspath - configurations.runtimeClasspath
}
task copyCompileOnlyDependenciesToLib(type: Copy) {
includeEmptyDirs = true
into "dependencies/compile-only"
from configurations.compileClasspath - configurations.runtimeClasspath
}
task copyPluginJarsToLib(type: Copy) {
includeEmptyDirs = true
into "dependencies/plugins"
from buildscript.configurations.classpath
}
task copyDependenciesToLib {
dependsOn 'copyMainDependenciesToLib'
dependsOn 'copyTestDependenciesToLib'
dependsOn 'copyCompileOnlyDependenciesToLib'
dependsOn 'copyPluginJarsToLib'
}