-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
137 lines (119 loc) · 3.35 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
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'
description = 'Honeycomb cells for building regular expressions in a fluent way'
def moduleName = 'hu.webarticum.regexbee'
def scmUrl = 'https://github.com/davidsusu/regexbee.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()
mavenLocal()
}
configurations {
examples
}
sourceSets {
examples {
java {
srcDirs = ['src/examples/java']
}
}
}
dependencies {
examplesImplementation sourceSets.main.output
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]'
}
}
}
}
}