-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
113 lines (96 loc) · 2.96 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
/*
JaCaMo Command Line Interpreter build file
*/
defaultTasks 'createBin'
apply plugin: 'java-library'
java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}
}
sourceSets {
main {
java {
srcDir 'src/main/java'
}
resources {
srcDir 'src/resources'
}
}
}
repositories {
mavenCentral()
maven { url "https://raw.githubusercontent.com/jacamo-lang/mvn-repo/master" }
maven { url 'https://repo.gradle.org/gradle/libs-releases' }
}
dependencies {
api 'info.picocli:picocli-shell-jline3:4.7.0'
api 'org.jline:jline:3.22.0'
api 'org.fusesource.jansi:jansi:2.4.0'
api 'io.github.jason-lang:jason-cli:3.3.0'
api 'org.gradle:gradle-tooling-api:8.10'
//testImplementation group: 'junit', name: 'junit', version: '4.12'
implementation 'org.slf4j:slf4j-nop:1.7.21' // to avoid warning msgs of SLF4J
}
jar {
archiveBaseName = "jacamo-cli-${jacamoVersion}"
manifest {
attributes 'Main-Class': 'jacamo.cli.JaCaMoCLI',
'Specification-Title': 'JaCaMo CLI',
'Specification-Version': "${jacamoVersion}",
'Implementation-Version': new Date().toString()
}
}
//// copy dep jars into build directory (maybe useful for running without the management of gradle)
//task copyJarsToBuild (dependsOn: jar) {
// inputs.files configurations.runtimeClasspath.files
// //inputs.dir 'src/main/resources/scripts'
// outputs.dir 'build/libs'
// //outputs.dir 'build/scripts'
// doLast {
// copy {
// from configurations.runtimeClasspath
// into 'build/libs'
// }
// }
//}
task run (type: JavaExec, dependsOn: 'build') {
mainClass = 'jacamo.cli.JaCaMoCLI'
standardInput = System.in
classpath sourceSets.main.runtimeClasspath
}
task uberJar(type: Jar, dependsOn: ['classes']) {
group = "build"
description 'creates a single runnable jar file with all dependencies'
duplicatesStrategy 'exclude'
manifest {
attributes 'Main-Class': 'jacamo.cli.JaCaMoCLI',
'Specification-Title': 'JaCaMo CLI',
'Specification-Version': "${jacamoVersion}",
'Implementation-Version': new Date().toString()
}
archiveBaseName = "jacamo-cli-all-${jacamoVersion}"
destinationDirectory = file('build/bin')
from { configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } }
with jar
}
task createBin (dependsOn: ['uberJar']) {
group = "build"
def wdir = 'build/bin'
doFirst {
exec {
commandLine '../../src/main/resources/scripts/create-bin.sh', 'jacamo-cli-all-' + "${jacamoVersion}" + '.jar'
workingDir wdir
}
}
doLast {
copy {
from 'src/main/resources/scripts/jacamo.sh'
into wdir
}
copy {
from 'build/bin/jacamo'
into 'bin'
}
}
}