{"id":13531225,"url":"https://github.com/xmake-io/xmake-gradle","last_synced_at":"2025-08-20T20:33:05.459Z","repository":{"id":46644646,"uuid":"252766473","full_name":"xmake-io/xmake-gradle","owner":"xmake-io","description":"A gradle plugin that integrates xmake seamlessly","archived":false,"fork":false,"pushed_at":"2025-05-11T12:57:36.000Z","size":325,"stargazers_count":55,"open_issues_count":3,"forks_count":8,"subscribers_count":4,"default_branch":"dev","last_synced_at":"2025-08-06T02:29:06.321Z","etag":null,"topics":["android-studio","gradle-plugin","xmake","xmake-gradle"],"latest_commit_sha":null,"homepage":"https://xmake.io","language":"Groovy","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/xmake-io.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","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},"funding":{"github":"waruqi","open_collective":"xmake","custom":"https://xmake.io/#/sponsor"}},"created_at":"2020-04-03T15:09:49.000Z","updated_at":"2025-08-02T22:31:28.000Z","dependencies_parsed_at":"2024-01-13T23:18:42.393Z","dependency_job_id":"79147a09-e272-4dc7-859a-8b11b6cddbc0","html_url":"https://github.com/xmake-io/xmake-gradle","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/xmake-io/xmake-gradle","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xmake-io%2Fxmake-gradle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xmake-io%2Fxmake-gradle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xmake-io%2Fxmake-gradle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xmake-io%2Fxmake-gradle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xmake-io","download_url":"https://codeload.github.com/xmake-io/xmake-gradle/tar.gz/refs/heads/dev","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xmake-io%2Fxmake-gradle/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271378694,"owners_count":24749196,"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","status":"online","status_checked_at":"2025-08-20T02:00:09.606Z","response_time":69,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["android-studio","gradle-plugin","xmake","xmake-gradle"],"created_at":"2024-08-01T07:01:01.068Z","updated_at":"2025-08-20T20:33:05.441Z","avatar_url":"https://github.com/xmake-io.png","language":"Groovy","funding_links":["https://github.com/sponsors/waruqi","https://opencollective.com/xmake","https://xmake.io/#/sponsor"],"categories":["Plugins"],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"https://xmake.io\"\u003e\n    \u003cimg width=\"200\" heigth=\"200\" src=\"https://tboox.org/static/img/xmake/logo256c.png\"\u003e\n  \u003c/a\u003e\n\n  \u003ch1\u003exmake-gradle\u003c/h1\u003e\n\n  \u003cdiv\u003e\n    \u003ca href=\"https://github.com/xmake-io/xmake-gradle/releases\"\u003e\n      \u003cimg src=\"https://img.shields.io/github/release/xmake-io/xmake-gradle.svg?style=flat-square\" alt=\"Github All Releases\" /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/xmake-io/xmake-gradle/blob/master/LICENSE.md\"\u003e\n      \u003cimg src=\"https://img.shields.io/github/license/xmake-io/xmake.svg?colorB=f48041\u0026style=flat-square\" alt=\"license\" /\u003e\n    \u003c/a\u003e\n  \u003c/div\u003e\n  \u003cdiv\u003e\n    \u003ca href=\"https://www.reddit.com/r/tboox/\"\u003e\n      \u003cimg src=\"https://img.shields.io/badge/chat-on%20reddit-ff3f34.svg?style=flat-square\" alt=\"Reddit\" /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://gitter.im/tboox/tboox?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge\"\u003e\n      \u003cimg src=\"https://img.shields.io/gitter/room/tboox/tboox.svg?style=flat-square\u0026colorB=96c312\" alt=\"Gitter\" /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://t.me/tbooxorg\"\u003e\n      \u003cimg src=\"https://img.shields.io/badge/chat-on%20telegram-blue.svg?style=flat-square\" alt=\"Telegram\" /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://jq.qq.com/?_wv=1027\u0026k=5hpwWFv\"\u003e\n      \u003cimg src=\"https://img.shields.io/badge/chat-on%20QQ-ff69b4.svg?style=flat-square\" alt=\"QQ\" /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://xmake.io/#/sponsor\"\u003e\n      \u003cimg src=\"https://img.shields.io/badge/donate-us-orange.svg?style=flat-square\" alt=\"Donate\" /\u003e\n    \u003c/a\u003e\n  \u003c/div\u003e\n\n  \u003cp\u003eA gradle plugin that integrates xmake seamlessly\u003c/p\u003e\n\u003c/div\u003e\n\n## Introduction ([中文](/README_zh.md))\n\nxmake-gradle is a gradle plugin that integrates xmake seamlessly.\n\nIf you want to know more, please refer to:\n\n* [Documents](https://xmake.io/#/home)\n* [HomePage](https://xmake.io)\n* [Github](https://github.com/xmake-io/xmake-gradle)\n* [Gitee](https://gitee.com/tboox/xmake-gradle)\n* [GradlePlugin](https://plugins.gradle.org/plugin/org.tboox.gradle-xmake-plugin)\n\n## Prerequisites\n\nXMake installed on the system. Available [here](https://github.com/xmake-io/xmake).\n\n## Apply the plugin\n\n### plugins DSL\n\n```\nplugins {\n  id 'org.tboox.gradle-xmake-plugin' version '1.2.3'\n}\n```\n\n### Legacy plugin application\n\n```\nbuildscript {\n  repositories {\n    maven {\n      url \"https://plugins.gradle.org/m2/\"\n    }\n  }\n  dependencies {\n    classpath 'org.tboox:gradle-xmake-plugin:1.2.3'\n  }\n  repositories {\n    mavenCentral()\n  }\n}\n\napply plugin: \"org.tboox.gradle-xmake-plugin\"\n```\n\n## Configuation\n\n### Simplest Example\n\nWe add `xmake.lua` to `projectdir/jni/xmake.lua` and enable xmake in build.gradle.\n\n#### build.gradle\n\n```\nandroid {\n    externalNativeBuild {\n        xmake {\n            path \"jni/xmake.lua\"\n        }\n    }\n}\n```\n\n#### JNI\n\nThe JNI project structure:\n\n```\nprojectdir\n  - src\n    - main\n      - java\n  - jni\n    - xmake.lua\n    - *.cpp\n```\n\nxmake.lua:\n\n```lua\nadd_rules(\"mode.debug\", \"mode.release\")\ntarget(\"nativelib\")\n    set_kind(\"shared\")\n    add_files(\"nativelib.cc\")\n```\n\n### More Gradle Configuations\n\n```\nandroid {\n    defaultConfig {\n        externalNativeBuild {\n            xmake {\n                // append the global cflags (optional)\n                cFlags \"-DTEST\"\n\n                // append the global cppflags (optional)\n                cppFlags \"-DTEST\", \"-DTEST2\"\n\n                // switch the build mode to `debug` for `xmake f -m debug` (optional)\n                buildMode \"debug\"\n\n                // set abi filters (optional), e.g. armeabi, armeabi-v7a, arm64-v8a, x86, x86_64\n                // we can also get abiFilters from defaultConfig.ndk.abiFilters\n                abiFilters \"armeabi-v7a\", \"arm64-v8a\"\n\n                // set the built targets\n                //targets \"xxx\", \"yyy\"\n            }\n        }\n    }\n\n    externalNativeBuild {\n        xmake {\n            // enable xmake and set xmake.lua project file path\n            path \"jni/xmake.lua\"\n\n            // enable verbose output (optional), e.g. verbose, normal\n            logLevel \"verbose\"\n\n            // set c++stl (optional), e.g. c++_static/c++_shared, gnustl_static/gnustl_shared, stlport_static/stlport_shared\n            stl \"c++_shared\"\n\n            // set the given xmake program path (optional)\n            // program /usr/local/bin/xmake\n\n            // disable stdc++ library (optional)\n            // stdcxx false\n\n            // set the given ndk directory path (optional)\n            // ndk \"/Users/ruki/files/android-ndk-r20b/\"\n\n            // set sdk version of ndk (optional)\n            // sdkver 21\n        }\n    }\n}\n```\n\n## Build\n\n### Build JNI and generate apk\n\nThe `xmakeBuild` will be injected to `assemble` task automatically if the gradle-xmake-plugin has been applied.\n\n```console\n$ ./gradlew app:assembleDebug\n\u003e Task :nativelib:xmakeConfigureForArm64\n\u003e Task :nativelib:xmakeBuildForArm64\n\u003e\u003e xmake build\n[ 50%]: ccache compiling.debug nativelib.cc\n[ 75%]: linking.debug libnativelib.so\n[100%]: build ok!\n\u003e\u003e install artifacts to /Users/ruki/projects/personal/xmake-gradle/nativelib/libs/arm64-v8a\n\u003e Task :nativelib:xmakeConfigureForArmv7\n\u003e Task :nativelib:xmakeBuildForArmv7\n\u003e\u003e xmake build\n[ 50%]: ccache compiling.debug nativelib.cc\n[ 75%]: linking.debug libnativelib.so\n[100%]: build ok!\n\u003e\u003e install artifacts to /Users/ruki/projects/personal/xmake-gradle/nativelib/libs/armeabi-v7a\n\u003e Task :nativelib:preBuild\n\u003e Task :nativelib:assemble\n\u003e Task :app:assembleDebug\n```\n\n### Force to rebuild JNI\n\n```console\n$ ./gradlew nativelib:xmakeRebuild\n```\n\n## Development\n\n### Build Plugins\n\n```console\n$ ./gradlew gradle-xmake-plugin:assemble\n```\n\n### Publish Plugins\n\nsee [https://guides.gradle.org/publishing-plugins-to-gradle-plugin-portal/](https://guides.gradle.org/publishing-plugins-to-gradle-plugin-portal/)\n\n```console\n$ ./gradlew gradle-xmake-plugin:publishPlugins\n```\n\n## Contacts\n\n* Email：[waruqi@gmail.com](mailto:waruqi@gmail.com)\n* Homepage：[xmake.io](https://xmake.io)\n* Community\n  - [Chat on Reddit](https://www.reddit.com/r/xmake/)\n  - [Chat on Telegram](https://t.me/tbooxorg)\n  - [Chat on Discord](https://discord.gg/xmake)\n  - Chat on QQ Group: 343118190, 662147501\n* Source Code：[GitHub](https://github.com/xmake-io/xmake), [Gitee](https://gitee.com/tboox/xmake)\n* WeChat Public: tboox-os\n\n## Backers\n\nThank you to all our backers! 🙏 [[Become a backer](https://opencollective.com/xmake#backer)]\n\n\u003ca href=\"https://opencollective.com/xmake#backers\" target=\"_blank\"\u003e\u003cimg src=\"https://opencollective.com/xmake/backers.svg?width=890\"\u003e\u003c/a\u003e\n\n## Sponsors\n\nSupport this project by becoming a sponsor. Your logo will show up here with a link to your website. [[Become a sponsor](https://opencollective.com/xmake#sponsor)]\n\n\u003ca href=\"https://opencollective.com/xmake/sponsor/0/website\" target=\"_blank\"\u003e\u003cimg src=\"https://opencollective.com/xmake/sponsor/0/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/xmake/sponsor/1/website\" target=\"_blank\"\u003e\u003cimg src=\"https://opencollective.com/xmake/sponsor/1/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/xmake/sponsor/2/website\" target=\"_blank\"\u003e\u003cimg src=\"https://opencollective.com/xmake/sponsor/2/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/xmake/sponsor/3/website\" target=\"_blank\"\u003e\u003cimg src=\"https://opencollective.com/xmake/sponsor/3/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/xmake/sponsor/4/website\" target=\"_blank\"\u003e\u003cimg src=\"https://opencollective.com/xmake/sponsor/4/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/xmake/sponsor/5/website\" target=\"_blank\"\u003e\u003cimg src=\"https://opencollective.com/xmake/sponsor/5/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/xmake/sponsor/6/website\" target=\"_blank\"\u003e\u003cimg src=\"https://opencollective.com/xmake/sponsor/6/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/xmake/sponsor/7/website\" target=\"_blank\"\u003e\u003cimg src=\"https://opencollective.com/xmake/sponsor/7/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/xmake/sponsor/8/website\" target=\"_blank\"\u003e\u003cimg src=\"https://opencollective.com/xmake/sponsor/8/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/xmake/sponsor/9/website\" target=\"_blank\"\u003e\u003cimg src=\"https://opencollective.com/xmake/sponsor/9/avatar.svg\"\u003e\u003c/a\u003e\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxmake-io%2Fxmake-gradle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxmake-io%2Fxmake-gradle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxmake-io%2Fxmake-gradle/lists"}