-
Notifications
You must be signed in to change notification settings - Fork 7
/
build.gradle
154 lines (113 loc) · 4.33 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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.vanniktech:gradle-maven-publish-plugin:0.20.0'
}
}
plugins {
id 'net.researchgate.release' version '2.8.1'
id 'signing'
id 'java-library'
id 'groovy'
}
apply plugin: 'com.vanniktech.maven.publish'
def variant = findProperty('variant') ?: '4'
ext.BASE_VERSION = findProperty("version")
version = variant == '4' ? "${findProperty('version')}-groovy4" : "${findProperty('version')}-groovy3"
//set the groovy version on the release version
VERSION_NAME = version
println("Building for Variant for Groovy=$variant [$version]")
group = 'io.github.kayr'
archivesBaseName = 'fuzzy-csv'
description = 'A groovy/java tabular Data (from CSV,SQL,JSON) processing library ' +
'that supports fuzzy column matching,tranformations/merging/querying etc'
sourceCompatibility = 1.8
targetCompatibility = 1.8
release {
failOnUnversionedFiles = false
}
repositories {
// First check local cache before accessing central repository
// mavenRepo name:'Local', urls: "file://" + System.properties['user.home'] + "/.m2/repository"
mavenCentral()
}
dependencies {
if (variant == '4') {
println "setting groovy 4 dependencies"
api 'org.apache.groovy:groovy:4.0.13'
api 'org.apache.groovy:groovy-sql:4.0.13'
api 'org.apache.groovy:groovy-json:4.0.13'
testImplementation 'org.apache.groovy:groovy-test:4.0.13'
testImplementation 'org.apache.groovy:groovy-datetime:4.0.13'
testImplementation 'org.apache.groovy:groovy-dateutil:4.0.13'
} else {
println "setting groovy 2 dependencies"
api 'org.codehaus.groovy:groovy:2.5.22'
api 'org.codehaus.groovy:groovy-sql:2.5.22'
api 'org.codehaus.groovy:groovy-json:2.5.22'
testImplementation 'org.codehaus.groovy:groovy-test:2.5.22'
testImplementation 'org.codehaus.groovy:groovy-datetime:2.5.22'
testImplementation 'org.codehaus.groovy:groovy-dateutil:2.5.22'
}
//direct dependencies
implementation (group: 'io.github.kayr', name: 'phrase-matcher', version: '0.1.7'){
exclude group: 'log4j'
}
//second string needs log4j
runtimeOnly 'org.slf4j:slf4j-log4j12:1.7.36'
implementation ('com.opencsv:opencsv:5.8'){
exclude group: 'commons-beanutils'
// exclude group: 'org.apache.commons', module: 'commons-lang3'
exclude group: 'org.apache.commons', module: 'commons-text'
exclude group: 'org.apache.commons', module: 'commons-collections4'
}
implementation group: 'org.slf4j', name: 'slf4j-api', version: '1.7.25'
implementation 'com.jakewharton.fliptables:fliptables:1.1.0'
//add slf4j api dependency
implementation 'org.slf4j:slf4j-api:2.0.7'
//optional dependencies
compileOnly 'org.apache.poi:poi-ooxml:4.1.1', {
exclude group: 'stax', module: 'stax-api'
}
compileOnly 'org.apache.poi:ooxml-schemas:1.4', {
exclude group: 'stax', module: 'stax-api'
}
//test dependencies
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.2'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.2'
testImplementation 'com.h2database:h2:2.2.220'
testImplementation group: 'org.bitbucket.mstrobel', name: 'procyon-reflection', version: '0.5.32'
//add slf4j for tests
testImplementation 'org.slf4j:slf4j-simple:1.7.36'
testImplementation 'mysql:mysql-connector-java:8.0.33'
testImplementation 'org.mockito:mockito-core:5.2.0'
compileOnly 'org.projectlombok:lombok:1.18.28'
annotationProcessor 'org.projectlombok:lombok:1.18.28'
testCompileOnly 'org.projectlombok:lombok:1.18.28'
testAnnotationProcessor 'org.projectlombok:lombok:1.18.28'
//need poi for tests
testImplementation 'org.apache.poi:poi-ooxml:4.1.1', {
exclude group: 'stax', module: 'stax-api'
}
testImplementation 'org.apache.poi:ooxml-schemas:1.4', {
exclude group: 'stax', module: 'stax-api'
}
}
test {
testLogging {
events "passed", "skipped", "failed", "standardOut", "standardError"
}
}
//generate stubs for groovy
release {
failOnCommitNeeded = false
versionProperties = ['VERSION_NAME']
}
// print version task
tasks.register('printVersion') {
doLast {
println findProperty('BASE_VERSION')
}
}