File tree 1 file changed +12
-8
lines changed
1 file changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -34,20 +34,24 @@ buildFiles.each { File buildFile ->
34
34
boolean isKotlin = buildFile. name. endsWith(" .kts" )
35
35
if (isDefaultName) {
36
36
String buildFilePath = buildFile. parentFile. absolutePath
37
- String projectPath = buildFilePath. replace(rootDirPath, ' ' ) . replace( File . separator, ' : ' )
38
- include projectPath
37
+ String projectName = buildFilePath. tokenize( File . separator)[ -1 ]
38
+ configureProject( ' : ' + projectName, projectName, buildFile)
39
39
} else {
40
40
String projectName
41
41
if (isKotlin) {
42
42
projectName = buildFile. name. replace(' .gradle.kts' , ' ' )
43
43
} else {
44
44
projectName = buildFile. name. replace(' .gradle' , ' ' )
45
45
}
46
- String projectPath = ' :' + projectName;
47
- include projectPath
48
- def project = findProject(" ${ projectPath} " )
49
- project. name = projectName
50
- project. projectDir = buildFile. parentFile
51
- project. buildFileName = buildFile. name
46
+ configureProject(' :' + projectName, projectName, buildFile)
52
47
}
53
48
}
49
+
50
+ def configureProject (String projectPath , String projectName , File buildFile ) {
51
+ include(projectPath)
52
+
53
+ def project = findProject(projectPath)
54
+ project. name = projectName
55
+ project. projectDir = buildFile. parentFile
56
+ project. buildFileName = buildFile. name
57
+ }
You can’t perform that action at this time.
0 commit comments