-
Notifications
You must be signed in to change notification settings - Fork 67
/
build.gradle
136 lines (119 loc) · 3.69 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
/*
Jason Gradle build file
*/
apply plugin: 'java-library'
defaultTasks 'config'
clean {
delete 'bin'
delete 'doc/api'
delete 'doc/faq.html'
delete 'doc/index.html'
delete 'doc/readme.html'
delete 'readme.html'
delete 'doc/release-notes.html'
delete fileTree('doc/tutorials') { include '**/*.html' }
delete fileTree('doc/tech') { include '**/*.html' }
delete fileTree('doc/tutorials') { include '**/bin/**/*' }
delete fileTree('.') { include '**/*~' }
delete fileTree('.') { include '**/.stop___MAS' }
delete fileTree('.') { include '**/APDescription.txt' }
delete fileTree('.') { include '**/MTPs-Main-Container.txt' }
delete fileTree('examples') { include '**/bin/**' }
delete fileTree('examples') { include '**/*.log' }
delete fileTree('demos') { include '**/bin/**' }
delete fileTree('demos') { include '**/*.log' }
delete 'demos/persistent-belief-base/a.bb'
def emptyDirs = []
fileTree (dir: 'examples').visit {
def File f = it.file
if (f.isDirectory() ) {
def children = project.fileTree(f).filter { it.isFile() }.files
if (children.size() == 0) {
emptyDirs << f
}
}
}
fileTree (dir: 'demos').visit {
def File f = it.file
if (f.isDirectory() ) {
def children = project.fileTree(f).filter { it.isFile() }.files
if (children.size() == 0) {
emptyDirs << f
}
}
}
emptyDirs.reverseEach { it.delete() }
}
task createCLIBin (dependsOn: [':jason-cli:createBin']) {
group "build"
doLast {
copy {
from 'jason-cli/build/bin/jason'
into 'bin'
}
}
}
task config (dependsOn: ['createCLIBin']) {
doLast {
println '------'
println ''
println 'you can set the Jason home directory with the following command:'
println ' export JASON_HOME='+project.projectDir.absolutePath
println ''
println 'and also change your PATH with:'
println ' export PATH=$JASON_HOME/bin:$PATH'
println ''
println '-----'
}
}
// Builds the distribution, documentation and a new release
task doc(dependsOn: [ ':jason-interpreter:jjdoc', ':jason-interpreter:javadoc', 'renderAsciiDocs']) {
}
task renderAsciiDocs(type: Exec) {
commandLine 'find', '.', '-name', '*.adoc', '-exec', 'doc/asciidoc-docker', '{}', ';'
}
// Builds the distribution, documentation and a new release
task release(dependsOn: [ 'doc', 'zipRel' ]) {
group = "publishing"
}
// copy files used to build a release
task copyRel (dependsOn: ['jar', 'createCLIBin']) {
doLast {
copy {
from '.'
into "build/jason-${jasonVersion}"
include '*.html'
include 'LICENSE'
include 'doc/**'
}
// delete fileTree('build/jason-'+project.version+'/doc') { include '**/*.adoc', '**/Makefile' }
copy {
from 'bin'
into "build/jason-${jasonVersion}/bin"
}
// copy {
// duplicatesStrategy = 'include'
// from 'build/libs'
// from configurations.runtimeClasspath
// into 'build/jason-'+project.version+'/libs'
// include '**/*.jar'
// }
copy {
from 'examples'
into "build/jason-${jasonVersion}/examples"
}
copy {
from 'demos'
into "build/jason-${jasonVersion}/demos"
}
// copy {
// from 'src'
// into 'build/jason-'+project.version+'/src'
// }
}
}
// // creates a zip file for a release
task zipRel(type: Zip, dependsOn: copyRel) {
from "build/jason-${jasonVersion}"
archiveBaseName = "jason-bin-${jasonVersion}"
}