-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
195 lines (159 loc) · 5.47 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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
buildscript {
dependencies { classpath files('lib/build/clojuresque-1.4.1.jar',
'lib/build/runtime-1.4.1.jar') }
}
subprojects {
version = "0.1.0"
repositories {
flatDir dirs: project(':').file('lib/compile').absoluteFile
flatDir dirs: project(':').file('lib/runtime').absoluteFile
flatDir dirs: project(':').file('lib/build').absoluteFile
}
}
project(':active_papers') {
apply plugin: "java"
apply plugin: "clojure"
compileClojure.dependsOn compileJava
aotCompile = true
dependencies {
compile ":clojure:1.2.1"
compile ":clojure-contrib:1.2.0"
compile ":clj-hdf5:0.1"
compile ":jhdf5:11.05.2"
}
jar {
include "active_papers/**"
include "active_paper_runtime/**"
}
}
project(':active_paper_cltool') {
apply plugin: "clojure"
aotCompile = true
configurations.compile.transitive = true
uberjar.enabled = true
dependencies {
compile project(':active_papers')
runtime ":swank-clojure:1.4.0-SNAPSHOT"
}
jar {
include "active_papers/cltool*"
include "active_papers/cltool/**"
}
uberjar {
manifest {
attributes('Main-Class': 'active_papers.cltool')
}
}
}
project(':language_support/clojure_runtime') {
apply plugin: "java"
apply plugin: "clojure"
dependencies {
compile project(':active_papers')
}
jar {
include "clojure/launcher.class"
include "active_paper_clojure_runtime/**"
}
task makeLibrary(type: MakeLibraryTask) {
paper = 'clojure.h5'
lib_dir = project.getRootDir()
libs = ['clojure': 'lib/compile/clojure-1.2.1.jar',
'clojure-contrib': 'lib/compile/clojure-contrib-1.2.0.jar',
'clojure-scripting': 'lib/support/clojure-jsr223.jar',
'clojure-hdf5': 'lib/compile/clj-hdf5-0.1.jar',
'clojure-runtime': project.jar.archivePath,
'clojure-swank': 'lib/runtime/swank-clojure-1.4.0-SNAPSHOT.jar']
}
makeLibrary.dependsOn jar
build.dependsOn makeLibrary
task makeLibraryIncanter(type: MakeLibraryTask) {
paper = 'incanter.h5'
lib_dir = project.getRootDir()
libs = ['incanter': 'lib/support/incanter.jar',
'clojure-hdf5': 'lib/compile/clj-hdf5-0.1.jar',
'clojure-runtime': project.jar.archivePath,
'clojure-swank': 'lib/runtime/swank-clojure-1.4.0-SNAPSHOT.jar']
}
makeLibraryIncanter.dependsOn jar
build.dependsOn makeLibraryIncanter
}
project(':language_support/jython_runtime') {
apply plugin: "java"
jar {
archiveName = "jython-2.5.2_with_runtime.jar"
into('Lib') {
from fileTree('Lib').include('**/*.py')
}
from zipTree(project(':').file('lib/support/jython-2.5.2.jar').absoluteFile)
}
task makeLibrary(type: MakeLibraryTask) {
paper = 'jython.h5'
lib_dir = project.getRootDir()
libs = ['jython': project.jar.archivePath]
}
makeLibrary.dependsOn jar
build.dependsOn makeLibrary
}
project(':language_support/jython_plotting') {
apply plugin: "java"
jar {
archiveName = "jython-plotting.jar"
into('Lib') {
from fileTree('Lib').include('**/*.py')
}
}
task makeLibrary(type: MakeLibraryTask) {
paper = 'jython-plotting.h5'
lib_dir = project.getRootDir()
libs = ['jython-plotting': project.jar.archivePath,
'jfreechart': 'lib/support/jfreechart-1.0.13.jar',
'jcommon': 'lib/support/jcommon-1.0.16.jar']
}
makeLibrary.dependsOn jar
build.dependsOn makeLibrary
}
project(':language_support/markdown_renderer') {
apply plugin: "java"
dependencies {
compile project(':active_papers')
compile files(project(':').file('lib/support/markdownj-1.0.2b4-0.3.0.jar').absoluteFile,
project(':').file('lib/support/cobra.jar').absoluteFile,
project(':').file('lib/support/js.jar').absoluteFile)
}
task makeLibrary(type: MakeLibraryTask) {
paper = 'markdown.h5'
lib_dir = project.getRootDir()
libs = ['renderer': project.jar.archivePath,
'markdownj': 'lib/support/markdownj-1.0.2b4-0.3.0.jar',
'cobra': 'lib/support/cobra.jar',
'js': 'lib/support/js.jar']
}
makeLibrary.dependsOn jar
build.dependsOn makeLibrary
}
// A custom task class meant to shorten all the makeLibrary tasks.
class MakeLibraryTask extends DefaultTask {
@InputFile
File someFile = project.jar.archivePath // intended as replacement for "inputs.file project.jar.archivePath"; not sure what it's needed for
@OutputDirectory
File destDir = new File(project.buildDir, 'active_papers')
String paper = 'active_paper.h5'
def String lib_dir = project.getProjectDir()
def libs = []
@TaskAction
def makeLibrary() {
libFile = new File(destDir, paper)
destDir.mkdirs()
project.javaexec {
classpath = project.project(':active_paper_cltool').sourceSets.main.runtimeClasspath
main = 'active_papers.cltool'
args = ['make_library', libFile.absolutePath] +
libs.collect { k, v ->
k + '=' + (v.class == String ?
new File(lib_dir, v)
: v)
}
}
}
}