This repository has been archived by the owner on Mar 3, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
91 lines (88 loc) · 3.03 KB
/
build.gradle.kts
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
///////////////////////////////////////////////////////////////////////////////
// GRADLE CONFIGURATION
///////////////////////////////////////////////////////////////////////////////
plugins {
java
id("com.diffplug.spotless") version "5.10.2"
id("org.sonarqube") version "3.1"
jacoco
}
buildscript {
repositories {
mavenLocal()
maven(url = "https://repo.eclipse.org/service/local/repositories/maven_central/content")
mavenCentral()
}
dependencies {
classpath("org.eclipse.keyple:keyple-gradle:0.2.+") { isChanging = true }
}
}
apply(plugin = "org.eclipse.keyple")
///////////////////////////////////////////////////////////////////////////////
// APP CONFIGURATION
///////////////////////////////////////////////////////////////////////////////
repositories {
mavenLocal()
maven(url = "https://repo.eclipse.org/service/local/repositories/maven_central/content")
mavenCentral()
maven(url = "https://oss.sonatype.org/content/repositories/snapshots")
}
dependencies {
compileOnly(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar"))))
implementation("org.eclipse.keyple:keyple-common-java-api:2.0.0")
implementation("org.eclipse.keyple:keyple-plugin-java-api:2.0.0")
implementation("org.eclipse.keyple:keyple-util-java-lib:2.2.0")
implementation("org.slf4j:slf4j-api:1.7.32")
testImplementation("junit:junit:4.13.2")
testImplementation("org.assertj:assertj-core:3.15.0")
}
val javaSourceLevel: String by project
val javaTargetLevel: String by project
java {
sourceCompatibility = JavaVersion.toVersion(javaSourceLevel)
targetCompatibility = JavaVersion.toVersion(javaTargetLevel)
println("Compiling Java $sourceCompatibility to Java $targetCompatibility.")
withJavadocJar()
withSourcesJar()
}
///////////////////////////////////////////////////////////////////////////////
// TASKS CONFIGURATION
///////////////////////////////////////////////////////////////////////////////
tasks {
spotless {
java {
target("src/**/*.java")
licenseHeaderFile("${project.rootDir}/LICENSE_HEADER")
importOrder("java", "javax", "org", "com", "")
removeUnusedImports()
googleJavaFormat()
}
}
test {
testLogging {
events("passed", "skipped", "failed")
}
finalizedBy("jacocoTestReport")
}
jacocoTestReport {
dependsOn("test")
reports {
xml.isEnabled = true
csv.isEnabled = false
html.isEnabled = true
}
}
sonarqube {
properties {
property("sonar.projectKey", "eclipse_" + project.name)
property("sonar.organization", "eclipse")
property("sonar.host.url", "https://sonarcloud.io")
property("sonar.login", System.getenv("SONAR_LOGIN"))
System.getenv("BRANCH_NAME")?.let {
if (!"main".equals(it)) {
property("sonar.branch.name", it)
}
}
}
}
}