{"id":16895808,"url":"https://github.com/bnorm/robocode-gradle-plugin","last_synced_at":"2025-04-11T06:30:35.182Z","repository":{"id":51483949,"uuid":"325085896","full_name":"bnorm/robocode-gradle-plugin","owner":"bnorm","description":"Gradle plugin for building (and running) bots for Robocode","archived":false,"fork":false,"pushed_at":"2023-05-30T10:07:47.000Z","size":140,"stargazers_count":12,"open_issues_count":2,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-25T10:22:22.425Z","etag":null,"topics":["gradle","robocode"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bnorm.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2020-12-28T18:23:55.000Z","updated_at":"2024-06-21T11:12:52.000Z","dependencies_parsed_at":"2024-11-09T09:01:02.285Z","dependency_job_id":null,"html_url":"https://github.com/bnorm/robocode-gradle-plugin","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bnorm%2Frobocode-gradle-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bnorm%2Frobocode-gradle-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bnorm%2Frobocode-gradle-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bnorm%2Frobocode-gradle-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bnorm","download_url":"https://codeload.github.com/bnorm/robocode-gradle-plugin/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248355328,"owners_count":21089992,"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":["gradle","robocode"],"created_at":"2024-10-13T17:26:21.713Z","updated_at":"2025-04-11T06:30:34.850Z","avatar_url":"https://github.com/bnorm.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# robocode-gradle-plugin\n\n\u003e Build the best...\n\n[Gradle] plugin for building (and running) bots for [Robocode]. To use, add the\n[latest version of the plugin][com.bnorm.robocode] to a project.\n\n```kotlin\nplugins {\n    id(\"com.bnorm.robocode\") version \"0.2.0\"\n}\n```\n\nRobocode doesn't natively allow robots to depend on third-party jars, but this\nplugin uses the [Shadow] Gradle plugin to combine everything into a single jar\nto work around this problem.\n\n# Robots\n\nRobots can be configured via the plugin extension. Multiple robots can be\nconfigured if desired.\n\n```kotlin\nrobocode {\n    robots {\n        register(\"Name\") {\n            classPath = \"package.Name\"\n            version = \"1.0\"\n            description = \"Description\"\n        }\n    }\n}\n```\n\nFor each added robot, a task is added for building a jar file which can be\npublished for others to use. For example, given a robot with the name of\n`Name`, a task named `robotNameJar` will be available which outputs to \n`$buildDir/robocode/robots/Name/Name_1.0.jar`.\n\nFor robot development, a task named `robotBin` is available which outputs all\nclass files needed to run the robot via Robocode. This task can be run with\nGradle continuous mode to constantly build all robots.\n\n```shell\n$ ./gradlew robotBin --continuous\n```\n\n# Robocode\n\nA dependency on the `robocode.jar` file is automatically added to the\n`implementation` configuration by the plugin. To achieve this, the file must\nalready exist in an existing installed version of Robocode or be downloaded by\nthe plugin. If this behavior is not the desired, use the following configuration\noptions available in the plugin extension.\n\n```kotlin\nrobocode {\n    download = true // default - if Robocode should be downloaded, otherwise the installDir is used\n    downloadVersion = \u003cdefault version\u003e // default - version of Robocode to download\n    downloadDir = layout.projectDirectory.dir(\".robocode\") // default - where Robocode should be downloaded\n    installDir = \u003cdefault install directory\u003e // default - the location where Robocode is installed\n}\n```\n\nWhen Robocode is downloaded, it will automatically add the development output\nfolder to the Robocode configuration. This allows Robocode to automatically use\nthe development build of robots.\n\nAlso, because the plugin knows the location of a Robocode installation, either\nspecified or downloaded, it means that Robocode can be run directly from Gradle.\nTo do so, use the task `robocodeRun`.\n\n# Test Battles\n\nMuch of robot development is running battles against other robots for testing.\nBecause of this, the plugin makes all Robocode jar files available in a Gradle\nconfiguration called `robocodeRuntime`. Gradle can be configured to add a source\nset which extends from this configuration for running battles.\n\n```kotlin\nval battles by sourceSets.registering\n\nval battlesImplementation by configurations.getting {\n    extendsFrom(configurations.robocode.get())\n}\n\nval battlesRuntimeOnly by configurations.getting {\n    extendsFrom(configurations.robocodeRuntime.get())\n}\n\ndependencies {\n    // Use JUnit to run the battles as \"tests\" \n    battlesImplementation(\"org.junit.jupiter:junit-jupiter-api:5.6.0\")\n    battlesRuntimeOnly(\"org.junit.jupiter:junit-jupiter-engine:5.6.0\")\n}\n\nval runBattles by project.tasks.registering(Test::class) {\n    dependsOn(\"robotBin\")\n\n    description = \"Runs Robocode battles\"\n    group = \"battles\"\n\n    useJUnitPlatform()\n    testClassesDirs = battles.get().output.classesDirs\n    classpath = battles.get().runtimeClasspath\n}\n```\n\n[Gradle]: https://gradle.org/\n[Robocode]: https://robocode.sourceforge.io/\n[com.bnorm.robocode]: https://plugins.gradle.org/plugin/com.bnorm.robocode\n[Shadow]: https://imperceptiblethoughts.com/shadow/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbnorm%2Frobocode-gradle-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbnorm%2Frobocode-gradle-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbnorm%2Frobocode-gradle-plugin/lists"}