-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
114 lines (96 loc) · 3.02 KB
/
build.gradle
File metadata and controls
114 lines (96 loc) · 3.02 KB
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
plugins {
id 'java-library'
id 'maven-publish'
id 'signing'
}
group 'com.kazurayam'
version '0.2.2'
ext.isReleaseVersion = ! version.endsWith("SNAPSHOT")
repositories {
mavenCentral()
}
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
def defaultEncoding = 'UTF-8'
tasks.withType(AbstractCompile).each { it.options.encoding = defaultEncoding }
tasks.withType(GroovyCompile).each {it.groovyOptions.encoding = defaultEncoding }
ext {}
dependencies {
implementation libs.ashot
implementation libs.seleniumjava
implementation libs.slf4j.api
testImplementation libs.webdrivermanager
testImplementation libs.gson
testImplementation libs.junit.jupiter.api
testImplementation libs.slf4j.simple
testRuntimeOnly libs.junit.jupiter.engine
}
java {
withJavadocJar()
withSourcesJar()
}
test {
useJUnitPlatform()
}
artifacts {
archives javadocJar, sourcesJar
}
javadoc {
options.showFromProtected()
failOnError = false
options.locale = "en_US"
}
publishing {
publications {
mavenJava(MavenPublication) {
pom {
groupId = project.group
name = project.rootProject.name
description = 'A wrapper for AShot --- a screenshot utility for WebDriver'
url = 'https://kazurayam.github.io/ashotwrapper/'
from components.java
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'https://www.apache.org.licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id = 'kazurayam'
name = 'URAYAMA,kazuaki'
email = 'kazuaki.urayama@gmail.com'
}
}
scm {
connection = "scm:git:https://github.com/kazurayam/${project.rootProject.name}.git"
developerConnection = "scm:git:git@github.com:kazurayam/${project.rootProject.name}.git"
url = "https://github.com/kazurayam/${project.rootProject.name}"
}
}
}
}
repositories {
maven {
def releaseRepo = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
def snapshotRepo = "https://s01.oss.sonatype.org/content/repositories/snapshots/"
url = isReleaseVersion ? releaseRepo: snapshotRepo
credentials {
username = project.hasProperty('ossrhUsername') ? ossrhUsername : "Unknown user"
password = project.hasProperty('ossrhPassword') ? ossrhPassword : "Unknown password"
}
}
}
}
signing {
sign publishing.publications.mavenJava
}
// I do not want to sign the SNAPSHOT
tasks.withType(Sign) {
onlyIf { isReleaseVersion }
}
task copyJavadocToDocsDir(type: Copy) {
from 'build/docs/javadoc'
into 'docs/api'
}
javadoc.finalizedBy copyJavadocToDocsDir