Skip to content

gradle issues on windows and org.gradle.unsafe.configuration-cache incompatibility #2344

Open
@crowne

Description

@crowne

Have you read a contributing guide?

  • I have read CONTRIBUTING.md
  • I have searched the existing issues and didn't find any that were similar
  • I have considered creating a pull request with fixes instead of a bug report and want to proceed

Current Behavior

The build.gradle file doesn't work on windows, firstly because there is a *nix specifc shell command used in the task installGitHooks. Secondly because of task incompatibility with org.gradle.unsafe.configuration-cache

I have modified the build.gradle and will be submitting a PR which will make ./gradlew usable for this project from a windows command line, preferably powershell 7 (pwsh.exe) or else powershell 5 (powershell.exe)

./gradlew tasks
Configuration on demand is an incubating feature.
Calculating task graph as no cached configuration is available for tasks: tasks

FAILURE: Build failed with an exception.

* Where:
Settings file 'C:\github\crowne\anytype-kotlin\settings.gradle' line: 22

* What went wrong:
A problem occurred evaluating settings 'anytype-kotlin'.
> C:\github\crowne\anytype-kotlin\github.properties (The system cannot find the file specified)

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.

BUILD FAILED in 834ms
Configuration cache entry stored.

Expected Behavior

./gradlew tasks
should print the list of tasks defined for the project

./gradlew tasks
Configuration on demand is an incubating feature.
Calculating task graph as no cached configuration is available for tasks: tasks

> Configure project :analytics
WARNING: The option setting 'android.defaults.buildfeatures.buildconfig=true' is deprecated.
The current default is 'false'.
It will be removed in version 10.0 of the Android Gradle plugin.
To keep using this feature, add the following to your module-level build.gradle files:
    android.buildFeatures.buildConfig = true
or from Android Studio, click: `Refactor` > `Migrate BuildConfig to Gradle Build Files`.

> Task :tasks

------------------------------------------------------------
Tasks runnable from root project 'anytype-kotlin'
------------------------------------------------------------

Android tasks
-------------
androidDependencies - Displays the Android dependencies of the project.
signingReport - Displays the signing info for the base and test modules
sourceSets - Prints out all the source sets defined in this project.

Build tasks
-----------
assemble - Assemble main outputs for all the variants.
assembleAndroidTest - Assembles all the Test applications.
assembleUnitTest - Assembles all the unit test applications.
build - Assembles and tests this project.
buildDependents - Assembles and tests this project and all projects that depend on it.
buildKotlinToolingMetadata - Build metadata json file containing information about the used Kotlin tooling
buildNeeded - Assembles and tests this project and all projects it depends on.
bundle - Assemble bundles for all the variants.
classes - Assembles main classes.
clean - Deletes the build directory.
compileDebugAndroidTestSources
compileDebugSources
compileDebugUnitTestSources
compileReleaseSources
compileReleaseUnitTestSources
debugSourcesJar - Assembles a jar archive containing the sources of target 'debug'.
extractDebugAnnotations - Extracts Android annotations for the debug variant into the archive file
extractReleaseAnnotations - Extracts Android annotations for the release variant into the archive file
jar - Assembles a jar archive containing the classes of the 'main' feature.
kotlinSourcesJar - Assembles a jar archive containing the sources of target 'kotlin'.
releaseSourcesJar - Assembles a jar archive containing the sources of target 'release'.
testClasses - Assembles test classes.

Build Setup tasks
-----------------
init - Initializes a new Gradle build.
installGitHooks - Install local repository git hooks
updateDaemonJvm - Generates or updates the Gradle Daemon JVM criteria.
wrapper - Generates Gradle wrapper files.

Documentation tasks
-------------------
dokkaGfm - Generates documentation in GitHub flavored markdown format
dokkaGfmPartial - Generates documentation in GitHub flavored markdown format
dokkaHtml - Generates documentation in 'html' format
dokkaHtmlPartial - Generates documentation in 'html' format
dokkaJavadoc - Generates documentation in 'javadoc' format
dokkaJavadocPartial - Generates documentation in 'javadoc' format
dokkaJekyll - Generates documentation in Jekyll flavored markdown format
dokkaJekyllPartial - Generates documentation in Jekyll flavored markdown format
javadoc - Generates Javadoc API documentation for the 'main' feature.

Help tasks
----------
buildEnvironment - Displays all buildscript dependencies declared in root project 'anytype-kotlin'.
dependencies - Displays all dependencies declared in root project 'anytype-kotlin'.
dependencyInsight - Displays the insight into a specific dependency in root project 'anytype-kotlin'.
help - Displays a help message.
javaToolchains - Displays the detected java toolchains.
outgoingVariants - Displays the outgoing variants of root project 'anytype-kotlin'.
projects - Displays the sub-projects of root project 'anytype-kotlin'.
properties - Displays the properties of root project 'anytype-kotlin'.
resolvableConfigurations - Displays the configurations that can be resolved in root project 'anytype-kotlin'.
tasks - Displays the tasks runnable from root project 'anytype-kotlin' (some of the displayed tasks may belong to subprojects).

Install tasks
-------------
installDebug - Installs the Debug build.
installDebugAndroidTest - Installs the android (on device) tests for the Debug build.
installRelease - Installs the Release build.
uninstallAll - Uninstall all applications.
uninstallDebug - Uninstalls the Debug build.
uninstallDebugAndroidTest - Uninstalls the android (on device) tests for the Debug build.
uninstallRelease - Uninstalls the Release build.

Publishing tasks
----------------
generateMetadataFileForMyLocalPublicationPublication - Generates the Gradle metadata file for publication 'myLocalPublication'.
generatePomFileForMyLocalPublicationPublication - Generates the Maven POM file for publication 'myLocalPublication'.
publish - Publishes all publications produced by this project.
publishMyLocalPublicationPublicationToMavenLocal - Publishes Maven publication 'myLocalPublication' to the local Maven repository.
publishToMavenLocal - Publishes all Maven publications produced by this project to the local Maven cache.

Verification tasks
------------------
check - Runs all checks.
checkJetifier - Checks whether Jetifier is needed for the current project
checkKotlinGradlePluginConfigurationErrors - Checks that Kotlin Gradle Plugin hasn't reported project configuration errors, failing otherwise. This task always runs before compileKotlin* or similar tasks.
connectedAndroidTest - Installs and runs instrumentation tests for all flavors on connected devices.
connectedCheck - Runs all device checks on currently connected devices.
connectedDebugAndroidTest - Installs and runs the tests for debug on connected devices.
deviceAndroidTest - Installs and runs instrumentation tests using all Device Providers.
deviceCheck - Runs all device checks using Device Providers and Test Servers.
lint - Runs lint on the default variant.
lintDebug - Print text output from the corresponding lint report task
lintFix - Runs lint on the default variant and applies any safe suggestions to the source code.
lintRelease - Print text output from the corresponding lint report task
test - Run unit tests for all variants.
testDebugUnitTest - Run unit tests for the debug build.
testReleaseUnitTest - Run unit tests for the release build.
updateLintBaseline - Updates the lint baseline using the default variant.

Wire tasks
----------
generateDebugProtos - Generate protobuf implementation for debug
generateProtos - Aggregation task which runs every generation task for every given source
generateReleaseProtos - Generate protobuf implementation for release

To see all tasks and more detail, run gradlew tasks --all

To see more detail about a task, run gradlew help --task <task>

BUILD SUCCESSFUL in 8s
1 actionable task: 1 executed
Configuration cache entry stored.

Steps To Reproduce

  1. open a powershell terminal on windows
  2. clone the repository
  3. cd into the project dir
  4. run ./gradlew tasks

Environment

- OS: Windows
- Version: Windows 10 10.0 amd64


./gradlew --version

------------------------------------------------------------
Gradle 8.10.2
------------------------------------------------------------

Build time:    2024-09-23 21:28:39 UTC
Revision:      415adb9e06a516c44b391edff552fd42139443f7

Kotlin:        1.9.24
Groovy:        3.0.22
Ant:           Apache Ant(TM) version 1.10.14 compiled on August 16 2023
Launcher JVM:  23.0.2 (Oracle Corporation 23.0.2+7-58)
Daemon JVM:    C:\util\java\jdk-23.0.2 (no JDK specified, using current Java home)
OS:            Windows 10 10.0 amd64

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions