-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
100 lines (84 loc) · 2.43 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
apply plugin: 'java'
version = '1.0'
libsDirName = 'lib'
sourceCompatibility = 1.8
targetCompatibility = 1.8
task "create-dirs" << {
sourceSets*.java.srcDirs*.each { it.mkdirs() }
sourceSets*.resources.srcDirs*.each { it.mkdirs() }
}
import org.ajoberstar.gradle.git.tasks.*
task utils(type: GitClone) {
def destination = file("repos/utils")
uri = "[email protected]:YamStranger/utils.git"
destinationPath = destination
bare = false
enabled = !destination.exists() //to clone only once
}
sourceSets {
integTest {
java.srcDir file('src/integTest/java')
resources.srcDir file('src/integTest/resources')
compileClasspath += sourceSets.main.runtimeClasspath
runtimeClasspath = output + compileClasspath
}
}
task intTest(type: Test) {
testClassesDir = sourceSets.integTest.output.classesDir
classpath += sourceSets.integTest.runtimeClasspath
}
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'org.ajoberstar:gradle-git:0.2.3'
}
}
repositories {
mavenCentral()
}
dependencies {
compile('org.seleniumhq.selenium:selenium-java:2.45.0')
compile('org.testng:testng:6.8.21:sources')
compile('org.testng:testng:6.8.21')
compile('org.mockito:mockito-core:2.0.5-beta')
compile('org.mockito:mockito-core:2.0.5-beta:sources')
compile('ch.qos.logback:logback-classic:1.1.3:sources')
compile('ch.qos.logback:logback-classic:1.1.3')
compile('ch.qos.logback:logback-classic:1.1.3')
compile project(':repos/utils')
}
test {
useTestNG {
excludeGroups 'integrationTests'
//includeGroups 'unitTests'
}
}
task copyDeps(type: Copy) {
from configurations.runtime
into project.projectDir.path+'/lib'
}
compileJava {
dependsOn ('create-dirs','utils','copyDeps')
}
jar {
manifest {
attributes 'Implementation-Title': 'title',
'Implementation-Version': version,
'Main-Class': 'com.Main'
//attributes(
// 'Class-Path': configurations.compile.collect { it.getName() }.join(' '))
}
}
//create a single Jar with all dependencies
task buildAllInOne(type: Jar) {
manifest {
attributes 'Implementation-Title': 'title',
'Implementation-Version': version,
'Main-Class': 'com.Main'
}
baseName = project.name + '-all'
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
with jar
}