{"id":31055318,"url":"https://github.com/jwharm/flatpak-gradle-generator","last_synced_at":"2026-01-18T01:01:24.265Z","repository":{"id":193671018,"uuid":"689278736","full_name":"jwharm/flatpak-gradle-generator","owner":"jwharm","description":"A Gradle plugin to generate a sources file for offline Flatpak builds","archived":false,"fork":false,"pushed_at":"2026-01-14T16:58:24.000Z","size":413,"stargazers_count":11,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-14T19:57:56.055Z","etag":null,"topics":["flatpak","flatpak-builder","gradle"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-2.1","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jwharm.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-09-09T10:06:21.000Z","updated_at":"2026-01-14T16:58:28.000Z","dependencies_parsed_at":"2023-10-11T19:29:15.244Z","dependency_job_id":"29f9704c-31c9-401b-8da8-76d73df9298c","html_url":"https://github.com/jwharm/flatpak-gradle-generator","commit_stats":null,"previous_names":["jwharm/sources-list-plugin"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/jwharm/flatpak-gradle-generator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwharm%2Fflatpak-gradle-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwharm%2Fflatpak-gradle-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwharm%2Fflatpak-gradle-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwharm%2Fflatpak-gradle-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jwharm","download_url":"https://codeload.github.com/jwharm/flatpak-gradle-generator/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwharm%2Fflatpak-gradle-generator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28525422,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-18T00:39:45.795Z","status":"ssl_error","status_checked_at":"2026-01-18T00:39:39.467Z","response_time":85,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["flatpak","flatpak-builder","gradle"],"created_at":"2025-09-15T04:43:36.590Z","updated_at":"2026-01-18T01:01:24.215Z","avatar_url":"https://github.com/jwharm.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# flatpak-gradle-generator\nA Gradle plugin to generate a sources file for offline Flatpak builds.\n\nThe plugin will output all direct and transitive dependencies for all build \nconfigurations (including plugin dependencies) in a JSON file. The JSON file \ncan be used in a Flatpak build process to download Maven dependencies before \nan offline build starts. The downloaded files will be stored in a local Maven \nrepository layout.\n\nExample `gradle.build`:\n\n```groovy\nplugins {\n  id 'application'\n  id 'io.github.jwharm.flatpak-gradle-generator' version '1.6.0'\n}\n\nrepositories {\n  mavenCentral()\n  maven { url './offline-repository' }\n}\n\ndependencies {\n  // a random dependency for this example\n  implementation 'io.github.jwharm.javagi:adw:0.7.1'\n}\n\ntasks.flatpakGradleGenerator {\n  outputFile = file('flatpak-sources.json')\n  downloadDirectory = './offline-repository'\n}\n```\n\nRun `./gradlew flatpakGradleGenerator --no-configuration-cache` and it will\nwrite a json file with information about the dependencies:\n\n```\n[\n  {\n    \"type\": \"file\",\n    \"url\": \"https://repo.maven.apache.org/maven2/io/github/jwharm/javagi/adw/0.7.1/adw-0.7.1.module\",\n    \"sha512\": \"d265d970864b3fb4c97b0fe87030ba76eafb252531d9da37cd7a51296b32e95bb70154f0075f6a0d0bc1e41fbd7f23280bdc6b317a1d5808c5a0c4b3a5ac70b5\",\n    \"dest\": \"./offline-repository/io/github/jwharm/javagi/adw/0.7.1\",\n    \"dest-filename\": \"adw-0.7.1.module\"\n  },\n  {\n    \"type\": \"file\",\n    \"url\": \"https://repo.maven.apache.org/maven2/io/github/jwharm/javagi/adw/0.7.1/adw-0.7.1.jar\",\n    \"sha512\": \"356a1c8f8ae89d7212bdfccd9afcd607ae86301485dd850d11eb378cbfe6f05f00cee27be368f907b0b941a065564f7ca3fb7ee18b21f4aaf8bec4d4176ba65a\",\n    \"dest\": \"./offline-repository/io/github/jwharm/javagi/adw/0.7.1\",\n    \"dest-filename\": \"adw-0.7.1.jar\"\n  },\n  ...etc...\n```\n\nAdd the JSON filename to the `sources` list in your Flatpak manifest, and \nflatpak-builder will automatically download all dependencies into the offline \nMaven repository folder.\n\n### Include and exclude configurations\nSpecific configurations can be included and excluded with the\n`includeConfiguration` and `excludeConfiguration` options (the latter\noverrides the former). For example, to exclude test dependencies:\n\n```groovy\ntasks.flatpakGradleGenerator {\n    outputFile = file('flatpak-sources.json')\n    excludeConfigurations = [\n            'testCompileClasspath',\n            'testRuntimeClasspath'\n    ]\n}\n```\n\n### Configuration cache\nThe `flatpakGradleGenerator` task is incompatible with the Gradle Configuration\nCache, so it needs to be run with the `--no-configuration-cache` command-line\nargument. \n\nYou can still use the Configuration Cache for other tasks in your project.\n\n### Modular builds\nBecause a task from one Gradle project [is not allowed](https://docs.gradle.org/current/userguide/viewing_debugging_dependencies.html#sub:resolving-unsafe-configuration-resolution-errors)\nto directly resolve a configuration in another project, the plugin is limited\nto the project context in which the `flatpakGradleGenerator` task is declared.\n\nIn a modular Gradle build, you can add a `tasks.flatpakGradleGenerator {}` \nblock in the build files of the subprojects, to generate separate files for \neach project.\n\n### Architecture-specific sources\nFlatpak expects an `\"only-arches\"` identifier for architecture-specific\nsources. Most Java libraries are architecture-independent, but some, like\nJavaFX, contain different artifacts depending on the runtime platform. As far\nas I know, it is not possible to automatically recognize these in Gradle.\nHowever, as a workaround, we can generate json files with the `\"only-arches\"`\nfield with a fixed value (set as a plugin task parameter) to all entries in the\ngenerated sources list.\n\nTo do this, run the `flatpakGradleGenerator` task on each platform with the\n`\"onlyArches\"` parameter on the task set to a correct value such as `\"x86_64\"`,\nto produce multiple files that explicitly only support one specific platform,\nand then add all of those files as sources in the Flatpak manifest. Of course,\na majority of the dependencies will end up being the same in all generated\nfiles, but they will be downloaded only once by `flatpak-builder`.\n\nCheck out the [`javafx` testcase](plugin/src/test/resources/javafx) for an\nexample on how to use the `\"onlyArches\"` parameter.\n\n### Compatibility\nThe plugin has been tested with Gradle 8.13 and 9.2.1. The published jar is\nbuilt with Java 17.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjwharm%2Fflatpak-gradle-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjwharm%2Fflatpak-gradle-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjwharm%2Fflatpak-gradle-generator/lists"}