-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
115 lines (96 loc) · 3.11 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
buildscript {
ext {
kotlin_group = 'org.jetbrains.kotlin'
kotlin_version = '1.2.71'
junit_group = 'org.junit.jupiter'
junit_version = '5.3.1'
jackson_core_group = "com.fasterxml.jackson.core"
jackson_core_version = "2.9.8"
jackson_datatype_group = "com.fasterxml.jackson.datatype"
jackson_datatype_version = "2.9.8"
onixlabs_group = "io.onixlabs"
onixlabs_kotlin_core_version = "2.0.0"
}
repositories {
mavenLocal()
mavenCentral()
jcenter()
}
dependencies {
classpath "$kotlin_group:kotlin-gradle-plugin:$kotlin_version"
}
}
group 'io.onixlabs'
version '2.0.0'
allprojects {
repositories {
mavenLocal()
mavenCentral()
jcenter()
maven { url "https://jitpack.io" }
}
configurations {
all {
exclude module: 'slf4j-log4j12'
exclude module: 'log4j-slf4j-impl'
}
}
apply plugin: 'kotlin'
apply plugin: 'maven-publish'
dependencies {
implementation "$kotlin_group:kotlin-stdlib-jdk8:$kotlin_version"
implementation "$kotlin_group:kotlin-reflect:$kotlin_version"
implementation "$onixlabs_group:onixlabs-kotlin-core:$onixlabs_kotlin_core_version"
testRuntimeOnly "$junit_group:junit-jupiter-engine:$junit_version"
testImplementation "$junit_group:junit-jupiter-api:$junit_version"
testImplementation "$jackson_core_group:jackson-databind:$jackson_core_version"
testImplementation "$jackson_datatype_group:jackson-datatype-jsr310:$jackson_datatype_version"
}
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
kotlinOptions {
languageVersion = "1.2"
apiVersion = "1.2"
jvmTarget = "1.8"
javaParameters = true
}
}
jar {
exclude '**/log4j2*.xml'
}
test {
maxHeapSize = "4096m"
useJUnitPlatform()
}
}
publishing {
repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/onix-labs/onixlabs-kotlin-validation")
credentials {
username = project.findProperty("gpr.user") ?: System.getenv("GITHUB_USERNAME")
password = project.findProperty("gpr.key") ?: System.getenv("GITHUB_TOKEN")
}
}
}
publications {
gpr(MavenPublication) {
groupId = project.group
version = project.version
artifactId = 'onixlabs-kotlin-validation'
from components.java
}
}
}
task cleanLocal(type: Exec) {
def shellExec = System.getProperty('os.name').toLowerCase(Locale.ROOT).contains('windows') ? 'cmd' : 'sh'
commandLine shellExec, './clean-cache.sh'
}
task releaseLocal(type: GradleBuild) {
startParameter = gradle.startParameter.newInstance()
tasks = ['clean', 'build', 'publishToMavenLocal']
}
task releasePublic(type: GradleBuild) {
startParameter = gradle.startParameter.newInstance()
tasks = ['clean', 'build', 'publishToMavenLocal', 'publish']
}