码迷,mamicode.com
首页 > 其他好文 > 详细

gradle 中项目的多目录组织形式

时间:2020-07-21 22:45:12      阅读:108      评论:0      收藏:0      [点我收藏+]

标签:cts   ica   dir   any   The   aci   目的   clu   with   

在gradle中,如果多个子项目使用目录进行分组,可以使用如下方法

// include two projects, ‘foo‘ and ‘foo:bar‘
// directories are inferred by replacing ‘:‘ with ‘/‘
include ‘foo:bar‘

// include one project whose project dir does not match the logical project path
include ‘baz‘
project(‘:baz‘).projectDir = file(‘foo/baz‘)

// include many projects whose project dirs do not match the logical project paths
file(‘subprojects‘).eachDir { dir ->
  include dir.name
  project(":${dir.name}").projectDir = dir
}

参考文档

https://docs.gradle.org/5.6.4/dsl/org.gradle.api.initialization.Settings.html#org.gradle.api.initialization.Settings:include

gradle 中项目的多目录组织形式

标签:cts   ica   dir   any   The   aci   目的   clu   with   

原文地址:https://www.cnblogs.com/warrior/p/13356664.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!