-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
122 lines (107 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
116
117
118
119
120
121
122
plugins {
id 'java-library'
id 'eclipse'
id 'signing'
id 'maven-publish'
id 'com.palantir.git-version' version '0.15.0'
id 'io.github.gradle-nexus.publish-plugin' version '1.1.0'
}
sourceCompatibility = "1.8";
targetCompatibility = "1.8";
group = 'hu.webarticum.aurora'
description = 'Aurora TimeTable Core'
def moduleName = 'hu.webarticum.aurora.core'
def scmUrl = 'https://github.com/davidsusu/aurora-core.git'
def websiteUrl = scmUrl.replaceAll(/\.git$/, "");
def versionMatcher = gitVersion() =~ /^v?(\d+\.\d+\.)(\d+)(.*)$/
if (versionMatcher.size() > 0) {
def versionMatch = versionMatcher[0]
def isVersionDirty = !versionMatch[3].isEmpty()
def versionPrefix = versionMatch[1]
def versionPatch = isVersionDirty ? (Integer.parseInt(versionMatch[2]) + 1) + "" : versionMatch[2];
def versionSuffix = isVersionDirty ? "-SNAPSHOT" : ""
version versionPrefix + versionPatch + versionSuffix
} else {
version '0.1.0-SNAPSHOT'
}
repositories {
mavenCentral()
}
dependencies {
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.7.1'
testImplementation 'org.junit.jupiter:junit-jupiter-params:5.7.1'
testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.7.1'
testImplementation 'org.junit.platform:junit-platform-launcher:1.7.1'
testImplementation 'org.assertj:assertj-core:3.19.0'
}
defaultTasks 'build'
java {
withJavadocJar()
withSourcesJar()
}
jar {
manifest {
attributes('Automatic-Module-Name': moduleName)
}
}
nexusPublishing {
repositories {
sonatype()
}
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
}
}
}
signing {
required { true }
sign configurations.archives
sign publishing.publications.mavenJava
}
test {
useJUnitPlatform()
testLogging {
events 'failed'
showExceptions true
exceptionFormat 'full'
showCauses true
showStackTraces true
showStandardStreams false
}
}
tasks.withType(JavaCompile) {
options.compilerArgs << '-Xlint:unchecked'
options.deprecation = true
}
project.plugins.withType(MavenPublishPlugin).all {
PublishingExtension publishing = project.extensions.getByType(PublishingExtension)
publishing.publications.withType(MavenPublication).all { mavenPublication ->
mavenPublication.pom {
name = project.name
description = project.description
url = websiteUrl
licenses {
license {
name = 'The Apache Software License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
distribution = 'repo'
}
}
scm {
connection = 'scm:git:' + scmUrl
developerConnection = 'scm:git:' + scmUrl
url = scmUrl
}
developers {
developer {
id = 'davidsusu'
name = 'Dávid Horváth'
email = '[email protected]'
}
}
}
}
}