-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
140 lines (118 loc) · 3.73 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
import java.util.regex.Matcher
plugins {
// Apply the application plugin to add support for building a CLI application in Java.
id 'application'
id 'java-library'
// Publish
id 'maven-publish'
id 'maven'
id 'net.researchgate.release' version '2.8.1'
// Code quality
id 'com.github.sherter.google-java-format' version '0.9'
}
// Variables
def main_class = 'application.AppStart'
static def getDate() { return new Date().format('dd.MM.yyyy HH:mm:ss') }
verifyGoogleJavaFormat.enabled = false
commitNewVersion.enabled = false
repositories {
// Use JCenter for resolving dependencies.
jcenter()
}
dependencies {
// Gradle dependencies
// This dependency is used by the application.
implementation 'com.google.guava:guava:29.0-jre'
// Exporting to iCal
// https://github.com/mangstadt/biweekly
compile 'net.sf.biweekly:biweekly:0.6.6'
// JSON parsing
compile 'com.fasterxml.jackson.core:jackson-databind:2.12.0'
//Log4J
compile 'org.apache.logging.log4j:log4j-api:2.14.0'
compile 'org.apache.logging.log4j:log4j-core:2.14.0'
// Test dependencies
// Use JUnit test framework.
// testImplementation 'junit:junit:4.13'
implementation 'org.junit.jupiter:junit-jupiter:5.4.2'
testImplementation 'org.assertj:assertj-core:3.19.0'
}
test {
useJUnitPlatform()
}
application {
// Define the main class for the application.
getMainClass().set(main_class)
}
jar {
manifest {
attributes 'Implementation-Title': rootProject.name,
'Implementation-Version': getArchiveVersion(),
'Main-Class': main_class,
'Build-Time-ISO-8601': getDate(),
'Multi-Release': 'true'
}
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
}
// Debug infos when building
tasks.withType(JavaCompile) {
options.compilerArgs += "-Xlint:unchecked"
}
tasks.withType(Jar) {
destinationDirectory = file("$rootDir/build/jar")
}
tasks.withType(Javadoc) {
destinationDir = file("$rootDir/build/doc")
}
publishing {
repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/SirMoM/BirthdayManager")
credentials {
username = project.findProperty("gpr.user") ?: System.getenv("GITHUB_ACTOR")
password = project.findProperty("gpr.key") ?: System.getenv("GITHUB_TOKEN")
}
}
}
publications {
gpr(MavenPublication) {
groupId 'sirmom'
artifactId getArchivesBaseName().toString().toLowerCase()
version getVersion()
from components.java
}
}
}
release {
failOnCommitNeeded = true
failOnPublishNeeded = true
failOnSnapshotDependencies = true
failOnUnversionedFiles = true
failOnUpdateNeeded = true
revertOnFail = true
preCommitText = ''
preTagCommitMessage = '[Gradle Release Plugin] - pre tag commit: '
tagCommitMessage = '[Gradle Release Plugin] - creating tag: '
newVersionCommitMessage = '[Gradle Release Plugin] - new version commit: '
tagTemplate = '${version}'
versionPropertyFile = 'gradle.properties'
versionProperties = []
snapshotSuffix = '-SNAPSHOT'
buildTasks = ['build']
ignoredSnapshotDependencies = []
versionPatterns = [
/(\d+)([^\d]*$)/: { Matcher m, Project p -> m.replaceAll("${(m[0][1] as int) + 1}${m[0][2]}") }
]
pushReleaseVersionBranch = false
scmAdapters = [
net.researchgate.release.GitAdapter
]
git {
requireBranch = 'master'
pushToRemote = 'origin'
pushToBranchPrefix = 'releases/'
commitVersionFileOnly = false
signTag = false
}
}