-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.gradle
126 lines (113 loc) · 3.73 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
plugins {
id 'groovy'
id 'maven-publish'
id 'signing'
}
group = "com.kazurayam"
version = "1.6.2"
def defaultEncoding = 'UTF-8'
tasks.withType(AbstractCompile).each {it.options.encoding = defaultEncoding }
tasks.withType(GroovyCompile).each {it.groovyOptions.encoding = defaultEncoding}
ext {
isReleaseVersion = ! version.endsWith("SNAPSHOT")
groovyVersion = '3.0.17'
}
configurations {
generateDocs
}
repositories {
mavenCentral()
mavenLocal()
}
dependencies {
implementation fileTree(dir: "Drivers", include:['*.jar'])
implementation "org.codehaus.groovy:groovy-all:${groovyVersion}"
implementation fileTree(dir: "/Applications/Katalon Studio.app/Contents/Eclipse/plugins", include: ['*.jar'])
implementation fileTree(dir: "/Applications/Katalon Studio.app/Contents/Eclipse/configuration/resources/lib", include: ['*.jar'])
generateDocs "org.codehaus.groovy:groovy-all:${groovyVersion}"
}
sourceSets {
main {
groovy {
srcDirs = ['Keywords', 'Libs']
excludes = ['CustomKeywords.groovy', "Temp*.groovy"]
}
}
test {
groovy {
srcDirs = ['Include/scripts/groovy']
}
}
}
task groovydoc(type: Groovydoc, overwrite:true) {
group = 'com.kazurayam'
source = sourceSets.main.groovy
classpath = configurations.generateDocs
groovyClasspath = configurations.generateDocs
include 'com/kazurayam/ks/*'
exclude '**/*Test.groovy'
}
task publishGroovydoc(type: Copy) {
from 'build/docs/groovydoc'
into 'docs/api'
}
groovydoc.finalizedBy publishGroovydoc
task groovydocJar(type: Jar) {
archiveClassifier = 'javadoc'
from groovydoc
}
task sourcesJar(type: Jar) {
archiveClassifier = 'sources'
from sourceSets.main.allSource
}
publishing {
publications {
junit4ks(MavenPublication) {
artifact sourcesJar
artifact groovydocJar
pom {
groupId = project.group
name = project.rootProject.name
description = 'A Katalon Studio plugin that enables running JUnit4 tests for Custom Keyword classes'
url = 'https://kazurayam.github.io/junit4ks/'
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 = '[email protected]'
}
}
scm {
connection = "scm:git:https://github.com/kazurayam/${project.rootProject.name}.git"
developerConnection = "scm:git:[email protected]: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.junit4ks
}
// I do not want to sign the SNAPSHOT
tasks.withType(Sign) {
onlyIf { isReleaseVersion }
}