-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
168 lines (145 loc) · 5.54 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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
/*
* This file was generated by the Gradle 'init' task.
*
* This generated file contains a sample Java library project to get you started.
* For more details take a look at the 'Building Java & JVM projects' chapter in the Gradle
* User Manual available at https://docs.gradle.org/6.8.3/userguide/building_java_projects.html
*/
plugins {
// Apply the java-library plugin for API and implementation separation.
id 'java-library'
id "org.sonarqube" version "3.3"
id 'jacoco'
id 'maven-publish'
id 'signing'
}
group = 'dev.vespucci.gsoc.vh'
archivesBaseName = 'OpeningHoursEvaluator'
version = '0.0.1'
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
withJavadocJar()
withSourcesJar()
}
jacocoTestReport {
reports {
xml.enabled true
}
}
test.finalizedBy jacocoTestReport
sonarqube {
properties {
property "sonar.java.source","1.8"
property "sonar.sourceEncoding","UTF-8"
property "sonar.projectName", "OpeningHoursEvaluator"
property "sonar.projectKey", "goodudetheboy_OpeningHoursEvaluator"
property "sonar.organization", "goodudetheboy"
property "sonar.host.url", "https://sonarcloud.io"
property "sonar.coverage.jacoco.xmlReportPaths","build/reports/jacoco/jacocoTestReport/jacocoTestReport.xml"
property "sonar.qualitygate.wait", "true"
}
}
repositories {
// Use JCenter for resolving dependencies.
jcenter()
mavenCentral()
}
dependencies {
// Use JUnit test framework.
testImplementation 'junit:junit:4.13'
// This dependency is exported to consumers, that is to say found on their compile classpath.
api 'org.apache.commons:commons-math3:3.6.1'
// This dependency is used internally, and not exposed to consumers on their own compile classpath.
implementation 'com.google.guava:guava:29.0-jre'
// OpeningHoursParser, used to parse opening hours
implementation 'ch.poole:OpeningHoursParser:0.25.0'
// This dependency is used to calculate sunrise/sunset time based on location
implementation 'org.shredzone.commons:commons-suncalc:3.5'
// Used to get timezone based on latitude and longitude
implementation 'net.iakovlev:timeshape:2020d.11'
// https://mvnrepository.com/artifact/org.slf4j/slf4j-simple
testImplementation 'org.slf4j:slf4j-simple:2.0.0-alpha2'
// World holiday data
implementation 'io.github.goodudetheboy:WorldHolidayDates:0.0.3'
}
task testCI(type: JavaExec) {
classpath sourceSets.main.runtimeClasspath
main = "openinghoursevaluator.Main"
}
task run(type: JavaExec) {
classpath sourceSets.main.runtimeClasspath
main = "openinghoursevaluator.Main"
}
task individualTesting(type: JavaExec) {
main = "openinghoursevaluator.IndividualTest"
classpath = sourceSets.test.runtimeClasspath
standardInput = System.in
args('false')
}
individualTesting.group = 'verification'
individualTesting.description = "REPL instance to test the evaluator upon an input of an opening hours tag and a LocalDateTime string. Recommended running with '--console=plain'."
task individualTestingStrict(type: JavaExec) {
main = "openinghoursevaluator.IndividualTest"
classpath = sourceSets.test.runtimeClasspath
standardInput = System.in
args('true')
}
individualTestingStrict.group = 'verification'
individualTestingStrict.description = "REPL instance to test the evaluator upon an input of an opening hours tag and a LocalDateTime string, with parser running on strict mode. Recommended running with '--console=plain'."
task fatJar(type: Jar) {
manifest {
attributes 'Implementation-Title': 'OpeningHoursEvaluator fat jar',
'Implementation-Version': "${project.version}"
}
baseName = project.archivesBaseName + '-all'
from { configurations.compileClasspath.collect { it.isDirectory() ? it : zipTree(it) } }
with jar
}
ext {
repoUrl = 'https://github.com/goodudetheboy/OpeningHoursEvaluator.git'
spdxId = 'MIT'
}
publishing {
publications {
Release(MavenPublication) {
groupId 'dev.vespucci.gsoc.vh'
artifactId 'OpeningHoursEvaluator'
from components.java
pom {
name = artifactId
description = 'An evaluator for opening hours tag according to OSM opening hours specification'
url = 'https://github.com/goodudetheboy/OpeningHoursEvaluator'
scm {
url = repoUrl
}
licenses {
license {
name = spdxId
url = 'https://github.com/goodudetheboy/OpeningHoursEvaluator/blob/main/LICENSE'
}
}
developers {
developer {
name = 'Vuong Ho'
}
}
}
repositories {
maven {
name = 'sonatype'
credentials {
username System.getenv('ossrhUsername')
password System.getenv('ossrhPassword')
}
def releasesRepoUrl = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
def snapshotsRepoUrl = "https://s01.oss.sonatype.org/content/repositories/snapshots/"
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
}
}
}
}
}
signing {
sign publishing.publications.Release
}