forked from nulab/zxcvbn4j
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
145 lines (118 loc) · 3.83 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
143
144
145
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'net.saliman:gradle-cobertura-plugin:2.6.1' // cobertura plugin
classpath 'org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.4.0'
}
}
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'net.saliman.cobertura'
apply plugin: 'com.github.kt3k.coveralls'
apply from: 'dictionary.gradle'
group = 'com.nulab-inc'
version = '1.3.3'
archivesBaseName = 'zxcvbn'
sourceCompatibility = 1.7
targetCompatibility = 1.7
wrapper {
gradleVersion = '5.5'
}
repositories {
mavenCentral()
}
dependencies {
testCompile group: 'junit', name: 'junit', version: '4.11'
}
cobertura.coverageFormats = ['html', 'xml'] // coveralls plugin depends on xml format report
javadoc {
options.locale = 'en_US'
title = 'zxcvbn4j ' + version + ' API'
}
// Turning off doclint in JDK 8 Javadoc
// ref : http://blog.joda.org/2014/02/turning-off-doclint-in-jdk-8-javadoc.html
if (JavaVersion.current().isJava8Compatible()) {
allprojects {
tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
}
}
}
jar {
manifest {
attributes 'Implementation-Title': archivesBaseName, 'Implementation-Version': version
}
}
task sourceJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allJava
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
artifacts {
archives sourceJar, javadocJar
}
configurations {
deployerJars
}
if (project.hasProperty("signing.keyId")) {
apply plugin: 'signing'
signing {
// Skip signing snapshot archives
if (System.env.TRAVIS || version.endsWith("-SNAPSHOT")) return
sign configurations.archives
}
}
def ossrhUsername = hasProperty('ossrhUsername') ? ossrhUsername : ''
def ossrhPassword = hasProperty('ossrhPassword') ? ossrhPassword : ''
uploadArchives {
// Skip uploading production archives when travis
if (System.env.TRAVIS && !version.endsWith("-SNAPSHOT")) return
repositories {
mavenDeployer {
beforeDeployment {
MavenDeployment deployment -> if (!version.endsWith("-SNAPSHOT")) { signing.signPom(deployment) }
}
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
authentication(userName: ossrhUsername, password: ossrhPassword)
}
snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
authentication(userName: ossrhUsername, password: ossrhPassword)
}
pom.project {
name 'zxcvbn4j'
artifactId archivesBaseName
packaging 'jar'
description 'This is a java port of zxcvbn, which is a JavaScript password strength generator.'
url 'https://github.com/nulab/zxcvbn4j'
scm {
connection 'https://github.com/nulab/zxcvbn4j.git'
developerConnection 'https://github.com/nulab/zxcvbn4j.git'
url 'https://github.com/nulab/zxcvbn4j.git'
}
licenses {
license {
name 'MIT License'
url 'http://www.opensource.org/licenses/mit-license.php'
}
}
developers {
developer {
id 'vvatanabe'
name 'Yuichi Watanabe'
email '[email protected]'
}
}
}
}
}
}
test {
maxParallelForks = Runtime.runtime.availableProcessors().intdiv(2) ?: 1
forkEvery = 4
testLogging.showStandardStreams = true
}