forked from JMU-CS/less-java
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
71 lines (57 loc) · 1.54 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
plugins {
id 'java'
id 'eclipse'
id 'antlr'
id 'application'
}
// Configure subprojects
subprojects {
apply plugin: 'java'
}
// In this section you declare where to find the dependencies of your project
repositories {
mavenCentral()
}
// In this section you declare the dependencies for your production and test code
dependencies {
// JUnit
compile 'junit:junit:4.12'
testCompile 'junit:junit:4.12'
// ANTLR v4
antlr 'org.antlr:antlr4:4.5.3'
}
// Tasks
run {
mainClassName = 'com.github.lessjava.LJCompiler'
def defaultTestfile = 'tests/fact.lj'
args = (project.hasProperty('testfile')) ? [testfile] : [defaultTestfile]
}
jar {
manifest {
attributes 'Main-Class': 'com.github.lessjava.LJCompiler'
}
}
generateGrammarSource {
arguments += ['-package', 'com.github.lessjava.generated']
outputDirectory = file('build/generated-src/antlr/main/com/github/lessjava/generated')
}
clean.doLast {
file('generated').deleteDir()
}
task fatJar(type:Jar) {
group 'LessJava'
description 'Assemble Fat JAR'
manifest {
attributes 'Main-Class': 'com.github.lessjava.LJCompiler'
}
baseName = 'lj-all'
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
with jar
}
task copyWrappers (type:Copy, dependsOn:':ljwrappers:classes') {
group 'LessJava'
description 'Copy compiled source from wrappers subproject'
from files(project('ljwrappers').sourceSets.main.runtimeClasspath)
into 'generated/'
}
run.dependsOn(copyWrappers)