{"id":20114068,"url":"https://github.com/davidb/gradle-getdown-plugin","last_synced_at":"2025-05-06T12:30:56.159Z","repository":{"id":21081853,"uuid":"24381626","full_name":"davidB/gradle-getdown-plugin","owner":"davidB","description":"A gradle plugin to bundle java app + jre with getdown support","archived":false,"fork":false,"pushed_at":"2018-12-27T07:41:56.000Z","size":82,"stargazers_count":16,"open_issues_count":12,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-09T12:22:12.575Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Groovy","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc0-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/davidB.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-09-23T17:21:31.000Z","updated_at":"2024-07-25T03:32:59.000Z","dependencies_parsed_at":"2022-09-14T13:52:59.730Z","dependency_job_id":null,"html_url":"https://github.com/davidB/gradle-getdown-plugin","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidB%2Fgradle-getdown-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidB%2Fgradle-getdown-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidB%2Fgradle-getdown-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidB%2Fgradle-getdown-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/davidB","download_url":"https://codeload.github.com/davidB/gradle-getdown-plugin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252683424,"owners_count":21788037,"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":[],"created_at":"2024-11-13T18:27:59.161Z","updated_at":"2025-05-06T12:30:55.940Z","avatar_url":"https://github.com/davidB.png","language":"Groovy","funding_links":[],"categories":[],"sub_categories":[],"readme":"A gradle plugin to bundle java app + jre with getdown support.\n\nNOTE: *it's my first groovy project and my first gradle plugin, so any advices are welcome*\n\n# Sample Project\n\ninto `build.gradle`\n\n```gradle\nbuildscript {\n  repositories {\n    jcenter()\n  }\n  dependencies {\n    classpath \"net.alchim31.gradle:gradle-getdown-plugin:0.4.+\"\n  }\n}\n\napply plugin: 'net.alchim31.getdown'\n\n...\n\ngetdown {\n\turlbase = \"http://mysite.com/myapp/\"\n\tmainClassName = 'mypackage.Main'\n\ttmplGetdownTxt = tmplGetdownTxt + '\\nallow_offline = true'\n}\n```\n\nsample output after `gradle clean bundles` :\n\n```shell\nbuild/getdown\n├── app\n│   ├── digest.txt\n│   ├── favicon.ico\n│   ├── getdown-1.4.jar\n│   ├── getdown.txt\n│   └── lib\n|       └── *.jar\n├── bundles\n│   ├── jme3_skel-\u003cbundle_version\u003e-linux-i586.tgz\n│   ├── jme3_skel-\u003cbundle_version\u003e-linux-x64.tgz\n│   ├── jme3_skel-\u003cbundle_version\u003e-windows-i586.zip\n│   └── jme3_skel-\u003cbundle_version\u003e.tgz\n├── jres\n│   ├── jre-1.8.0.20-linux-i586.jar\n│   ├── jre-1.8.0.20-linux-x64.jar\n│   └── jre-1.8.0.20-windows-i586.jar\n├── latest-getdown.txt\n├── launch\n└── launch.exe\n```\n\nThis result can be upload to the urlbase :\n\n* **on remote server rename 'app' dir to \u003cbundle_version\u003e long number**\n* user can download bundles to run the app, it should not require additionnal download if up-to-date\n* previous user will be updated\n\nThis result can be tested by :\n\n* running launch or launch.exe\n* by extracting a bundle somewhere and run launch or launch.exe\n\nA sample application can be browse at https://github.com/davidB/jme3_skel\n\n# Configurations\n\nsee [GetdownPluginExtension](src/main/groovy/bundles/GetdownPluginExtension.groovy) for more info about initialization, and uptodate info.\n\n```groovy\n\t/** application title, used for display name (default : project.name)*/\n\tString title\n\n\t/** url of the place where content of cfg.dest is deployed (getdown's appbase == ${urlbase}/%VERSION%)*/\n\tString urlbase\n\n\t/** app version as long (default : timestamp 'yyyyMMddHHmm' as long) should always increase (use by getdown)*/\n\tlong version\n\n\t/**\n\t * if checklatest == true\n\t * then 'latest = ${cfg.urlbase}/app/getdown.txt'\n\t * else lastest is not include in getdown.txt, so local bundle is not overriden by content of remote http server.\n\t * (default : false to allow to run local version without need or overwrite from remote server)\n\t */\n\tboolean checklatest = false\n\n\t/** directory where to generate getdown 'website' (default : \"${project.buildDir}/getdown\") */\n\tFile dest\n\n\t/** directory where to place the application (default : \"${cfg.dest}/app\") */\n\tFile destApp\n\n\t//TODO store a hashtable (pre-configured) that will be used as source to generate getdown.txt\n\t/** The template used to generate getdown.txt */\n\tString tmplGetdownTxt\n\n\t/** The template used to generate launch (unix launcher script) */\n\tString tmplScriptUnix\n\n\t/** The template used to generate launch.vbs (windows launcher script if launch4j not available) */\n\tString tmplScriptWindows\n\n\t/**\n\t *  The path to the launch4j executable.\n\t *\n\t *  It can be set via system property 'launch4jCmd' or in ~/.gradle/gradle.properties\n\t *  \u003cpre\u003e\n\t *  # for linux\n\t *  systemProp.launch4jCmd=${System.properties['user.home']}/bin/soft/launch4j/launch4j\n\t *  # for windows (in your path use '/' or '\\\\\\\\'  ( 4x '\\' ), but not single '\\' )\n\t *  systemProp.launch4jCmd=c:/soft/launch4j/launch4j.exe\n\t *  \u003c/pre\u003e\n\t */\n\tString launch4jCmd\n\n\t/** The template used to generate the launch4j configuration */\n\tString tmplLaunch4j\n\n\t/**\n\t* jre version to deploy, also used by default getdown.txt template to define the jvm min version (default: current running java version))\n\t* type: String (eg. '1.8.0_u20-b26') or a bundles.JreVersion (eg. new bundles.JreVersion(1,8,0,20,26) )\n\t*/\n\tObject jreVersion\n\n\n\t/** the list of platform for jres and native bundles to provide */\n\tPlatform[] platforms = Platform.values()\n\n\t/** the directory where to cache downloaded + packaged jre (default $HOME/.cache */\n\tFile jreCacheDir\n\n\n\t/**\n\t* The fully qualified name of the application's main class.\n\t*/\n\tString mainClassName\n\n\t/**\n\t* Array of string arguments to pass to the JVM when running the application\n\t*/\n\tIterable\u003cString\u003e jvmArgs = []\n\n\t/**\n\t * List the available shortcuts image/icons.\n\t * The shortcuts are autodetected (and filled) by presence of src/dist/shortcut-{16,32,64,128,256}.png\n\t */\n\tIterable\u003cString\u003e shortcuts = []\n\n\t/**\n\t* \u003cp\u003eThe specification of the contents of the distribution.\u003c/p\u003e\n\t* Use this {@link org.gradle.api.file.CopySpec} to include extra files/resource in the application distribution.\n\t* \u003cpre\u003e\n\t* getdown {\n\t*   distSpec.with {\n\t*     from(\"samples\") {\n\t*       into('app')\n\t*     }\n\t*   }\n\t* }\n\t* \u003c/pre\u003e\n\t*/\n\tCopySpec distSpec\n\n```\n## Howto\n\n* How to override / force the getdown version to use (default: 1.4)?\n  ```gradle\n  dependencies {\n      getdown 'com.threerings:getdown:x.y'\n  }\n  ```\n\n* How to limit the output platform when run `gradle bundles` ?\n  ```gradle\n  import bundles.Platform\n  getdown {\n    platforms = [Platform.LINUX_I586, Platform.LINUX_X64, Platform.WINDOWS_I586] //Platform.values()\n  }\n  ```\n\n* How to add my files into `app` directory without place them into `src/dist` ?\n  ```gradle\n  getdown {\n    distSpec.with {\n      from(\"samples\") {\n        into('app')\n      }\n    }\n  }\n  ```\n\n\n# Tasks\n\nEvery steps can be called via a task, to ease setup/debugging\n\n```shell\n$\u003e gradle tasks\n\n...\n\nGetdown-bundles tasks\n---------------------\nassembleApp - assemble the full app (getdown ready) into C:\\Users\\dwayne\\Documents\\GitHub\\jme3_skel\\build\\getdown\nbundle_0 - bundle the application into .tgz without jre\nbundle_linux-i586 - bundle the application into .tgz with jre for linux-i586\nbundle_linux-x64 - bundle the application into .tgz with jre for linux-x64\nbundle_windows-i586 - bundle the application into .zip with jre for windows-i586\nbundle_windows-x64 - bundle the application into .zip with jre for windows-x64\nbundles - generate all bundles\ncopyDist - copy src/dist + jres into C:\\Users\\dwayne\\Documents\\GitHub\\jme3_skel\\build\\getdown\ngetJre_linux-i586 - download + repackage jre(s) into cache dir (C:\\Users\\dwayne\\.cache\\jres) for platform linux-i586\ngetJre_linux-x64 - download + repackage jre(s) into cache dir (C:\\Users\\dwayne\\.cache\\jres) for platform linux-x64\ngetJre_windows-i586 - download + repackage jre(s) into cache dir (C:\\Users\\dwayne\\.cache\\jres) for platform windows-i586\ngetJre_windows-x64 - download + repackage jre(s) into cache dir (C:\\Users\\dwayne\\.cache\\jres) for platform windows-x64\ngetJres - download + repackage jre(s) into cache dir (C:\\Users\\dwayne\\.cache\\jres) for all platforms\nlaunch - launch the app for test\nmakeDigest - create the file digest.txt from getdown.txt + files\nmakeGetdownTxt - create the file getdown.txt\nmakeLauncherUnix - create the launcher script for unix (linux)\nmakeLauncherWindows - create the launcher for windows (create a VBS script)\n\n...\n```\n* **makeLauncherWindows** if launch4jCmd is defined generate a .exe else a .vbs script (description of task also change when launch4jCmd is defined)\n\n# Alternatives\n\n* [gradle application plugin](http://www.gradle.org/docs/current/userguide/application_plugin.html) : The Gradle application plugin extends the language plugins with common application related tasks. It allows running and bundling applications for the jvm. (but it doesn't include jvm)\n* [JavaFX packaging tools](https://docs.oracle.com/javafx/2/deployment/self-contained-packaging.htm) + [JavaFX Gradle Plugin](https://bitbucket.org/shemnon/javafx-gradle/):  This plugin will ultimately provide gradle build tasks for the JavaFX Deployment tools in the Java 7 JDK. see [tutorial](http://jaxenter.com/tutorial-a-guide-to-the-gradle-javafx-plugin-105730.html). JavaFx Deployement Tool is the most complete but it can't create cross platform bundle (only installer), it create bundle only the current platform :-( .\n* [gradle-macappbundle](https://code.google.com/p/gradle-macappbundle) : A Gradle Plugin to create a Mac OSX .app application based on the project.\n* [Packr](https://github.com/libgdx/packr/) : Packages your JAR, assets and a JVM for distribution on Windows (ZIP), Linux (ZIP) and Mac OS X (.app), adding a native executable file to make it appear like the app is a native app.\n* [AppBundler](https://github.com/joshmarinacci/AppBundler) : AppBundler is an Ant task for packaging up desktop Java apps as native executables.\n\n# TODO\n\n* more testing\n* better configuration\n* better documentation\n* see issue tracker\n\n\n\n[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/davidB/gradle-getdown-plugin/trend.png)](https://bitdeli.com/free \"Bitdeli Badge\")\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidb%2Fgradle-getdown-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavidb%2Fgradle-getdown-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidb%2Fgradle-getdown-plugin/lists"}