-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
119 lines (104 loc) · 3.72 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
plugins {
id 'java-library'
id 'jacoco'
id 'maven-publish'
id 'signing'
}
if (JavaVersion.current() < JavaVersion.VERSION_1_8) {
throw new GradleException("This build must be run with java 8 or higher. Current version is " + JavaVersion.current() + ".\nYou should install jdk >= 1.8 from http://www.oracle.com/technetwork/java/javase/downloads and/or check your JAVA_HOME.")
}
group 'fr.spacefox'
version '1.1.1'
repositories {
mavenCentral()
}
ext {
junitVersion = '5.8.2'
mockitoVersion = '4.2.0'
}
dependencies {
implementation group: 'org.jetbrains', name: 'annotations', version: '23.0.0'
implementation group: 'com.google.code.gson', name: 'gson', version: '2.8.9'
testImplementation group: 'org.mockito', name: 'mockito-core', version: project.ext.mockitoVersion
testImplementation group: 'org.mockito', name: 'mockito-junit-jupiter', version: project.ext.mockitoVersion
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: project.ext.junitVersion
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-params', version: project.ext.junitVersion
testRuntimeOnly group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: project.ext.junitVersion
test {
useJUnitPlatform()
testLogging {
events "passed", "skipped", "failed"
}
}
}
jacoco {
toolVersion = '0.8.7'
}
jacocoTestCoverageVerification {
afterEvaluate {
classDirectories.setFrom(files(classDirectories.files.collect {
fileTree(dir: it, exclude: [
'fr/spacefox/confusablehomoglyphs/Cli.class'
])
}))
}
violationRules {
rule {
limit {
minimum = 0.8
}
}
}
}
tasks.check.dependsOn jacocoTestReport
tasks.check.dependsOn jacocoTestCoverageVerification
java {
withJavadocJar()
withSourcesJar()
}
publishing {
publications {
mavenJava(MavenPublication) {
pom {
groupId = project.group
name = project.name
from components.java
name = 'Confusable Homoglyphs'
description = 'A tool to deal with Unicode characters that looks like each other an can be confused - a.k.a confusable homoglyphs'
url = 'https://github.com/SpaceFox/confusable-homoglyphs'
scm {
connection = 'scm:git:https://github.com/SpaceFox/confusable-homoglyphs.git'
developerConnection = 'scm:svn:https://github.com/SpaceFox/confusable-homoglyphs.git'
url = 'https://github.com/SpaceFox/confusable-homoglyphs.git'
}
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id = 'SpaceFox'
name = 'SpaceFox'
email = '[email protected]'
}
}
}
}
}
repositories {
maven {
credentials {
username = project.ossrhUsername
password = project.ossrhPassword
}
def releasesRepoUrl = 'https://oss.sonatype.org/service/local/staging/deploy/maven2/'
def snapshotsRepoUrl = 'https://oss.sonatype.org/content/repositories/snapshots/'
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
}
}
}
signing {
sign publishing.publications.mavenJava
}