{"id":21726962,"url":"https://github.com/wttech/gradle-common-plugin","last_synced_at":"2025-07-11T10:41:58.678Z","repository":{"id":43118142,"uuid":"237183159","full_name":"wttech/gradle-common-plugin","owner":"wttech","description":"Provides generic purpose Gradle utilities like: file transfer (upload/download) via SMB/SFTP/HTTP, file watcher, asynchronous progress logger, GUI notification service","archived":false,"fork":false,"pushed_at":"2023-07-05T16:37:41.000Z","size":533,"stargazers_count":4,"open_issues_count":12,"forks_count":2,"subscribers_count":9,"default_branch":"main","last_synced_at":"2025-04-12T23:33:45.457Z","etag":null,"topics":["async-process","file-download","file-upload","gradle","gradle-plugin","gui-notification-service","http-client","progress-indicator","sftp-client","smb-client"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wttech.png","metadata":{"files":{"readme":"README.MD","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-01-30T09:49:53.000Z","updated_at":"2022-10-26T10:32:51.000Z","dependencies_parsed_at":"2023-01-21T12:28:03.752Z","dependency_job_id":null,"html_url":"https://github.com/wttech/gradle-common-plugin","commit_stats":null,"previous_names":[],"tags_count":117,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wttech%2Fgradle-common-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wttech%2Fgradle-common-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wttech%2Fgradle-common-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wttech%2Fgradle-common-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wttech","download_url":"https://codeload.github.com/wttech/gradle-common-plugin/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248647259,"owners_count":21139081,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["async-process","file-download","file-upload","gradle","gradle-plugin","gui-notification-service","http-client","progress-indicator","sftp-client","smb-client"],"created_at":"2024-11-26T03:42:28.026Z","updated_at":"2025-04-12T23:33:53.968Z","avatar_url":"https://github.com/wttech.png","language":"Kotlin","readme":"[![WTT logo](docs/wtt-logo.png)](https://www.wundermanthompson.com)\n\n[![Gradle Status](https://gradleupdate.appspot.com/wttech/gradle-common-plugin/status.svg)](https://gradleupdate.appspot.com/wtt/gradle-common-plugin/status)\n[![Apache License, Version 2.0, January 2004](docs/apache-license-badge.svg)](http://www.apache.org/licenses/)\n\n# Gradle Common Plugin\n\n  * [About](#about)\n  * [Setup](#setup)\n  * [Usage](#usage)\n  * [Configuration](#configuration)\n  * [License](#license)\n\n## About\n\nProvides generic purpose Gradle utilities like: \n\n* File transfer (upload/download) via SMB/SFTP/HTTP,\n* File watcher,\n* Asynchronous progress logger,\n* GUI notification service,\n* Health checking service,\n* Java toolchains service.\n\nAll above exposed as `common` [extension](src/main/kotlin/com/cognifide/gradle/common/CommonExtension.kt) to your build scripts to be consumed by your own Gradle tasks.\n\n## Setup\n\nAs of plugin is published at official Gradle Plugin Portal, see instructions from [there](https://plugins.gradle.org/plugin/com.cognifide.common).\n\n## Usage\n\nUse common extension to implement any custom Gradle task with improved UX:\n\n```kotlin\ntasks {\n    register(\"transferFile\") {\n        doLast {\n            common {\n                // download file using unified file resolver with interactive progress logger\n                val mavenFile = resolveFile(\"some-group:some-package:1.0.0@zip\") // Maven coordinates / Gradle dependency notation\n                val urlFile = resolveFile(\"sftp://my-file-storage.com/some/path/my-file.zip\") // some HTTP/SMB/SFTP URL\n    \n                // upload file using interactive progress logger\n                fileTransfer.upload(\"smb://other-file-storage/other/path\", mavenFile)\n                fileTransfer.upload(\"sftp://yet-another-file-storage.com/other/path\", urlFile)\n    \n                notifier.info(\"Files transferred successfully!\")\n            }\n        }       \n    }\n\n    register(\"calculateNums\") {\n        doLast {\n            common {\n                // user input service is not available in public Gradle API however plugin is exposing it\n                if (userInput.askYesNoQuestion(\"Calc in parallel?\")) { \n                    val nums = listOf(1, 2, 3)\n        \n                    // do tasks in parallel using coroutines with interactive, async progress logger\n                    progress(nums.size) {\n                        parallel.each(nums) { num -\u003e\n                            increment(\"Calculating for '$num'\")\n                                waitFor(5000) // heavy calculation here\n                            }   \n                        }\n                    }   \n                }\n            \n                // this will freeze task a little bit but with showing nice countdown timer\n                progressCountdown(3_000)\n    \n                notifier.info(\"Calculated successfully!\")\n            }\n        }       \n    }\n}\n```\n\n## Configuration\n\nIllustrative example:\n\n```kotlin\ncommon {\n   fileTransfer {\n\n        // default values for all protocols\n\n        user.set(prop.string(\"fileTransfer.user\"))\n        password.set(prop.string(\"fileTransfer.password\"))\n        domain.set(prop.string(\"fileTransfer.domain\"))\n\n        // protocol specific credentials\n\n        sftp {\n            user.set(prop.string(\"fileTransfer.sftp.user\"))\n            password.set(prop.string(\"fileTransfer.sftp.password\"))\n        }\n        smb {\n            user.set(prop.string(\"fileTransfer.smb.user\"))\n            password.set(prop.string(\"fileTransfer.smb.password\"))\n            domain.set(prop.string(\"fileTransfer.smb.domain\"))\n        }\n        http {\n            client {\n                basicUser.set(prop.string(\"fileTransfer.http.user\"))\n                basicPassword.set(prop.string(\"fileTransfer.http.password\"))\n            }\n        }\n    }\n    notifier {\n        enabled.set(prop.boolean(\"notifier.enabled\"))\n    }\n}\n```\n\n## License\n\n**Gradle Common Plugin** is licensed under the [Apache License, Version 2.0 (the \"License\")](https://www.apache.org/licenses/LICENSE-2.0.txt)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwttech%2Fgradle-common-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwttech%2Fgradle-common-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwttech%2Fgradle-common-plugin/lists"}