-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
148 lines (124 loc) · 4.07 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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
/*
* This build file was auto generated by running the Gradle 'init' task
* by 'ivo' at '6/23/16 1:18 PM' with Gradle 2.10
*
* This generated file contains a sample Java project to get you started.
* For more details take a look at the Java Quickstart chapter in the Gradle
* user guide available at https://docs.gradle.org/2.10/userguide/tutorial_java_projects.html
*/
// for getting platform details
import org.apache.tools.ant.taskdefs.condition.Os
// Apply the java plugin to add support for Java
apply plugin: 'java'
apply plugin: 'eclipse'
// In this section you declare where to find the dependencies of your project
repositories {
// Use 'jcenter' for resolving your dependencies.
// You can declare any Maven/Ivy/file repository here.
jcenter()
}
configurations {
sablecc
}
dependencies {
sablecc(group: 'de.hhu.stups', name: 'sablecc', version: '3.2.10')
// compile 'com.google.code.findbugs:jsr305:1.3.9'
testCompile group: 'junit', name: 'junit', version: '4.+'
// prologlib(group: 'de.hhu.stups', name: 'prologlib', version: '2.4.40')
// compile "de.hhu.stups:prologlib:2.4.40"
// testCompile 'de.hhu.stups:prologlib:2.4.40'
}
sourceSets {
main {
java {
srcDirs = ['build/temp','src/main/java', 'src/performance/java']
}
}
}
def download(address,target) {
if (!file("$target").exists()) {
def file = new FileOutputStream(target)
def out = new BufferedOutputStream(file)
out << new URL(address).openStream()
out.close()
}
}
task downloadCSPMFrontend << {
def platform = System.getProperty('os.name').toLowerCase()
def arch = System.getProperty('os.arch').toLowerCase()
def libName = 'cspmf'
def osPref = ''
def archPref = ''
if (platform.contains('mac')) {
osPref += 'darwin-'
} else if (platform.contains('linux')) {
osPref += 'linux-'
} else {
osPref += 'windows'
libName += '.exe'
}
if(arch.contains('64')) {
archPref += '64'
} else {
archPref += '32'
}
if(platform.contains('windows')) {
download('https://www3.hhu.de/stups/downloads/cspmf/'+osPref+'/'+libName, libName)
} else {
download('https://www3.hhu.de/stups/downloads/cspmf/'+osPref+archPref+'/'+libName, libName)
}
}
task genLtlParser(type:JavaExec) {
doFirst{ file('build/temp').mkdirs() }
inputs.dir new File('src/main/resources/grammars')
outputs.dir new File('build/temp')
main = 'org.sablecc.sablecc.SableCC'
classpath = configurations.sablecc
maxHeapSize = '1024m'
args = ['-d','build/temp','src/main/resources/LtlParser.scc']
}
task genCtlParser(type:JavaExec) {
doFirst{ file('build/temp').mkdirs() }
inputs.dir new File('src/main/resources/grammars')
outputs.dir new File('build/temp')
main = 'org.sablecc.sablecc.SableCC'
classpath = configurations.sablecc
maxHeapSize = '1024m'
args = ['-d','build/temp','src/main/resources/CtlParser.scc']
}
task genCSPMparser(type:JavaExec) {
doFirst{ file('build/temp').mkdirs() }
inputs.dir new File('src/main/resources/grammars')
outputs.dir new File('build/temp')
main = 'org.sablecc.sablecc.SableCC'
classpath = configurations.sablecc
maxHeapSize = '1024m'
args = ['-d','build/temp','src/main/resources/CSPMparser.scc']
//args = ['-d','build/temp','src/main/resources/MiniParserAST.scc']
}
jar {
baseName = 'cspmj'
from 'bin'
include '**/*.class'
include '**.*.class'
exclude '**.*.scc'
from 'build/temp'
include '**/*.dat'
from sourceSets.main.toString()
include '**/*.java'
manifest { attributes 'Main-Class': 'CSPMparser' }
}
compileJava {
dependsOn = ['genLtlParser','genCtlParser','genCSPMparser', 'downloadCSPMFrontend']
def platform = System.getProperty('os.name').toLowerCase()
def libName = 'cspmf'
if(platform.contains('windows')) {
libName += '.exe'
}
copy {
from libName
into 'build/classes/main/'
fileMode 0755
}
}
sourceSets.test.runtimeClasspath += files(sourceSets.main.java.srcDirs)