-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuild.gradle
127 lines (109 loc) · 3.58 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
plugins {
id "java"
// for coverage
id "jacoco"
// for coveralls.io if it starts to work - until then codecov
// id "com.github.kt3k.coveralls" version "2.6.3"
}
task wrapper(type: Wrapper) {
gradleVersion = '3.2.1'
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
repositories {
mavenCentral()
}
dependencies {
compile("org.hibernate:hibernate-core:5.1.0.Final")
testCompile("junit:junit:4.12")
testCompile("org.powermock:powermock-mockito-release-full:1.6.4")
testCompile("org.apache.logging.log4j:log4j-core:2.8.1")
}
// coverage
jacocoTestReport {
reports {
xml.enabled = true // coveralls plugin depends on xml format report
html.enabled = true
}
}
// for the sonatype release
apply plugin: 'maven'
apply plugin: 'signing'
version = '1.0-SNAPSHOT'
String group = 'com.zsoltfabok'
String pomName = 'sqlite-dialect'
String pomRepositoryUrl = 'https://github.com/ZsoltFabok/sqlite-dialect'
String pomScmUrl = 'scm:git:git@github.com:ZsoltFabok/sqlite-dialect.git'
String pomDescription = 'SQLite dialect for hibernate 5'
String pomLicenseName = 'The BSD 3-Clause License'
String pomLicenseUrl = 'https://opensource.org/licenses/BSD-3-Clause'
String pomDeveloperId = 'fabokzs'
String pomDeveloperEmail = 'info@zsoltfabok.com'
String pomDeveloperName = 'Zsolt Fabok'
task javadocJar(type: Jar) {
classifier = 'javadoc'
from javadoc
}
task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allSource
}
artifacts {
archives jar, javadocJar, sourcesJar
}
signing {
sign configurations.archives
}
// Because if one does not want to release and therefore does not have gradle.properties
// the whole build will fail because the uploadArchives is being evaluated and sonatypeUsername
// and sonatypePassword is not going to be present
// using '<<' in uploadArchives could be an option, but it is deprecated
def getSonatypeProperty(String name) {
name = 'sonatype' + name.capitalize()
if (project.hasProperty(name)) {
return project.getProperties()[name]
} else {
return ''
}
}
uploadArchives {
repositories {
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
authentication(userName: getSonatypeProperty('username'), password: getSonatypeProperty('password'))
}
snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
authentication(userName: getSonatypeProperty('username'), password: getSonatypeProperty('password'))
}
pom.project {
name pomName
description pomDescription
url pomRepositoryUrl
version version
groupId group
artifactId pomName
packaging 'jar'
scm {
connection pomScmUrl
developerConnection pomScmUrl
url pomScmUrl
}
licenses {
license {
name pomLicenseName
url pomLicenseUrl
distribution 'repo'
}
}
developers {
developer {
id pomDeveloperId
name pomDeveloperName
email pomDeveloperEmail
}
}
}
}
}
}