-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
145 lines (122 loc) · 4.32 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
plugins {
id 'java'
id("org.sonarqube") version "5.1.0.4882"
id 'jacoco'
id "org.owasp.dependencycheck" version "8.4.3"
id 'signing'
id 'maven-publish'
}
group = 'com.ldiamond'
version = '2.0.0'
sourceCompatibility = '11'
targetCompatibility = '11'
configurations {
compileOnly {
extendsFrom annotationProcessor
}
}
repositories {
mavenCentral()
maven { url 'https://repo.spring.io/milestone' }
maven { url 'https://repo.spring.io/snapshot' }
}
dependencies {
implementation 'com.tngtech.archunit:archunit-junit5:1.3.0'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.11.0'
testImplementation 'org.junit.jupiter:junit-jupiter:5.11.0'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher:1.11.0'
// Needed to test JPA_COHESION_RESTFUL_GET_MAPPINGS - when Java 17 has a higher market share we will upgrade to Java 17 and upgrade the Spring Dependency to latest
testCompileOnly 'org.springframework:spring-context:5.3.39'
testCompileOnly 'org.springframework:spring-web:5.3.39'
testCompileOnly 'jakarta.persistence:jakarta.persistence-api:3.2.0'
}
tasks.named('test') {
useJUnitPlatform()
}
sonarqube {
properties {
property "sonar.host.url", "https://sonarcloud.io"
property "sonar.projectKey", "larrydiamond_ArchitectureUnitTests"
property "sonar.organization", "larrydiamond-github"
property "sonar.sourceEncoding", "UTF-8"
property "sonar.scm.disabled", "true"
}
}
test {
finalizedBy jacocoTestReport // report is always generated after tests run
}
jacocoTestReport {
dependsOn test // tests are required to run before generating the report
}
jacocoTestReport {
reports {
xml.required = true
csv.required = true
html.outputLocation = layout.buildDirectory.dir('jacocoHtml')
}
}
java {
withJavadocJar()
withSourcesJar()
}
ext.isReleaseVersion = !version.endsWith("SNAPSHOT")
publishing {
repositories {
maven {
name = 'myRepo'
url = layout.buildDirectory.dir("repo")
}
maven {
def releaseRepo = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
def snapshotRepo = "https://s01.oss.sonatype.org/content/repositories/snapshots/"
name = "OSSRH"
url = isReleaseVersion ? releaseRepo : snapshotRepo
allowInsecureProtocol = false
credentials {
username = findProperty("ossrhUsername") ?: System.getenv("OSSRH_USERNAME")
password = findProperty("ossrhPassword") ?: System.getenv("OSSRH_PASSWORD")
}
}
}
publications {
mavenJava(MavenPublication) {
artifactId = 'architectureunittests'
from components.java
pom {
name = 'architectureunittests'
description = 'An opinionated set of reasonable common sense ArchUnit tests safe to use on all projects to keep architecture healthy'
inceptionYear='2024'
url = 'https://github.com/larrydiamond/architectureunittests'
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id = 'ldiamond'
name = 'Larry Diamond'
email = '[email protected]'
}
}
scm {
connection = 'scm:git:git://github.com/larrydiamond/architectureunittests.git'
developerConnection = 'scm:git:ssh://github.com:larrydiamond/architectureunittests.git'
url = 'https://github.com/larrydiamond/architectureunittests'
}
}
}
}
}
/* only needed when building release version
signing {
useGpgCmd()
sign configurations.runtimeElements
sign publishing.publications.mavenJava
}
publishMavenJavaPublicationToMavenLocal.dependsOn signRuntimeElements
publish.dependsOn signRuntimeElements
publishMavenJavaPublicationToOSSRHRepository.dependsOn signRuntimeElements
publishMavenJavaPublicationToMyRepoRepository.dependsOn signRuntimeElements
*/