forked from sky-uk/cqlmigrate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
142 lines (121 loc) · 3.37 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
136
137
138
139
140
141
142
plugins {
id 'java'
id 'idea'
id 'maven'
id 'maven-publish'
id 'com.jfrog.bintray' version '1.6'
id 'pl.allegro.tech.build.axion-release' version '1.3.4'
id 'com.github.johnrengelman.shadow' version '1.2.3'
}
scmVersion {
tag {
prefix = ''
}
}
group = 'uk.sky'
version = scmVersion.version
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
if (!project.hasProperty('openSourceRepoUser')) {
ext.openSourceRepoUser = 'dummy'
}
if (!project.hasProperty('openSourceRepoPass')) {
ext.openSourceRepoPass = 'dummy'
}
clean.doFirst {
// Remove temporary directory for embedded Cassandra
delete "${projectDir}/target"
}
bintray {
user = project.property('openSourceRepoUser')
key = project.property('openSourceRepoPass')
publications = ['artifacts']
pkg {
userOrg = 'sky-uk'
repo = 'oss-maven'
name = project.name
licenses = ['BSD 3-Clause']
vcsUrl = 'https://github.com/sky-uk/cqlmigrate.git'
version {
name = scmVersion.version
released = new Date()
vcsTag = scmVersion.version
}
}
}
publishing {
publications {
artifacts(MavenPublication) {
from components.java
artifact sourcesJar
artifact javadocJar
}
}
}
repositories {
mavenCentral()
}
task wrapper(type: Wrapper) {
gradleVersion = '2.11'
}
configurations {
testCompileAndFunctional
functional.extendsFrom testCompileAndFunctional
testCompile.extendsFrom testCompileAndFunctional
}
dependencies {
compile 'com.datastax.cassandra:cassandra-driver-core:3.1.0'
compile 'org.slf4j:slf4j-api:1.7.12'
compile 'com.google.code.findbugs:jsr305:3.0.0'
testCompile 'org.apache.logging.log4j:log4j-core:2.2'
testCompile 'junit:junit:4.12'
testCompile 'org.assertj:assertj-core:2.0.0'
testCompile 'org.hamcrest:hamcrest-all:1.3'
testCompile 'org.mockito:mockito-core:1.10.19'
testCompile 'org.powermock:powermock-api-mockito:1.6.5'
testCompile 'org.powermock:powermock-module-junit4:1.6.5'
testCompile 'org.scassandra:java-client:1.0.3'
testCompileAndFunctional 'org.cassandraunit:cassandra-unit:3.0.0.1'
functional 'org.slf4j:slf4j-simple:1.7.12'
}
idea {
module {
downloadSources = true
}
}
task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allJava
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
task testJar (type: Jar) {
classifier = 'tests'
from (sourceSets.main.output, sourceSets.test.output)
from {
(configurations.runtime + configurations.functional).collect {
it.isDirectory() ? it : zipTree(it)
}
}
manifest {
attributes 'Main-Class': 'uk.sky.cqlmigrate.example.CmdLineEntryPoint'
}
}
jar {
manifest {
attributes "Main-Class": "uk.sky.cqlmigrate.CqlMigratorImpl"
}
}
// Functional test is to run the migrateSchema on a jar containing embedded CQL files and have it return successfully.
task functional (dependsOn: ['testJar']) << {
exec {
executable = 'java'
args = ['-jar', '-Dcassandra.storagedir=/tmp/cassandra', testJar.archivePath, 'migrateSchema']
}
}
check.dependsOn(functional, javadoc)
test {
jvmArgs '-Dcassandra.storagedir=/tmp/cassandra'
}