kezong / fat-aar-android

A gradle plugin that merge dependencies into the final aar file works with AGP 3.+

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

怎么把Kotlin源码打入aar

DIY-green opened this issue · comments

Describe the issue
使用目前最新版本插件,无法将Kotlin源码打入aar

Build Environment

  • Operating System: [e.g. MacOS]
  • Gradle Plugin Version: [e.g. 4.1.0]
  • Gradle Version: [e.g. 6.5]
  • Fat-aar Version: [e.g. 1.3.1]
commented

同问

同问

你们解决了吗这个问题

commented

你们解决了吗这个问题

commented

我打进去了 kotlin中的so库也打进去了 单例实例companion 找不到

def module_list = [
        project("xxxxxxx"),
]

def path_suffix = '/src/main/java'

task sourceJar(type: Jar) {
    def source_dirs = []
    module_list.forEach {
        source_dirs.add(it.getProjectDir().absolutePath + path_suffix)
    }
    from source_dirs
    archiveClassifier = "sources"
}

publishing {
    publications {
        release(MavenPublication) {

            groupId = 'xxx'
            artifactId = 'xxx'
            version = "xxx"

            artifact sourceJar

            afterEvaluate {
                from components.release
            }
        }
    }
}

dependencies {
    module_list.forEach {
        embed(it)
    }
}