Git Product home page Git Product logo

androidnativebundle's Introduction

NativeBundle

nativeBundle plugin is a gradle plugin that extend bundle task provided by android gradle plugin,it can help you publish c/c++ headers and other module that contain native source can dependent those module directly

  • android gradle plugin 3.0.0 - 8.0.2

Build and Test

1.Android studio import this project
2.Enter 'gradlew publishToMavenLocal' command in Terminal or click 'publishToMavenLocal' task in gradle task list
3.Open settings.gradle, include 'app' project and build it

Usage

1.Edit your root build.gradle file, add classpath 'io.github.howardpang:androidNativeBundle:1.1.4' to the file

buildscript {
    repositories {
        google()
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.0'
        //Add androidNativeBundle dependency
        classpath "io.github.howardpang:androidNativeBundle:1.1.4"
    }
}

2. Export header to aar

1. Apply plugin to your lib, add following line to your lib build.gradle
apply plugin: 'com.android.library'
apply plugin: 'com.ydq.android.gradle.native-aar.export' // must below android gradle plugin
2. Specify header path that you want to export, add following code segment to your lib build.gradle;
nativeBundleExport {
    headerDir = "${project.projectDir}/src/main/jni/include"
    //excludeHeaderFilter.add("**/**.cpp")
    //includeHeaderFilter.add("**/**.h")
    //bundleStatic = true
    //extraStaticLibDir = "${project.projectDir}/xx"
    //excludeStaticLibs.add("**/libmylib.a")
    //excludeStaticLibs.add("**/libxx.a")
}
3.The plugin also support flavours feature, you can add this code to flavour configure, like this:
productFlavors {
    flavorDimensions "default"
    export {
        dimension "default"
        nativeBundleExport {
            headerDir = "${project.projectDir}/src/main/jni/include"
            //excludeHeaderFilter.add("**/**.cpp")
            //includeHeaderFilter.add("**/**.h")
            //bundleStatic = true
            //extraStaticLibDir = "${project.projectDir}/xx"
            //excludeStaticLibs.add("**/libmylib.a")
            //excludeStaticLibs.add("**/libxx.a")
        }
    }
}
4.Because publish more than one static library will cause link order problem, so you can specify link order, for example libxx.a should link before libyy.a, like this:
nativeBundleExport {
    headerDir = "${project.projectDir}/src/main/jni/include"
    //excludeHeaderFilter.add("**/**.cpp")
    //includeHeaderFilter.add("**/**.h")
    bundleStatic = true
    //extraStaticLibDir = "${project.projectDir}/xx"
    //excludeStaticLibs.add("**/libmylib.a")
    //excludeStaticLibs.add("**/libxx.a")
    linkOrder = "libxx.a:libyy.a"
}
5. Android lib only packet shared library(so) to aar, this plugin can generate another aar to packet static library ,if you set 'bundleStatic',the plugin will gather static lib from 'externalNativeBuild' output dir default, you can specify other dir by set 'extraStaticLibDir' in 'nativeBundleExport', you can also exclude some static lib;
Default, the plugin will create a "bundleStaticLibRelease" task to packet the static bundle, but if you use flavours feature, the plugin will create "bundleStaticLib${flavourName}Release" for every flavour;
After you configure, you can add static publication to your publish script, like this:
publishing {
    publications {
        maven(MavenPublication) {
            groupId 'com.ydq.android.native-aar'
            artifactId "mylib"
            artifact bundleRelease
        }

        mavenStaticBundle(MavenPublication) {
            groupId 'com.ydq.android.native-aar'
            artifactId "mylib-static"
            artifact bundleStaticLibRelease
        }
    }
}

3. Import aar

1. Apply plugin to your lib/app, add following line to your lib/app build.gradle
apply plugin: 'com.android.application'
apply plugin: 'com.ydq.android.gradle.native-aar.import' // must below android gradle plugin
2. If you use 'externalNativeBuild' to build, there are two ways to build
  • ndkBuild: Add this line
    include ${ANDROID_GRADLE_NATIVE_BUNDLE_PLUGIN_MK} #must be before "include $(BUILD_SHARED_LIBRARY)" or "include $(BUILD_STATIC_LIBRARY)"
    to every module that you want in Android.mk, like this
include $(CLEAR_VARS)
LOCAL_SRC_FILES := myapp.cpp \
LOCAL_MODULE := myapp
LOCAL_LDLIBS += -llog
include ${ANDROID_GRADLE_NATIVE_BUNDLE_PLUGIN_MK} #must followed by "include $(BUILD_SHARED_LIBRARY)" or "include $(BUILD_STATIC_LIBRARY)"
include $(BUILD_SHARED_LIBRARY)
  • cmake: Add this line
    include (${ANDROID_GRADLE_NATIVE_BUNDLE_PLUGIN_MK})
    to CMakeLists.txt; Then link modules if the target needed
    target_link_libraries(<target> ${ANDROID_GRADLE_NATIVE_MODULES})
    like this
cmake_minimum_required(VERSION 3.4.1)
project(echo LANGUAGES C CXX)
add_library(myapp
  SHARED
    myapp.cpp)
target_link_libraries(myapp
    log
    )
include (${ANDROID_GRADLE_NATIVE_BUNDLE_PLUGIN_MK})
target_link_libraries(myapp ${ANDROID_GRADLE_NATIVE_MODULES})
target_compile_options(myapp
  PRIVATE
    -Wall -Werror)
3. If you use custom command ndk-build
  • Add following line to every module you want like "externalNativeBuild:ndkBuild"
  • Add macro
    "ANDROID_GRADLE_NATIVE_BUNDLE_PLUGIN_MK=${nativeBundleImport.ANDROID_GRADLE_NATIVE_BUNDLE_PLUGIN_MK}"
    to your ndk-build, like this
def execmd = ["$ndkbuildcmd", "-j${coreNum}", "V=1", "NDK_PORJECT_PATH=$buildDir",
                          "APP_BUILD_SCRIPT=$androidMKfile", "NDK_APPLICATION_MK=$applicationMKfile", "ANDROID_GRADLE_NATIVE_BUNDLE_PLUGIN_MK=${nativeBundleImport.ANDROID_GRADLE_NATIVE_BUNDLE_PLUGIN_MK}"]
4. If you want to link some static library with whole archive, you can set it in build.gradle like this
nativeBundleImport {
    wholeStaticLibs = "libxx.a:libyy.a" // Library is seperated by colon
}
5. If your module have below dependency , the plugin will put the so in to 'aar' and add it to native compile
dependencies {
    implementation "com.my.group:module:1.0.0:armeabi-v7a@so"
    implementation "com.my.group:module:1.0.0:armeabi-v7a@har" // contain 'headers'
}
6. If you don't want to add some dependency to native compile, for example, you have 'implementation "com.my.group:moduleA:1.0.0" ' dependency and it contain native interface, you can do like this
nativeBundleImport {
    //wholeStaticLibs = "libxx.a:libyy.a" // Library is seperated by colon
    excludeDependencies.add("com.my.group:moduleA")
    excludeDependencies.add("com.my.group:moduleB")
}
7. The plugin will extract headers(include) and library to "${project.projectDir}/build/nativeLib/", you can find what interfaces that aar contain
8. If android studio IDE can't parse those headers when you edit c/c++ source and press 'Sync Project With Gradle Files' button to re-sync project

androidnativebundle's People

Contributors

howardpang avatar marandaneto avatar paulo-raca avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

androidnativebundle's Issues

Need to be ableto give filter for header files

Recently there was a pull request which made the plugin only to include .h files to generated AAR package. This is good, but not flexible.

Need to add possibility to set an option in gradle file like includeHeaderFiles which can be set to something like ['*.h', '*.hpp', '*.hxx']. Then the plugin will only add header files which satisfy the given filter.

unable to build library after upgrade to gradle 7.2 and AGP 7.0.2

After upgrading my project to gradle 7.2 and AGP 7.0.2 I started getting the following build error:

Execution failed for task ':r4:bundleStaticLibPrepareRelease'.
> No such property: externalNativeJsonGenerator for class: com.android.build.gradle.internal.scope.MutableTaskContainer

Please see the relevant build log here:
https://github.com/cppfw/r4/runs/3651546091?check_suite_focus=true#step:6:127

Is this a problem in androidNativeBundle plugin?

AGP 7.4 not supported

With AGP 7.4 the internal API of the LibraryVariant has changed and therefor you receive the following error:

> No such property: variantDependencies for class: com.android.build.gradle.internal.variant.LibraryVariantData

I've already found a solution but I'm unable to push a branch and therefor I'll describe the fix here:

Add the following lines to GradleApiAdapter. getArtifactCollection(..):

        if (isAndroidGradleVersionGreaterOrEqualTo("7.4.0"))  {
            artifactCollection = variant.component.getVariantDependencies().getArtifactCollection(type, scope, artifactType)
        } else if (isAndroidGradleVersionGreaterOrEqualTo("4.1.0")) {

and it will work with AGP 7.4

naming inconsistency

Since you have published the plugin to maven central, it is now called io.github.howardpang:androidNativeBundle.

But when applying the plugin in gradle files it still has an old name:

apply plugin: 'com.ydq.android.gradle.native-aar.export'
apply plugin: 'com.ydq.android.gradle.native-aar.import'

I think those names should also be changed to align with main package name, as it creates a confusion.

Unable to build library after upgrade to gradle 7.4,AGP 7.3.0 and Flutter 3.3.9

After I upgrade my Flutter version to 3.3.9 , so I need upgrade Gradle to 7.4 and AGP to 7.3 ( AGP need 7.1.2 at least).

I started getting the following build error:

* Where:
Initialization script '/Users/jiangpengyong/Documents/env/flutter/packages/flutter_tools/gradle/aar_init_script.gradle' line: 94

* What went wrong:
Cannot change dependencies of dependency configuration ':compileOnly' after it has been included in dependency resolution.

Is this the problem in this plugin? How can I solve this problem?

NativeLib Directory Doesn't exist on Rebuild

Hi, thanks for the lib :)

Full context: getsentry/sentry-android-gradle-plugin#98

AGP: 4.1.3
Gradle: 6.8.3
Plugin: 1.0.7

To reproduce:
https://github.com/getsentry/examples/tree/master/android

open AS and Build -> Rebuild project

Executing tasks: [clean, :app:assembleDebug] in project /Users/myuser/Github/examples/android

Configure project :app
:app:external cmake build
:app:external cmake build

Task :clean UP-TO-DATE
Task :app:preBuild
Task :app:preDebugBuild

Task :app:externalNativeBuildCleanDebug
Clean native-sample armeabi-v7a
ninja: Entering directory /Users/myuser/Github/examples/android/app/.cxx/cmake/debug/armeabi-v7a' [0/1] Re-running CMake... -- Configuring done -- Generating done -- Build files have been written to: /Users/myuser/Github/examples/android/app/.cxx/cmake/debug/armeabi-v7a [1/1] Cleaning all built files... Cleaning... 0 files. Clean native-sample arm64-v8a ninja: Entering directory /Users/myuser/Github/examples/android/app/.cxx/cmake/debug/arm64-v8a'
[0/1] Re-running CMake...
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/myuser/Github/examples/android/app/.cxx/cmake/debug/arm64-v8a
[1/1] Cleaning all built files...
Cleaning... 0 files.
Clean native-sample x86
ninja: Entering directory /Users/myuser/Github/examples/android/app/.cxx/cmake/debug/x86' [0/1] Re-running CMake... -- Configuring done -- Generating done -- Build files have been written to: /Users/myuser/Github/examples/android/app/.cxx/cmake/debug/x86 [1/1] Cleaning all built files... Cleaning... 0 files. Clean native-sample x86_64 ninja: Entering directory /Users/myuser/Github/examples/android/app/.cxx/cmake/debug/x86_64'
[0/1] Re-running CMake...
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/myuser/Github/examples/android/app/.cxx/cmake/debug/x86_64
[1/1] Cleaning all built files...
Cleaning... 0 files.

Task :app:extractProguardFiles
Task :app:preReleaseBuild

Task :app:externalNativeBuildCleanRelease
Clean native-sample armeabi-v7a
ninja: Entering directory /Users/myuser/Github/examples/android/app/.cxx/cmake/release/armeabi-v7a' [0/1] Re-running CMake... -- Configuring done -- Generating done -- Build files have been written to: /Users/myuser/Github/examples/android/app/.cxx/cmake/release/armeabi-v7a [1/1] Cleaning all built files... Cleaning... 0 files. Clean native-sample arm64-v8a ninja: Entering directory /Users/myuser/Github/examples/android/app/.cxx/cmake/release/arm64-v8a'
[0/1] Re-running CMake...
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/myuser/Github/examples/android/app/.cxx/cmake/release/arm64-v8a
[1/1] Cleaning all built files...
Cleaning... 0 files.
Clean native-sample x86
ninja: Entering directory /Users/myuser/Github/examples/android/app/.cxx/cmake/release/x86' [0/1] Re-running CMake... -- Configuring done -- Generating done -- Build files have been written to: /Users/myuser/Github/examples/android/app/.cxx/cmake/release/x86 [1/1] Cleaning all built files... Cleaning... 0 files. Clean native-sample x86_64 ninja: Entering directory /Users/myuser/Github/examples/android/app/.cxx/cmake/release/x86_64'
[0/1] Re-running CMake...
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/myuser/Github/examples/android/app/.cxx/cmake/release/x86_64
[1/1] Cleaning all built files...
Cleaning... 0 files.

Task :app:clean
Task :app:compileDebugAidl NO-SOURCE
Task :app:compileDebugRenderscript NO-SOURCE
Task :app:generateDebugBuildConfig
Task :app:checkDebugAarMetadata
Task :app:generateDebugResValues
Task :app:generateDebugResources
Task :app:createDebugCompatibleScreenManifests
Task :app:extractDeepLinksDebug
Task :app:processDebugMainManifest
Task :app:processDebugManifest
Task :app:generateJsonModelDebug FAILED
Task :app:mergeDebugResources
Task :app:javaPreCompileDebug
Task :app:processDebugManifestForPackage

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':app:generateJsonModelDebug'.

/Users/myuser/Github/examples/android/app/CMakeLists.txt : C/C++ debug|armeabi-v7a : CMake Error at /Users/myuser/Github/examples/android/app/CMakeLists.txt:9 (include):
include could not find load file:

  /Users/myuser/Github/examples/android/app/build/nativeLib/gradle.mk
  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 1s
17 actionable tasks: 16 executed, 1 up-to-date

Add option to pack static libs to the same AAR

Currently there is a bundleStatic = true option which packs static libs to a separate AAR package.

Need to add another option separateStaticAAR = false to indicate that the static libs must be added to the same main AAR package.

allow specifying destination subdirectory path for header files

For example, in my mylib project I have header files in the

root/include

and I want when the ARR package is built the headers would go to

jni/include/my/lib

so in gradle file I could specify it by adding headerOutSubdir = "my/lib" like this:

nativeBundleExport {
        headerDir = "${project.projectDir}/root/include/"
        bundleStatic = true
        includeHeaderFilter.add("**/*.h")
        headerOutSubdir = "my/lib"
    }

Just to add, this is needed when there is no possibility to place the header files into root/include/my/lib in the project tree in the first place, e.g. when packaging a third party library it is undesirable to change its directory layout.

NDK warning: non-system libraries in linker flags

Thank you for this great plugin.
It took me a while to find it, and I was even considering writing something like this myself.

This works perfectly, but I get some compilation warnings (Using NDK 21)

Android NDK: WARNING:xxxxx/Android.mk:libB: non-system libraries in linker flags: ~/.gradle/caches/transforms-2/files-2.1/37115bd2f005b93c0ccd8b241f03f93f/jetified-a-1.0.0-SNAPSHOT/jni/x86/libA.so    
Android NDK:     This is likely to result in incorrect builds. Try using LOCAL_STATIC_LIBRARIES    
Android NDK:     or LOCAL_SHARED_LIBRARIES instead to list the library dependencies of the    
Android NDK:     current module    

I also get extra warnings when using it from a static library (In this case I just needed the headers):

WARNING:xxxxx/Android.mk:libC: LOCAL_LDFLAGS is always ignored for static libraries  

I attempted to fix it, but NDK's documentation suggests an approach different from what you are using: using PREBUILT_SHARED_LIBRARY and PREBUILT_STATIC_LIBRARY to declare dependencies -- Any thoughts?

Issue related with flavorDimensions

If the project has several flavorDimensions the project won't be built.

Example:

apply plugin: 'com.ydq.android.gradle.native-aar.import'

flavorDimensions 'type1', 'type2'

productFlavors {
    flavor1 {
        dimension 'type1'
    }
    flavor2 {
        dimension 'type1'
    }
    flavor3 {
        dimension 'type2'
    }
    flavor4 {
        dimension 'type2'
    }
}

Cause of the issue might be combined flavor names and this name is used for finding product flavor for a variable (gradleMk ).

gradleMk = android.productFlavors.getByName(variant.flavorName).nativeBundleImport.ANDROID_GRADLE_NATIVE_BUNDLE_PLUGIN_MK

build/nativelib is empty

AAudioTrack2

AAudioTrack2
  .cxx
    build
      .transforms
      generated
      intermediates
      nativeLib
        gradle.mk
        tmp.mk
      outputs
      tmp

#include <midifile/MidiEventList.h> // not found

include (${ANDROID_GRADLE_NATIVE_BUNDLE_PLUGIN_MK})

add_library(engine SHARED
        ardour/AudioEngine/AudioBackend.cpp
        ardour/AudioEngine/AudioEngine.cpp
        ardour/Backends/AAudio.cpp
        smallville7123/MidiMap.cpp
        smallville7123/TempoGrid.cpp
)

target_link_libraries(engine log aaudio ${ANDROID_GRADLE_NATIVE_MODULES})

build.gradle

plugins {
    id 'com.android.library'
    id 'com.ydq.android.gradle.native-aar.import'
}


// https://developer.android.com/studio/build/native-dependencies

android {
    compileSdkVersion 29 // Play requires Android Q or higher
    buildToolsVersion "29.0.3" // Play requires Android Q or higher

    defaultConfig {
        minSdkVersion 28 // Android Pie
        targetSdkVersion 29 // Play requires Android Q or higher
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        consumerProguardFiles "consumer-rules.pro"

        externalNativeBuild {
            cmake {
                cppFlags "-std=c++17"
            }
        }
    }
    externalNativeBuild {
        cmake {
            path "src/main/cpp/CMakeLists.txt"
            version "3.10.2"
        }
    }
    buildFeatures {
        prefab true
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

dependencies {
    implementation project(':AndroidDAW_SDK__MIDI')
    implementation 'androidx.appcompat:appcompat:1.2.0'
    implementation 'com.google.android.material:material:1.3.0'
    //noinspection GradleDynamicVersion
    testImplementation 'junit:junit:4.+'
    api project(path: ':AAudioTrack2:VstSystem:VstManager')
    androidTestImplementation 'androidx.test.ext:junit:1.1.2'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
    api 'com.arthenica:mobile-ffmpeg-full-gpl:4.4'
}

AndroidDAW_SDK__MIDI

build.gradle

plugins {
    id 'com.android.library'
    id 'com.ydq.android.gradle.native-aar.export'
}

nativeBundleExport {
    headerDir = "${project.projectDir}/src/main/cpp/include"
}

android {
    compileSdkVersion 30
    buildToolsVersion "30.0.3"

    defaultConfig {
        minSdkVersion 28
        targetSdkVersion 30
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        consumerProguardFiles "consumer-rules.pro"
        externalNativeBuild {
            cmake {
                cppFlags "-std=c++17"
            }
        }
    }
    externalNativeBuild {
        cmake {
            path "src/main/cpp/CMakeLists.txt"
            version "3.10.2"
        }
    }
    buildFeatures {
        prefab true
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

dependencies {

    implementation 'androidx.appcompat:appcompat:1.2.0'
    implementation 'com.google.android.material:material:1.3.0'
    testImplementation 'junit:junit:4.+'
    androidTestImplementation 'androidx.test.ext:junit:1.1.2'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
}

structure

src
  androidTest
  main
    cpp
      include
        midifile
          Binasc.h
          MidiEvent.h
          MidiEventList.h
          MidiFile.h
          MidiMessage.h
          Options.h
        src
        CMakeLists.txt
    java
    AndroidManifest.xml

Cmake

cmake_minimum_required(VERSION 3.10.2)

project("AndroidDAW_SDK_MIDI")

set(CMAKE_CXX_FLAGS_DEBUG   "${CMAKE_CXX_FLAGS_DEBUG}   --optimize -O0 -g3")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} --optimize -Ofast -g0")

# https://developer.android.com/ndk/guides/asan#cmake

include(CheckIncludeFiles)

include_directories(include)

check_include_files(unistd.h HAVE_UNISTD_H)
check_include_files(humdrum.h HAVE_HUMDRUM_H)
check_include_files(sys/io.h HAVE_SYS_IO_H)

add_library(AndroidDAW_MIDI SHARED
        src/Options.cpp
        src/Binasc.cpp
        src/MidiEvent.cpp
        src/MidiEventList.cpp
        src/MidiFile.cpp
        src/MidiMessage.cpp
)

Support configuration cache feature

https://docs.gradle.org/current/userguide/configuration_cache.html

AGP 7.0.1
Gradle 7.2

Configuration cache state could not be cached: field 'closure' from type 'org.gradle.api.internal.AbstractTask$ClosureTaskAction': error writing value of type 'com.yy.android.gradle.nativedepend.NativeBundleImportPlugin$_apply_closure3'
Configuration cache state could not be cached: field 'variants' from type 'com.yy.android.gradle.nativedepend.NativeBundleImportPlugin$_apply_closure3': error writing value of type 'groovy.lang.Reference'

Usage of Gradle 8.0 deprecated features

My build log contains the following lines:

The AbstractArchiveTask.extension property has been deprecated. This is scheduled to be removed in Gradle 8.0. Please use the archiveExtension property instead. See https://docs.gradle.org/7.2/dsl/org.gradle.api.tasks.bundling.AbstractArchiveTask.html#org.gradle.api.tasks.bundling.AbstractArchiveTask:extension for more details.
The AbstractArchiveTask.baseName property has been deprecated. This is scheduled to be removed in Gradle 8.0. Please use the archiveBaseName property instead. See https://docs.gradle.org/7.2/dsl/org.gradle.api.tasks.bundling.AbstractArchiveTask.html#org.gradle.api.tasks.bundling.AbstractArchiveTask:baseName for more details.
The AbstractArchiveTask.destinationDir property has been deprecated. This is scheduled to be removed in Gradle 8.0. Please use the destinationDirectory property instead. See https://docs.gradle.org/7.2/dsl/org.gradle.api.tasks.bundling.AbstractArchiveTask.html#org.gradle.api.tasks.bundling.AbstractArchiveTask:destinationDir for more details.
The AbstractArchiveTask.version property has been deprecated. This is scheduled to be removed in Gradle 8.0. Please use the archiveVersion property instead. See https://docs.gradle.org/7.2/dsl/org.gradle.api.tasks.bundling.AbstractArchiveTask.html#org.gradle.api.tasks.bundling.AbstractArchiveTask:version for more details.

I'm wondering if those could be coming from androidNativeBundle plugin?

At the moment I'm using gradle 7.2, but eventually will have top switch to 8.0, so would be good to resolve those, in case those are caused by the plugin.

native-aar.import is creating build/nativeLib with empty .mk files

Hey, I'm trying to use your export and import plugin, but I am having issues, not sure If I'm doing something wrong.

I have a module (android lib.) that compiles native code and it generates shared libraries .sos, so in the end, we have a fat .aar which contains the so files and the header, so it seems that the export plugin works just fine, thanks for that.

When my App. adds this .aar as a maven dependency (gradle implementation), the plugin import is not generating the build/nativeLib properly, we only see 2 empty files gradle.mk and tmp.mk.

the changes may have seen here:
getsentry/sentry-android#161

would be nice if you could point out what we are doing wrong, thanks a lot.

problem with plugins .export/.import

I have a dummy application creating a native c/c++ aar

I've followed the guidelins but

    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.0'
        //Add androidNativeBundle dependency
        classpath "io.github.howardpang:androidNativeBundle:1.1.3"
    }

classpath isn't recogised, so I am using implementation

but

apply plugin: 'com.ydq.android.gradle.native-aar.export' // must below android gradle plugin

Gives me an error > Plugin with id 'com.ydq.android.gradle.native-aar.export' not found.

And if I use

plugins {
    id 'com.android.library'
    id 'com.ydq.android.gradle.native-aar.export' // must below android gradle plugin
}

gives me a different error Plugin [id: 'com.ydq.android.gradle.native-aar.export'] was not found in any of the following sources:

In general I cannot go with gradle less than 7.5 and in you're guidelines it says 7.4

Minimum supported Gradle version is 7.5. Current version is 7.4.
  • Does that have anything to do?
  • Is there going to be an update to the latest v8 or even to v9 when it comes out this year?

per module export/import

is there a way to export and import per-module

for example

Module Type Dependancies Dependancies Imported By Other Dependancies
RingBuffer Export None None
Midi Export Ringbuffer None
Ports Export Ringbuffer None
Plugin Export Ports, Midi Ringbuffer
Module Type Dependancies Dependancies Imported By Other Dependancies
Midi Import Ringbuffer None
Ports Import Ringbuffer None
Plugin Import Ports, Midi Ringbuffer

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.