You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by vl...@apache.org on 2019/11/17 12:46:50 UTC
[calcite-avatica] branch master updated: Update build script:
simplify properties, fix javadoc build for non UTF8 default encoding
This is an automated email from the ASF dual-hosted git repository.
vladimirsitnikov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/calcite-avatica.git
The following commit(s) were added to refs/heads/master by this push:
new 22a8f7f Update build script: simplify properties, fix javadoc build for non UTF8 default encoding
22a8f7f is described below
commit 22a8f7ff5888c119d6a0246eabbd559ee5880a55
Author: Vladimir Sitnikov <si...@gmail.com>
AuthorDate: Sun Nov 17 12:36:06 2019 +0300
Update build script: simplify properties, fix javadoc build for non UTF8 default encoding
---
.github/workflows/main.yml | 6 ++---
build.gradle.kts | 59 +++++++++++++---------------------------------
gradle.properties | 5 +---
release/build.gradle.kts | 3 +++
settings.gradle.kts | 12 ++++++----
site/_docs/howto.md | 4 ++--
site/develop/avatica.md | 2 +-
7 files changed, 33 insertions(+), 58 deletions(-)
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 221bcab..0d299bb 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -38,9 +38,9 @@ jobs:
with:
java-version: 11
- name: 'Test'
- shell: bash
+ shell: cmd
run: |
- ./gradlew --no-parallel build
+ ./gradlew --no-parallel --no-daemon build javadoc
mac:
name: 'macOS (JDK 13)'
@@ -55,4 +55,4 @@ jobs:
java-version: 13
- name: 'Test'
run: |
- ./gradlew --no-parallel build
+ ./gradlew --no-parallel --no-daemon build javadoc
diff --git a/build.gradle.kts b/build.gradle.kts
index 5749633..c509070 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -21,6 +21,9 @@ import com.github.vlsi.gradle.crlf.CrLfSpec
import com.github.vlsi.gradle.crlf.LineEndings
import com.github.vlsi.gradle.git.FindGitAttributes
import com.github.vlsi.gradle.git.dsl.gitignore
+import com.github.vlsi.gradle.properties.dsl.lastEditYear
+import com.github.vlsi.gradle.properties.dsl.props
+import com.github.vlsi.gradle.properties.dsl.toBool
import com.github.vlsi.gradle.release.RepositoryType
import de.thetaphi.forbiddenapis.gradle.CheckForbiddenApis
import de.thetaphi.forbiddenapis.gradle.CheckForbiddenApisExtension
@@ -41,6 +44,7 @@ plugins {
id("com.github.vlsi.ide")
// Release
id("com.github.vlsi.crlf")
+ id("com.github.vlsi.gradle-extensions")
id("com.github.vlsi.license-gather") apply false
id("com.github.vlsi.stage-vote-release")
}
@@ -50,53 +54,20 @@ repositories {
mavenCentral()
}
-fun Project.boolProp(name: String) =
- findProperty(name)
- // Project properties include tasks, extensions, etc, and we want only String properties
- // We don't want to use "task" as a boolean property
- ?.let { it as? String }
- ?.equals("false", ignoreCase = true)?.not()
-
-fun reportsForHumans() = !(System.getenv()["CI"]?.toBoolean() ?: false)
-
-val lastEditYear by extra {
- file("$rootDir/NOTICE")
- .readLines()
- .first { it.contains("Copyright") }
- .let {
- """Copyright \d{4}-(\d{4})""".toRegex()
- .find(it)?.groupValues?.get(1)
- ?: throw IllegalStateException("Unable to identify copyright year from $rootDir/NOTICE")
- }
-}
+fun reportsForHumans() = !System.getenv()["CI"].toBool(default = false)
-// Do not enable spotbugs by default. Execute it only when -Pspotbugs is present
-val enableSpotBugs by extra {
- // TODO: this activates spotbuts on CI only. Should this be corrected to "enable always"?
- boolProp("spotbugs") ?: !reportsForHumans()
-}
+val lastEditYear by extra(lastEditYear())
-val skipCheckstyle by extra {
- boolProp("skipCheckstyle") ?: false
-}
-
-val skipJavadoc by extra {
- boolProp("skipJavadoc") ?: false
-}
-
-val enableMavenLocal by extra {
- boolProp("enableMavenLocal") ?: false
-}
-
-val enableGradleMetadata by extra {
- boolProp("enableGradleMetadata") ?: false
-}
+// Do not enable spotbugs by default. Execute it only when -Pspotbugs is present
+val enableSpotBugs = props.bool("spotbugs", default = false)
+val skipCheckstyle by props()
+val skipJavadoc by props()
+val enableMavenLocal by props()
+val enableGradleMetadata by props()
// By default use Java implementation to sign artifacts
// When useGpgCmd=true, then gpg command line tool is used for signing
-val useGpgCmd by extra {
- boolProp("useGpgCmd") ?: false
-}
+val useGpgCmd by props()
ide {
copyrightToAsf()
@@ -230,6 +201,8 @@ allprojects {
tasks {
withType<Javadoc>().configureEach {
(options as StandardJavadocDocletOptions).apply {
+ // Please refrain from using non-ASCII chars below since the options are passed as
+ // javadoc.options file which is parsed with "default encoding"
noTimestamp.value = true
showFromProtected()
// javadoc: error - The code being documented uses modules but the packages
@@ -242,7 +215,7 @@ allprojects {
windowTitle = "Apache Calcite Avatica ${project.name} API"
header = "<b>Apache Calcite Avatica</b>"
bottom =
- "Copyright © 2012-$lastEditYear Apache Software Foundation. All Rights Reserved."
+ "Copyright © 2012-$lastEditYear Apache Software Foundation. All Rights Reserved."
if (JavaVersion.current() >= JavaVersion.VERSION_1_9) {
addBooleanOption("html5", true)
links("https://docs.oracle.com/javase/9/docs/api/")
diff --git a/gradle.properties b/gradle.properties
index 5f9d2a3..67acf9f 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -34,10 +34,7 @@ calcite.avatica.version=1.16.0
# Plugins
com.github.johnrengelman.shadow.version=5.1.0
com.github.spotbugs.version=2.0.0
-com.github.vlsi.crlf.version=1.46.0
-com.github.vlsi.ide.version=1.46.0
-com.github.vlsi.license-gather.version=1.46.0
-com.github.vlsi.stage-vote-release.version=1.46.0
+com.github.vlsi.vlsi-release-plugins.version=1.47.0
com.google.protobuf.version=0.8.10
de.thetaphi.forbiddenapis.version=2.7
org.jetbrains.gradle.plugin.idea-ext.version=0.5
diff --git a/release/build.gradle.kts b/release/build.gradle.kts
index cb2b2c9..5234413 100644
--- a/release/build.gradle.kts
+++ b/release/build.gradle.kts
@@ -185,6 +185,9 @@ for (archive in listOf(Zip::class, Tar::class)) {
wa1191SetInputs(gitProps)
with(sourceLayout())
}
+ doLast {
+ logger.lifecycle("Source distribution is created: ${archiveFile.get().asFile}")
+ }
}
releaseArtifacts {
artifact(archiveTask)
diff --git a/settings.gradle.kts b/settings.gradle.kts
index 172d4aa..217abf0 100644
--- a/settings.gradle.kts
+++ b/settings.gradle.kts
@@ -18,14 +18,16 @@
pluginManagement {
plugins {
- fun PluginDependenciesSpec.idv(id: String) = id(id) version extra["$id.version"].toString()
+ fun String.v() = extra["$this.version"].toString()
+ fun PluginDependenciesSpec.idv(id: String, key: String = id) = id(id) version key.v()
idv("com.github.johnrengelman.shadow")
idv("com.github.spotbugs")
- idv("com.github.vlsi.crlf")
- idv("com.github.vlsi.ide")
- idv("com.github.vlsi.license-gather")
- idv("com.github.vlsi.stage-vote-release")
+ idv("com.github.vlsi.crlf", "com.github.vlsi.vlsi-release-plugins")
+ idv("com.github.vlsi.gradle-extensions", "com.github.vlsi.vlsi-release-plugins")
+ idv("com.github.vlsi.ide", "com.github.vlsi.vlsi-release-plugins")
+ idv("com.github.vlsi.license-gather", "com.github.vlsi.vlsi-release-plugins")
+ idv("com.github.vlsi.stage-vote-release", "com.github.vlsi.vlsi-release-plugins")
idv("com.google.protobuf")
idv("de.thetaphi.forbiddenapis")
idv("org.jetbrains.gradle.plugin.idea-ext")
diff --git a/site/_docs/howto.md b/site/_docs/howto.md
index 77dbcf6..c987662 100644
--- a/site/_docs/howto.md
+++ b/site/_docs/howto.md
@@ -150,7 +150,7 @@ fi
Also, ensure that `default-cache-ttl 6000` is set in `~/.gnupg/gpg-agent.conf`
to guarantee that your credentials will be cached for the duration of the build.
-## Set up Maven repository credentials (for Calcite committers)
+## Set up Nexus repository credentials (for Calcite committers)
Gradle provides multiple ways to [configure project properties](https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_configuration_properties).
For instance, you could update `$HOME/.gradle/gradle.properties`.
@@ -265,7 +265,7 @@ docker-compose run -v /c/Users/username/AppData/Roaming/gnupg:/.gnupg dry-run
* For each .jar (for example `core/build/libs/avatica-core-X.Y.Z.jar`
and `server/build/libs/avatica-server-X.Y.Z-sources.jar`),
verify that the `META-INF` directory contains the correct
- contents for `DEPENDENCIES`, `LICENSE` and `NOTICE` per the
+ contents for `LICENSE` and `NOTICE` per the
source/classes contained. Refer to the ASF licensing documentation on
what is required.
* Check PGP, per [this](https://httpd.apache.org/dev/verification.html)
diff --git a/site/develop/avatica.md b/site/develop/avatica.md
index 2f56046..6e35ca8 100644
--- a/site/develop/avatica.md
+++ b/site/develop/avatica.md
@@ -49,7 +49,7 @@ then build using maven:
{% highlight bash %}
$ git clone git://github.com/apache/calcite-avatica.git avatica
-$ cd avatica
+$ cd calcite-avatica
$ ./gradlew build
{% endhighlight %}