-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
60 lines (47 loc) · 1.76 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
/*
* This build file was generated by the Gradle 'init' task.
*
* This generated file contains a sample Groovy project to get you started.
* For more details take a look at the Groovy Quickstart chapter in the Gradle
* user guide available at https://docs.gradle.org/4.1/userguide/tutorial_groovy_projects.html
*/
// Apply the groovy plugin to add support for Groovy
apply plugin: 'groovy'
// Apply the application plugin to add support for building an application
apply plugin: 'application'
// 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()
}
dependencies {
// Use the latest Groovy version for building this library
compile 'org.codehaus.groovy:groovy-all:2.4.11'
// Use the awesome Spock testing and specification framework
testCompile 'org.spockframework:spock-core:1.0-groovy-2.4'
}
// Define the main class for the application
mainClassName = 'App'
// Define the output dir for groovy class-files, for later reference
sourceSets.main.groovy.outputDir = new File(buildDir, "classes/groovy/main")
println sourceSets.main.groovy.dump()
task uberjar(type: Jar) {
// compile the groovy-files
dependsOn build
// Add the compiled groovy-class files
from files(sourceSets.main.groovy.outputDir)
// Add all files the application uses on runtime - UBERJAR MAGIC
/*
We need to make a "fat" jar,
either it's this way, or
using the gradle "SHADOW"-plugin
*/
from configurations.runtime.asFileTree.files.collect { zipTree(it) }
manifest {
attributes(
// Entry point in jar archive
'Main-Class': 'App',
)
}
}