-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.gradle
71 lines (57 loc) · 1.85 KB
/
test.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
//Set a default task, so if you don't provide any, these will be executed.
defaultTasks 'task1', 'task2'
//Import a bunch of Java related tasks to help you
//By default production code should be in src/main/java
//Test code should be in src/test/java
//Resources to put in the jar should be in src/main/resources
//This gives you a lot of tasks predefined for java, but the most important is build
//build will compile the code, run the tests, and make the jar file.
//also used alot is clean, which will delete all the files made by build
//also available is assemble which will compile the code but not run the test
//also available is check which will compile and run the tests
apply plugin: 'java'
apply plugin: 'findbugs'
apply plugin: 'checkstyle'
apply plugin: 'pmd'
apply plugin: 'application'
//Define a simple task ourselves
task hello << {
println 'Hello World'
}
//Define a simple task that depends on another task
task intro(dependsOn: hello) << {
println 'I am gradle'
}
task runp1(dependsOn:build)<< {
mainClassName = "HelloWorld"
}
//Define a task
task task1 << {
String aString = "SomE DiFFerEnt CAse ChARs"
println "Original String: " + aString
println "All Upper: " + aString.toUpperCase()
}
//Define another task
task task2 << {
println 'Task 2'
}
//set up some variables
sourceCompatibility = 1.8
version = '1.0'
mainClassName='HelloWorld'
//Define the contents of the jar file
jar {
manifest {
attributes 'Implementation-Title' : 'Gradle Quickstart' ,
'Implementation-Version' : version,
'Main-Class' : 'HelloWorld'
}
}
dependencies {
compile group: 'org.hibernate', name: 'hibernate-core', version: '3.6.7.Final'
testCompile group: 'junit', name: 'junit', version: '4.+'
}
//setup a location for repositories of any libraries that need to be downloaded
repositories {
mavenCentral()
}