@@ -21,6 +21,9 @@ import com.github.vlsi.gradle.crlf.CrLfSpec
2121import com.github.vlsi.gradle.crlf.LineEndings
2222import com.github.vlsi.gradle.git.FindGitAttributes
2323import com.github.vlsi.gradle.git.dsl.gitignore
24+ import com.github.vlsi.gradle.properties.dsl.lastEditYear
25+ import com.github.vlsi.gradle.properties.dsl.props
26+ import com.github.vlsi.gradle.properties.dsl.toBool
2427import com.github.vlsi.gradle.release.RepositoryType
2528import de.thetaphi.forbiddenapis.gradle.CheckForbiddenApis
2629import de.thetaphi.forbiddenapis.gradle.CheckForbiddenApisExtension
@@ -41,6 +44,7 @@ plugins {
4144 id(" com.github.vlsi.ide" )
4245 // Release
4346 id(" com.github.vlsi.crlf" )
47+ id(" com.github.vlsi.gradle-extensions" )
4448 id(" com.github.vlsi.license-gather" ) apply false
4549 id(" com.github.vlsi.stage-vote-release" )
4650}
@@ -50,53 +54,20 @@ repositories {
5054 mavenCentral()
5155}
5256
53- fun Project.boolProp (name : String ) =
54- findProperty(name)
55- // Project properties include tasks, extensions, etc, and we want only String properties
56- // We don't want to use "task" as a boolean property
57- ?.let { it as ? String }
58- ?.equals(" false" , ignoreCase = true )?.not ()
59-
60- fun reportsForHumans () = ! (System .getenv()[" CI" ]?.toBoolean() ? : false )
61-
62- val lastEditYear by extra {
63- file(" $rootDir /NOTICE" )
64- .readLines()
65- .first { it.contains(" Copyright" ) }
66- .let {
67- """ Copyright \d{4}-(\d{4})""" .toRegex()
68- .find(it)?.groupValues?.get(1 )
69- ? : throw IllegalStateException (" Unable to identify copyright year from $rootDir /NOTICE" )
70- }
71- }
57+ fun reportsForHumans () = ! System .getenv()[" CI" ].toBool(default = false )
7258
73- // Do not enable spotbugs by default. Execute it only when -Pspotbugs is present
74- val enableSpotBugs by extra {
75- // TODO: this activates spotbuts on CI only. Should this be corrected to "enable always"?
76- boolProp(" spotbugs" ) ? : ! reportsForHumans()
77- }
59+ val lastEditYear by extra(lastEditYear())
7860
79- val skipCheckstyle by extra {
80- boolProp(" skipCheckstyle" ) ? : false
81- }
82-
83- val skipJavadoc by extra {
84- boolProp(" skipJavadoc" ) ? : false
85- }
86-
87- val enableMavenLocal by extra {
88- boolProp(" enableMavenLocal" ) ? : false
89- }
90-
91- val enableGradleMetadata by extra {
92- boolProp(" enableGradleMetadata" ) ? : false
93- }
61+ // Do not enable spotbugs by default. Execute it only when -Pspotbugs is present
62+ val enableSpotBugs = props.bool(" spotbugs" , default = false )
63+ val skipCheckstyle by props()
64+ val skipJavadoc by props()
65+ val enableMavenLocal by props()
66+ val enableGradleMetadata by props()
9467
9568// By default use Java implementation to sign artifacts
9669// When useGpgCmd=true, then gpg command line tool is used for signing
97- val useGpgCmd by extra {
98- boolProp(" useGpgCmd" ) ? : false
99- }
70+ val useGpgCmd by props()
10071
10172ide {
10273 copyrightToAsf()
@@ -230,6 +201,8 @@ allprojects {
230201 tasks {
231202 withType<Javadoc >().configureEach {
232203 (options as StandardJavadocDocletOptions ).apply {
204+ // Please refrain from using non-ASCII chars below since the options are passed as
205+ // javadoc.options file which is parsed with "default encoding"
233206 noTimestamp.value = true
234207 showFromProtected()
235208 // javadoc: error - The code being documented uses modules but the packages
@@ -242,7 +215,7 @@ allprojects {
242215 windowTitle = " Apache Calcite Avatica ${project.name} API"
243216 header = " <b>Apache Calcite Avatica</b>"
244217 bottom =
245- " Copyright © 2012-$lastEditYear Apache Software Foundation. All Rights Reserved."
218+ " Copyright © 2012-$lastEditYear Apache Software Foundation. All Rights Reserved."
246219 if (JavaVersion .current() >= JavaVersion .VERSION_1_9 ) {
247220 addBooleanOption(" html5" , true )
248221 links(" https://docs.oracle.com/javase/9/docs/api/" )
0 commit comments