-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
148 lines (127 loc) · 4.44 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
146
147
148
plugins {
id 'com.palantir.git-version' version '0.14.0'
id 'io.github.gradle-nexus.publish-plugin' version '1.1.0'
id 'nebula.lint' version '17.7.1'
}
description = 'Integration for Apache Calcite'
def scmUrl = 'https://github.com/miniconnect/miniconnect-api.git'
def websiteUrl = scmUrl.replaceAll(/\.git$/, "");
def automaticVersion = '0.1.0-SNAPSHOT'
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" : ""
automaticVersion = versionPrefix + versionPatch + versionSuffix
}
defaultTasks 'build'
nexusPublishing {
repositories {
sonatype()
}
}
allprojects {
group 'hu.webarticum.holodb.calcite'
version automaticVersion
ext.miniConnectApiVersion = '0.2.1-SNAPSHOT'
ext.miniConnectVersion = '0.5.1-SNAPSHOT'
ext.miniBaseVersion = '0.2.1-SNAPSHOT'
ext.miniConnectClientVersion = '0.2.1-SNAPSHOT'
ext.holodbVersion = '0.5.1-SNAPSHOT'
repositories {
mavenCentral()
mavenLocal()
}
}
subprojects {
apply plugin: 'java'
apply plugin: 'signing'
apply plugin: 'maven-publish'
sourceCompatibility = 1.8
targetCompatibility = 1.8
afterEvaluate {
if (sourceSets.hasProperty('lab')) {
task execLab(type: JavaExec) {
group = 'Execution'
description = 'Run lab demo main class'
classpath = sourceSets.lab.runtimeClasspath
mainClass = System.getProperty("lab.exec.main.class")
standardInput = System.in
}
}
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
options.release = 8
}
java {
withJavadocJar()
withSourcesJar()
}
javadoc {
options.addStringOption('Xdoclint:none', '-quiet')
}
def moduleNamePrefix = 'hu.webarticum.miniconnect.'
def cleanProjectName = project.name.replaceAll(/\W/, ".")
def moduleName = "${moduleNamePrefix}${cleanProjectName}"
jar {
manifest {
attributes('Automatic-Module-Name': moduleName)
}
}
test {
useJUnitPlatform()
testLogging {
events 'failed'
showExceptions true
exceptionFormat 'full'
showCauses true
showStackTraces true
showStandardStreams false
}
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
suppressAllPomMetadataWarnings()
}
}
}
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]'
}
}
}
}
}
signing {
required { true }
sign configurations.archives
sign publishing.publications.mavenJava
}
}
}