-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
116 lines (100 loc) · 2.98 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
plugins {
id "com.tngtech.jgiven.gradle-plugin" version "${jgivenVersion}" apply false
}
apply plugin: "com.tngtech.jgiven.gradle-plugin"
apply plugin: 'java'
apply plugin: 'scala'
apply plugin: 'maven'
apply plugin: 'maven-publish'
apply plugin: 'signing'
group 'com.github.poad'
version '0.0.2'
archivesBaseName = "tuple4j"
description = "Tuple for Java"
sourceCompatibility = 1.8
targetCompatibility = 1.8
//set build variables based on build type (release, continuous integration, development)
def isDevBuild
def isCiBuild
def isReleaseBuild
def sonatypeRepositoryUrl
if (hasProperty("release")) {
isReleaseBuild = true
sonatypeRepositoryUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
} else if (hasProperty("ci")) {
isCiBuild = true
version += "-SNAPSHOT"
sonatypeRepositoryUrl = "https://oss.sonatype.org/content/repositories/snapshots/"
} else {
isDevBuild = true
version += "-SNAPSHOT"
}
repositories {
mavenCentral()
}
dependencies {
testCompile "org.junit.vintage:junit-vintage-engine:${junitVersion}"
testCompile "com.tngtech.jgiven:jgiven-junit:${jgivenVersion}"
testCompile "org.assertj:assertj-core:${assertjVersion}"
testCompile "org.scala-lang:scala-library:${scalaVersion}"
}
compileJava {
gradle.projectsEvaluated {
if (project.hasProperty('warn')) {
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
}
}
options.encoding = 'UTF-8'
}
task javadocJar(type: Jar) {
classifier = 'javadoc'
from "${buildDir}/javadoc"
}
task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allSource
}
test.finalizedBy jgivenTestReport
artifacts {
archives javadocJar, sourcesJar
}
signing {
required { isReleaseBuild }
sign configurations.archives
}
publishing {
if (isDevBuild) {
repositories {
mavenLocal()
}
} else {
publications {
mavenJava(MavenPublication) {
pom {
name 'tuple4j'
packaging 'jar'
description = 'Tuple for Java'
url 'https://github.com/poad/tuple4j'
scm {
url "scm:git@github.com:poad/tuple4j.git"
connection "scm:git@github.com:poad/tuple4j.git"
developerConnection "scm:git@github.com:poad/tuple4j.git"
}
licenses {
license {
name 'Apache License, Version 2.0'
url 'https://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id 'poad'
name 'Kenji Saito'
email 'poad1010@gmail.com'
}
}
}
}
}
}
}