diff --git a/.github/workflows/detekt-code-analysis.yml b/.github/workflows/detekt-code-analysis.yml new file mode 100644 index 00000000000..a9743b60937 --- /dev/null +++ b/.github/workflows/detekt-code-analysis.yml @@ -0,0 +1,22 @@ +name: Run Detekt code analysis + +on: push + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + with: + submodules: 'true' + + - uses: actions/setup-java@v3 + with: + java-version: 11 + distribution: zulu + cache: gradle + + - name: Run analysis + shell: bash + run: ./gradlew detekt --stacktrace diff --git a/build.gradle.kts b/build.gradle.kts index 0bd87d26058..212f452f78e 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -61,29 +61,41 @@ import org.gradle.jvm.tasks.Jar import org.jetbrains.kotlin.gradle.tasks.KotlinCompile buildscript { - apply(from = "$rootDir/version.gradle.kts") - io.spine.internal.gradle.doApplyStandard(repositories) - io.spine.internal.gradle.doApplyGitHubPackages(repositories, "base", rootProject) + /** + * Applies repositories putting those at GitHub first for faster CI builds. + */ + fun ScriptHandlerScope.applyRepositories() { + val gitHub: (String) -> Unit = { repo -> + io.spine.internal.gradle.doApplyGitHubPackages(repositories, repo, rootProject) + } + gitHub("base") + gitHub("time") + gitHub("tool-base") + io.spine.internal.gradle.doApplyStandard(repositories) + } - val spine = io.spine.internal.dependency.Spine(project) + applyRepositories() dependencies { - classpath(spine.mcJavaPlugin) + classpath(io.spine.internal.dependency.Spine.McJava.pluginLib) } io.spine.internal.gradle.doForceVersions(configurations) configurations.all { resolutionStrategy { + val spine = io.spine.internal.dependency.Spine(project) + val kotlin = io.spine.internal.dependency.Kotlin force( - io.spine.internal.dependency.Kotlin.stdLib, - io.spine.internal.dependency.Kotlin.stdLibCommon, + kotlin.stdLib, + kotlin.stdLibCommon, spine.base, spine.time, spine.toolBase, ) } } + } @Suppress("RemoveRedundantQualifierName") // Cannot use imports here. @@ -91,8 +103,10 @@ plugins { `java-library` kotlin("jvm") idea - id(io.spine.internal.dependency.Protobuf.GradlePlugin.id) - id(io.spine.internal.dependency.ErrorProne.GradlePlugin.id) + id(protobufPlugin) + id(errorPronePlugin) + id(gradleDoctor.pluginId) version gradleDoctor.version + `detekt-code-analysis` } object BuildSettings { diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index ce7ed025ff8..fa1c5fcb680 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -102,6 +102,13 @@ val protobufPluginVersion = "0.8.19" */ val dokkaVersion = "1.7.20" +/** + * The version of Detekt Gradle Plugin. + * + * @see Detekt Releases + */ +val detektVersion = "1.21.0" + configurations.all { resolutionStrategy { force( @@ -142,6 +149,7 @@ dependencies { implementation("org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion") implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion") + implementation("io.gitlab.arturbosch.detekt:detekt-gradle-plugin:$detektVersion") implementation("com.google.protobuf:protobuf-gradle-plugin:$protobufPluginVersion") implementation("org.jetbrains.dokka:dokka-gradle-plugin:${dokkaVersion}") implementation("org.jetbrains.dokka:dokka-base:${dokkaVersion}") diff --git a/buildSrc/src/main/kotlin/Dependencies.kt b/buildSrc/src/main/kotlin/Dependencies.kt new file mode 100644 index 00000000000..9a13e7feffa --- /dev/null +++ b/buildSrc/src/main/kotlin/Dependencies.kt @@ -0,0 +1,60 @@ +/* +* Copyright 2022, TeamDev. All rights reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Redistribution and use in source and/or binary forms, with or without +* modification, must retain the above copyright notice and the following +* disclaimer. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +@file:Suppress("unused", "UnusedReceiverParameter") + +import io.spine.internal.dependency.ErrorProne +import io.spine.internal.dependency.GradleDoctor +import io.spine.internal.dependency.Protobuf +import io.spine.internal.dependency.Spine +import io.spine.internal.dependency.Spine.ProtoData +import org.gradle.plugin.use.PluginDependenciesSpec + +/** + * Allows to escape a fully qualified names for dependencies which cannot be used + * under `plugins` section because `io` is a value declared in + * `org.gradle.kotlin.dsl.PluginAccessors.kt`. + * + * We still want to keep versions numbers in [io.spine.internal.dependency.Spine] + * for the time being. So this file allows to reference those without resorting + * to using strings again. + */ +private const val ABOUT = "" + +val PluginDependenciesSpec.protoData: ProtoData + get() = ProtoData + +val PluginDependenciesSpec.errorPronePlugin: String + get() = ErrorProne.GradlePlugin.id + +val PluginDependenciesSpec.protobufPlugin: String + get() = Protobuf.GradlePlugin.id + +val PluginDependenciesSpec.gradleDoctor: GradleDoctor + get() = GradleDoctor + +val PluginDependenciesSpec.mcJava: Spine.McJava + get() = Spine.McJava diff --git a/buildSrc/src/main/kotlin/deps-between-tasks.kt b/buildSrc/src/main/kotlin/TaskDependencies.kt similarity index 100% rename from buildSrc/src/main/kotlin/deps-between-tasks.kt rename to buildSrc/src/main/kotlin/TaskDependencies.kt diff --git a/buildSrc/src/main/kotlin/config-tester.gradle.kts b/buildSrc/src/main/kotlin/config-tester.gradle.kts new file mode 100644 index 00000000000..8095691f19f --- /dev/null +++ b/buildSrc/src/main/kotlin/config-tester.gradle.kts @@ -0,0 +1,57 @@ +/* + * Copyright 2022, TeamDev. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Redistribution and use in source and/or binary forms, with or without + * modification, must retain the above copyright notice and the following + * disclaimer. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +import io.spine.internal.gradle.ConfigTester +import io.spine.internal.gradle.SpineRepos +import io.spine.internal.gradle.cleanFolder +import java.nio.file.Path +import java.nio.file.Paths + +// A reference to `config` to use along with the `ConfigTester`. +val config: Path = Paths.get("./") + +// A temp folder to use to check out the sources of other repositories with the `ConfigTester`. +val tempFolder = File("./tmp") + +// Creates a Gradle task which checks out and builds the selected Spine repositories +// with the local version of `config` and `config/buildSrc`. +ConfigTester(config, tasks, tempFolder) + .addRepo(SpineRepos.baseTypes) // Builds `base-types` at `master`. + .addRepo(SpineRepos.base) // Builds `base` at `master`. + .addRepo(SpineRepos.coreJava) // Builds `core-java` at `master`. + + // This is how one builds a specific branch of some repository: + // .addRepo(SpineRepos.coreJava, Branch("grpc-concurrency-fixes")) + + // Register the produced task under the selected name to invoke manually upon need. + .registerUnder("buildDependants") + +// Cleans the temp folder used to check out the sources from Git. +tasks.register("clean") { + doLast { + cleanFolder(tempFolder) + } +} diff --git a/buildSrc/src/main/kotlin/detekt-code-analysis.gradle.kts b/buildSrc/src/main/kotlin/detekt-code-analysis.gradle.kts new file mode 100644 index 00000000000..e38b8d6da8f --- /dev/null +++ b/buildSrc/src/main/kotlin/detekt-code-analysis.gradle.kts @@ -0,0 +1,84 @@ +/* + * Copyright 2022, TeamDev. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Redistribution and use in source and/or binary forms, with or without + * modification, must retain the above copyright notice and the following + * disclaimer. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +import io.gitlab.arturbosch.detekt.Detekt + +/** + * This script-plugin sets up Kotlin code analyzing with Detekt. + * + * After applying, Detekt is configured to use `${rootDir}/config/quality/detekt-config.yml` file. + * Projects can append their own config files to override some parts of the default one or drop + * it at all in a favor of their own one. + * + * An example of appending a custom config file to the default one: + * + * ``` + * detekt { + * config.from("config/detekt-custom-config.yml") + * } + * ``` + * + * To totally substitute it, just overwrite the corresponding property: + * + * ``` + * detekt { + * config = files("config/detekt-custom-config.yml") + * } + * ``` + * + * Also, it's possible to suppress Detekt findings using [baseline](https://detekt.dev/docs/introduction/baseline/) + * file instead of suppressions in source code. + * + * An example of passing a baseline file: + * + * ``` + * detekt { + * baseline = file("config/detekt-baseline.yml") + * } + * ``` + */ +private val about = "" + +plugins { + id("io.gitlab.arturbosch.detekt") +} + +detekt { + buildUponDefaultConfig = true + config = files("${rootDir}/config/quality/detekt-config.yml") +} + +tasks { + withType().configureEach { + reports { + html.required.set(true) // Only HTML report is generated. + xml.required.set(false) + txt.required.set(false) + sarif.required.set(false) + md.required.set(false) + } + } +} diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/GradleDoctor.kt b/buildSrc/src/main/kotlin/io/spine/internal/dependency/GradleDoctor.kt new file mode 100644 index 00000000000..ecd685ca329 --- /dev/null +++ b/buildSrc/src/main/kotlin/io/spine/internal/dependency/GradleDoctor.kt @@ -0,0 +1,37 @@ +/* + * Copyright 2022, TeamDev. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Redistribution and use in source and/or binary forms, with or without + * modification, must retain the above copyright notice and the following + * disclaimer. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package io.spine.internal.dependency + +/** + * Helps optimize Gradle Builds by ensuring recommendations at build time. + * + * See [plugin site](https://runningcode.github.io/gradle-doctor) for features and usage. + */ +object GradleDoctor { + const val version = "0.8.1" + const val pluginId = "com.osacky.doctor" +} diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Jackson.kt b/buildSrc/src/main/kotlin/io/spine/internal/dependency/Jackson.kt index c515aebc1bc..2ed3df8a01c 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Jackson.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/dependency/Jackson.kt @@ -26,7 +26,6 @@ package io.spine.internal.dependency - @Suppress("unused") object Jackson { const val version = "2.13.4" diff --git a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Spine.kt b/buildSrc/src/main/kotlin/io/spine/internal/dependency/Spine.kt index 9fa2f56558e..196386b2212 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/dependency/Spine.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/dependency/Spine.kt @@ -61,7 +61,7 @@ class Spine(p: ExtensionAware) { * * @see [ProtoData] */ - const val protoData = "0.2.21" + const val protoData = "0.3.0" /** * The default version of `base` to use. @@ -85,7 +85,7 @@ class Spine(p: ExtensionAware) { /** * The version of `mc-java` to use. */ - const val mcJava = "2.0.0-SNAPSHOT.104" + const val mcJava = "2.0.0-SNAPSHOT.105" /** * The version of `base-types` to use. @@ -115,7 +115,7 @@ class Spine(p: ExtensionAware) { * The version of `validation` to use. * @see [Spine.validation] */ - const val validation = "2.0.0-SNAPSHOT.33" + const val validation = "2.0.0-SNAPSHOT.50" /** * The version of Javadoc Tools to use. @@ -150,8 +150,25 @@ class Spine(p: ExtensionAware) { val pluginBase = "$toolsGroup:spine-plugin-base:${p.toolBaseVersion}" val pluginTestlib = "$toolsGroup:spine-plugin-testlib:${p.toolBaseVersion}" val modelCompiler = "$toolsGroup:spine-model-compiler:${p.mcVersion}" + + /** + * Coordinates of the McJava plugin bundle which uses version of the bundle + * from [ExtensionAware.mcJavaVersion] property. + * + * This property and [ExtensionAware.mcJavaVersion] are deprecated because + * we discourage using versions of Spine components outside of this dependency + * object class. + */ + @Deprecated(message = "Please use `McJava.pluginLib` instead") + @Suppress("DEPRECATION") val mcJavaPlugin = "$toolsGroup:spine-mc-java-plugins:${p.mcJavaVersion}:all" + object McJava { + const val version = DefaultVersion.mcJava + const val pluginId = "io.spine.mc-java" + const val pluginLib = "$toolsGroup:spine-mc-java-plugins:${version}:all" + } + /** * Does not allow re-definition via a project property. * Please change [DefaultVersion.javadocTools]. ˚ @@ -182,6 +199,7 @@ class Spine(p: ExtensionAware) { private val ExtensionAware.mcVersion: String get() = "mcVersion".asExtra(this, DefaultVersion.mc) + @Deprecated(message = "Please use `Spine.McJava` dependency object instead.") private val ExtensionAware.mcJavaVersion: String get() = "mcJavaVersion".asExtra(this, DefaultVersion.mcJava) @@ -216,6 +234,8 @@ class Spine(p: ExtensionAware) { const val version = protoDataVersion const val compiler = "$group:protodata-compiler:$version" + const val codegenJava = "io.spine.protodata:protodata-codegen-java:$version" + const val pluginId = "io.spine.protodata" const val pluginLib = "${Spine.group}:protodata:$version" } diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/Repositories.kt b/buildSrc/src/main/kotlin/io/spine/internal/gradle/Repositories.kt index a9f08773e60..ab23edf12a8 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/Repositories.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/gradle/Repositories.kt @@ -204,9 +204,6 @@ fun RepositoryHandler.applyGitHubPackages(project: Project, vararg shortReposito @Suppress("unused") fun RepositoryHandler.applyStandard() { - gradlePluginPortal() - mavenLocal() - val spineRepos = listOf( Repos.spine, Repos.spineSnapshots, @@ -223,10 +220,13 @@ fun RepositoryHandler.applyStandard() { } } - mavenCentral() maven { url = URI(Repos.sonatypeSnapshots) } + + mavenCentral() + gradlePluginPortal() + mavenLocal().includeSpineOnly() } /** diff --git a/buildSrc/src/main/kotlin/io/spine/internal/gradle/javac/ErrorProne.kt b/buildSrc/src/main/kotlin/io/spine/internal/gradle/javac/ErrorProne.kt index 7a97cab7cdc..df31e581a7f 100644 --- a/buildSrc/src/main/kotlin/io/spine/internal/gradle/javac/ErrorProne.kt +++ b/buildSrc/src/main/kotlin/io/spine/internal/gradle/javac/ErrorProne.kt @@ -82,7 +82,6 @@ private object ErrorProneConfig { "-Xep:CheckReturnValue:OFF", "-Xep:FloggerSplitLogStatement:OFF", - "-Xep:FloggerLogString:OFF" ) } } diff --git a/config b/config index cf8b3e29eef..92feb03e92b 160000 --- a/config +++ b/config @@ -1 +1 @@ -Subproject commit cf8b3e29eefde32b9f97eda72c7760e121eaeafe +Subproject commit 92feb03e92b7965b0e522e88c0d62e861bef5822 diff --git a/gradle.properties b/gradle.properties index 4c1c2c42614..a4ba1dcd8a1 100644 --- a/gradle.properties +++ b/gradle.properties @@ -24,5 +24,5 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # -# Dokka plugin eats more memory than usual. Therefore all builds should have enough. -org.gradle.jvmargs=-Xmx4096m -XX:MaxMetaspaceSize=1024m +# Dokka plugin eats more memory than usual. Therefore, all builds should have enough. +org.gradle.jvmargs=-Xmx4096m -XX:MaxMetaspaceSize=1024m -XX:+UseParallelGC diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 249e5832f09..943f0cbfa75 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 0b4bf16a2c6..52f73a8d26a 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions-snapshots/gradle-7.6-20220930142900+0000-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-rc-1-bin.zip +networkTimeout=10000 zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index a69d9cb6c20..65dcd68d65c 100755 --- a/gradlew +++ b/gradlew @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -80,10 +80,10 @@ do esac done -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" +# This is normally unused +# shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' @@ -143,12 +143,16 @@ fi if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) + # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac case $MAX_FD in #( '' | soft) :;; #( *) + # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac diff --git a/gradlew.bat b/gradlew.bat index f127cfd49d4..93e3f59f135 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -26,6 +26,7 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME%