-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathbuild.gradle
96 lines (87 loc) · 2.32 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
plugins {
id 'java'
id 'java-library'
id 'jacoco'
id 'maven-publish'
id 'signing'
}
group = 'com.amdelamar'
version = '2.2.0'
description = 'Password hashing utility in Java. Supports PBKDF2 hmac SHA1/SHA256/SHA512, BCRYPT, and SCRYPT. It salts automatically and has a pepper option.'
sourceCompatibility = 1.8
targetCompatibility = 1.8
compileJava.options.encoding = 'UTF-8'
ext.isReleaseVersion = !version.endsWith("SNAPSHOT")
repositories {
mavenCentral()
}
dependencies {
compile 'commons-codec:commons-codec:1.8'
testCompile 'junit:junit:4.12'
}
test {
testLogging {
showStandardStreams = true
events "passed", "skipped", "failed", "standardOut", "standardError"
}
}
java {
withJavadocJar()
withSourcesJar()
}
jacocoTestReport {
reports {
xml.enabled true
html.enabled false
}
}
publishing {
repositories {
maven {
def releaseRepo = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
def snapshotRepo = "https://oss.sonatype.org/content/repositories/snapshots/"
url = isReleaseVersion ? releaseRepo : snapshotRepo
credentials {
username = project.hasProperty('sonatypeUsername') ? sonatypeUsername : System.getenv('SONATYPE_USERNAME')
password = project.hasProperty('sonatypePassword') ? sonatypePassword : System.getenv('SONATYPE_PASSWORD')
}
}
}
publications {
mavenJava(MavenPublication) {
pom {
name = 'jhash'
artifactId = 'jhash'
groupId = this.group
version = this.version
description = this.description
url = 'https://amdelamar.com/jhash/'
from components.java
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id = "amdelamar"
name = "Austin Delamar"
email = "[email protected]"
}
}
scm {
connection = 'scm:git:[email protected]:amdelamar/jhash.git'
developerConnection = 'scm:git:[email protected]:amdelamar/jhash.git'
url = 'https://github.com/amdelamar/jhash/'
}
}
}
}
}
signing {
sign publishing.publications.mavenJava
}
tasks.withType(Sign) {
onlyIf { isReleaseVersion }
}