-
Notifications
You must be signed in to change notification settings - Fork 34
/
build.gradle
45 lines (41 loc) · 1.37 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
plugins {
id 'java-library'
}
description = 'Mines Java Toolkit Demos'
// Demos do not (yet) have any unit tests.
test.enabled = false
compileTestJava.enabled = false
processTestResources.enabled = false
testClasses.enabled = false
// Demos require the Mines JTK core and some require Jython.
dependencies {
implementation project(':core')
implementation "org.python:jython-standalone:$version_jython"
}
// A task to run a demo Java main class or Jython script.
task run(type: JavaExec) {
description = 'Runs a demo Java main or Jython script. For example,\n' +
' gradle run -P demo=mosaic.PlotFrameDemo\n' +
' gradle run -P demo=mosaic/PlotFrameDemo.py'
if (project.hasProperty('demo')) {
enableAssertions = true
classpath = sourceSets.main.runtimeClasspath
//println "demo = "+demo // classpath may be useful for debugging
//println "classpath = "; classpath.each { println it }
if (demo.endsWith('.py')) {
def pref = 'jtkdemo/'
if (!demo.contains(pref))
demo = pref + demo
demo = 'src/main/jython/' + demo
main = 'org.python.util.jython'
jvmArgs '-Dpython.cachedir.skip=false',
"-Dpython.cachedir=${buildDir}/jython-cache/"
args demo
} else {
def pref = 'jtkdemo.'
if (!demo.contains(pref))
demo = pref + demo
main = demo
}
}
}