-
-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathbuild-properties.gradle
More file actions
56 lines (46 loc) · 2.12 KB
/
build-properties.gradle
File metadata and controls
56 lines (46 loc) · 2.12 KB
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
// SPDX-FileCopyrightText: Copyright 2020-2026 Mark Rotteveel
// SPDX-License-Identifier: LGPL-2.1-or-later
import java.time.LocalDateTime
// Property configuration for build
// Standard version information config from build.properties
def buildProperties = new Properties()
file('build.properties').withInputStream {
buildProperties.load(it)
}
// Optional local environment config from build-local.properties
def localBuildPropertiesFile = file('build-local.properties')
if (localBuildPropertiesFile.exists()) {
localBuildPropertiesFile.withInputStream {
buildProperties.load(it)
}
}
buildProperties.stringPropertyNames().each {
ext.set(it, buildProperties[it])
}
def buildTime = LocalDateTime.now()
ext.'build.id' = buildTime.format('yyyyMMddHHmm')
ext.YEAR = buildTime.format('yyyy')
// Build profile (target Java version)
def buildProfileProp = findProperty('buildProfile') as String
def buildMatcher = buildProfileProp =~ /^(?:java)?(\d+)$/
ext.buildJava = buildMatcher ? buildMatcher.group(1) as Integer : 17
println "Build profile: Java ${ext.buildJava}"
if (ext.buildJava != 17) {
println "WARNING: Java target version ${ext.buildJava} (buildProfile) is not a baseline version and will not be published to Maven."
}
// As we only publish the Java 17 version, we don't do further mapping for higher JDBC versions
ext.'specification.version' = '4.3'
// Test profile (test Java version)
def testProfileProp = findProperty('testProfile') as String
def testMatcher = testProfileProp =~ /^(?:java)?(\d+)$/
ext.testJava = testMatcher ? testMatcher.group(1) as Integer : ext.buildJava
println "Test profile: Java ${ext.testJava}"
ext.'version.simple' = "${project.'version.major'}.${project.'version.minor'}.${project.'version.revision'}".toString()
ext.'version.maven' = "${project.'version.simple'}${project.'version.tag'}".toString()
ext.'signing.password' = credentials.forKey('signing.password')
ext.centralPassword = credentials.forKey('centralPassword')
ext.isReleaseVersion = provider {
!version.endsWith("SNAPSHOT")
}
ext.sourceDocumentation = file('src/documentation')
ext.buildDocs = layout.buildDirectory.dir("docs")