All Projects → xmake-io → xmake-gradle

xmake-io / xmake-gradle

Licence: Apache-2.0 license
A gradle plugin that integrates xmake seamlessly

Programming Languages

groovy
2714 projects
lua
6591 projects
java
68154 projects - #9 most used programming language
C++
36643 projects - #6 most used programming language
Makefile
30231 projects
CMake
9771 projects

Projects that are alternatives of or similar to xmake-gradle

Debug Badge
Add badge(version code, version name, etc) for your DEBUG APK.
Stars: ✭ 75 (+141.94%)
Mutual labels:  gradle-plugin, android-studio
XperiaServiceMenu
An Android app that allows owners of a Sony Xperia, to easily open the service menu app via a tap of a button instead of having to type a code into the phone's dialer.
Stars: ✭ 14 (-54.84%)
Mutual labels:  android-studio
Grazel
A tool to migrate Android projects from Gradle to Bazel incrementally and automatically
Stars: ✭ 222 (+616.13%)
Mutual labels:  gradle-plugin
Whatsapp Android App
This is sample code for layout for chatting app like Whatsapp.
Stars: ✭ 32 (+3.23%)
Mutual labels:  android-studio
locus-android
An Awesome Kotlin Location library to retrieve location merely in 3 lines of code
Stars: ✭ 280 (+803.23%)
Mutual labels:  android-studio
WebRTCapp
This Android app aims to be a small video conference app created using mainly WebRTC technology. With it, you can make calls though a web socket connection
Stars: ✭ 27 (-12.9%)
Mutual labels:  android-studio
Wiggles
🐶 Beautiful Puppy adoption app with Jetpack Compose #AndroidDevChallenge
Stars: ✭ 365 (+1077.42%)
Mutual labels:  android-studio
awesome-android-tips
😎 A curated list of awesome Android tips
Stars: ✭ 34 (+9.68%)
Mutual labels:  android-studio
AndroidTips
A collections of tips in Android developing.Android开发总结。我的博客:
Stars: ✭ 721 (+2225.81%)
Mutual labels:  android-studio
gretty
Advanced gradle plugin for running web-apps on jetty and tomcat.
Stars: ✭ 116 (+274.19%)
Mutual labels:  gradle-plugin
moko-network
Network components with codegeneration of rest api for mobile (android & ios) Kotlin Multiplatform development
Stars: ✭ 107 (+245.16%)
Mutual labels:  gradle-plugin
graphql-java-codegen-gradle-plugin
Gradle plugin for graphql-java-codegen
Stars: ✭ 19 (-38.71%)
Mutual labels:  gradle-plugin
npm-publish
Gradle plugin for NPM package publishing. Allows for arbitrary publishing as well as seamless integration with Kotlin JS/MPP plugins.
Stars: ✭ 66 (+112.9%)
Mutual labels:  gradle-plugin
Chat-App-Android
Chat app based on the MVVM architecture using Kotlin, ViewModel, LiveData, DataBinding and more.
Stars: ✭ 70 (+125.81%)
Mutual labels:  android-studio
jetbrains-gradle-plugins
Gradle plugins for Docker, Terraform and Liquibase.
Stars: ✭ 22 (-29.03%)
Mutual labels:  gradle-plugin
harmonica
Kotlin Database Migration Tool. This tool makes it really easy to create table, index, add columns, and so on, with Kotlin DSL.
Stars: ✭ 123 (+296.77%)
Mutual labels:  gradle-plugin
gradle-http-plugin
Gradle plugin providing support for using HttpBuilder-NG to make HTTP requests as Gradle Tasks.
Stars: ✭ 30 (-3.23%)
Mutual labels:  gradle-plugin
gradle-scalafmt
Gradle plugin for scalafmt
Stars: ✭ 25 (-19.35%)
Mutual labels:  gradle-plugin
AndroidStudio-ChineseLanguagePackage
AndroidStudio 中文汉化包
Stars: ✭ 48 (+54.84%)
Mutual labels:  android-studio
RecycleClick
Android recycler view not supports for onItemClickListner event. This library helps to wrap up and gain the missing recycle view item click and item long click functions. This library is a project carried by Lakitha, give a visit https://github.com/LakithaRav
Stars: ✭ 25 (-19.35%)
Mutual labels:  android-studio

xmake-gradle

A gradle plugin that integrates xmake seamlessly

Introduction (中文)

xmake-gradle is a gradle plugin that integrates xmake seamlessly.

If you want to know more, please refer to:

Prerequisites

XMake installed on the system. Available here.

Apply the plugin

plugins DSL

plugins {
  id 'org.tboox.gradle-xmake-plugin' version '1.1.5'
}

Legacy plugin application

buildscript {
  repositories {
    maven {
      url "https://plugins.gradle.org/m2/"
    }
  }
  dependencies {
    classpath 'org.tboox:gradle-xmake-plugin:1.1.5'
  }
  repositories {
    mavenCentral()
  }
}

apply plugin: "org.tboox.gradle-xmake-plugin"

Configuation

Simplest Example

We add xmake.lua to projectdir/jni/xmake.lua and enable xmake in build.gradle.

build.gradle

android {
    externalNativeBuild {
        xmake {
            path "jni/xmake.lua"
        }
    }
}

JNI

The JNI project structure:

projectdir
  - src
    - main
      - java
  - jni
    - xmake.lua
    - *.cpp

xmake.lua:

add_rules("mode.debug", "mode.release")
target("nativelib")
    set_kind("shared")
    add_files("nativelib.cc")

More Gradle Configuations

android {
    defaultConfig {
        externalNativeBuild {
            xmake {
                // append the global cflags (optional)
                cFlags "-DTEST"

                // append the global cppflags (optional)
                cppFlags "-DTEST", "-DTEST2"

                // switch the build mode to `debug` for `xmake f -m debug` (optional)
                buildMode "debug"

                // set abi filters (optional), e.g. armeabi, armeabi-v7a, arm64-v8a, x86, x86_64
                // we can also get abiFilters from defaultConfig.ndk.abiFilters
                abiFilters "armeabi-v7a", "arm64-v8a"

                // set the built targets
                //targets "xxx", "yyy"
            }
        }
    }

    externalNativeBuild {
        xmake {
            // enable xmake and set xmake.lua project file path
            path "jni/xmake.lua"

            // enable verbose output (optional), e.g. verbose, warning, normal
            logLevel "verbose"

            // set c++stl (optional), e.g. c++_static/c++_shared, gnustl_static/gnustl_shared, stlport_static/stlport_shared
            stl "c++_shared"

            // set the given xmake program path (optional)
            // program /usr/local/bin/xmake

            // disable stdc++ library (optional)
            // stdcxx false

            // set the given ndk directory path (optional)
            // ndk "/Users/ruki/files/android-ndk-r20b/"

            // set sdk version of ndk (optional)
            // sdkver 21
        }
    }
}

Build

Build JNI and generate apk

The xmakeBuild will be injected to assemble task automatically if the gradle-xmake-plugin has been applied.

$ ./gradlew app:assembleDebug
> Task :nativelib:xmakeConfigureForArm64
> Task :nativelib:xmakeBuildForArm64
>> xmake build
[ 50%]: ccache compiling.debug nativelib.cc
[ 75%]: linking.debug libnativelib.so
[100%]: build ok!
>> install artifacts to /Users/ruki/projects/personal/xmake-gradle/nativelib/libs/arm64-v8a
> Task :nativelib:xmakeConfigureForArmv7
> Task :nativelib:xmakeBuildForArmv7
>> xmake build
[ 50%]: ccache compiling.debug nativelib.cc
[ 75%]: linking.debug libnativelib.so
[100%]: build ok!
>> install artifacts to /Users/ruki/projects/personal/xmake-gradle/nativelib/libs/armeabi-v7a
> Task :nativelib:preBuild
> Task :nativelib:assemble
> Task :app:assembleDebug

Force to rebuild JNI

$ ./gradlew nativelib:xmakeRebuild

Development

Build Plugins

$ ./gradlew gradle-xmake-plugin:assemble

Publish Plugins

see https://guides.gradle.org/publishing-plugins-to-gradle-plugin-portal/

$ ./gradlew gradle-xmake-plugin:publishPlugins

Contacts

Backers

Thank you to all our backers! 🙏 [Become a backer]

Sponsors

Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [Become a sponsor]

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].