AndroidStudio项目组件化maven上传gradle-router table注解产生库

apply plugin: 'maven'

//打包main目录下代码和资源的 task
task androidSourcesJar(type: Jar) {
    classifier = 'sources'
    from sourceSets.main.allSource
}

//配置需要上传到maven仓库的文件
artifacts {
    archives androidSourcesJar
}

//上传到Maven仓库的task
uploadArchives {
    repositories {
        mavenDeployer {
            //指定maven仓库url
            repository(url: "http://172.16.21.249:8890/repository/maven-releases/") {
                //nexus登录默认用户名和密码
                authentication(userName: "seven", password: "123456")
            }
            pom.groupId = "com.chope.components"// 唯一标识(通常为模块包名,也可以任意)
            pom.artifactId = "router-anno-compiler" // 项目名称(通常为类库模块名称,也可以任意)
            pom.version = "1.0.0"  // 版本号
        }
    }
}

现在的Android组件化,一般都是使用 apt 生成运行时需要的路由表。这个生成的lib,一般会单独产生在每个模块去依赖。

这里要注意的是,androidSourceJar,要配置一下,才能生成正确可用的 pom文件。

你可能感兴趣的:(AndroidMoblie)