-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
112 lines (99 loc) · 3.33 KB
/
build.gradle
File metadata and controls
112 lines (99 loc) · 3.33 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
plugins {
id 'org.jetbrains.kotlin.plugin.serialization' version '1.7.20'
id 'org.jetbrains.kotlin.jvm' version '1.7.20'
id 'org.jetbrains.kotlinx.kover' version '0.6.1'
id "com.jfrog.artifactory" version "4.28.4"
id 'maven-publish'
}
group = 'ru.talenttech.xqa'
version = '0.0.0'
def libraryVersion = '0.0.1'
repositories {
mavenCentral()
}
configurations {
ktlint
}
dependencies {
implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8'
implementation 'org.jetbrains.kotlin:kotlin-reflect:1.7.22'
implementation group: 'com.squareup.okhttp3', name: 'okhttp', version: '4.10.0'
implementation 'io.rest-assured:xml-path:5.3.0'
implementation 'org.assertj:assertj-core:3.18.1'
implementation group: 'com.jayway.jsonpath', name: 'json-path', version: '2.7.0'
ktlint 'com.pinterest:ktlint:0.47.0'
testImplementation 'org.jetbrains.kotlin:kotlin-test'
testImplementation 'org.jetbrains.kotlin:kotlin-test-junit'
implementation 'org.jetbrains.kotlinx:kotlinx-serialization-json:1.4.1'
implementation 'io.github.microutils:kotlin-logging-jvm:3.0.4'
implementation 'org.slf4j:slf4j-simple:2.0.5'
api 'org.json:json:20220924'
api 'com.google.protobuf:protobuf-java:3.21.9'
api('com.google.protobuf:protobuf-java-util:3.21.9') {
exclude group: 'com.google.guava', module: 'guava'
}
}
java {
withJavadocJar()
withSourcesJar()
}
compileKotlin {
kotlinOptions.jvmTarget = '1.8'
}
compileTestKotlin {
kotlinOptions.jvmTarget = '1.8'
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
}
}
}
artifactory {
contextUrl = "${artifactory_context_url}"
publish {
repository {
repoKey = "${artifactory_repo_key}"
username = "${artifactory_user}"
password = "${artifactory_password}"
}
defaults {
publications('mavenJava')
}
}
}
task ktlint(type: JavaExec, group: "verification") {
description = "Check Kotlin code style."
mainClass.set("com.pinterest.ktlint.Main")
classpath = configurations.ktlint
args "src/**/*.kt"
}
check.dependsOn ktlint
task bumpVersion {
doLast {
def parsedVersion = version
String[] version = Arrays.asList(parsedVersion.split("\\."))
String releaseType = project.findProperty("releaseType")
def majorVersion = version[0]
def minorVersion = version[1]
def patchVersion = version[2]
String resultVersion = null
switch (releaseType) {
case "major":
resultVersion = "${Integer.valueOf(majorVersion) + 1}.0.0"
break
case "minor":
resultVersion = "${majorVersion}.${Integer.valueOf(minorVersion) + 1}.0"
break
case "patch":
resultVersion = "${majorVersion}.${minorVersion}.${Integer.valueOf(patchVersion) + 1}"
break
}
String s = buildFile.getText().replaceFirst("version = '$parsedVersion'", "version = '$resultVersion'")
buildFile.write(s) //replace the build file's text
def properties = new Properties()
properties.setProperty("library_version", resultVersion)
file("src/main/resources/info.properties").withOutputStream { properties.store(it, null) }
}
}