@@ -55,12 +55,14 @@ abstract class SettingsPlugin @Inject constructor(
55
55
private fun Settings.configureProjects (extension : SettingsExtension ) {
56
56
// region Include the projects
57
57
58
- val extensionsProjectPath = extension.extensions.projectsPath ? : return
58
+ val extensionsProjectPath = extension.extensions.projectsPath
59
59
60
- objectFactory.fileTree().from(rootDir.resolve(extensionsProjectPath)).matching {
61
- it.include(" **/build.gradle.kts" )
62
- }.forEach {
63
- include(it.relativeTo(rootDir).toPath().joinToString(" :" ))
60
+ if (extensionsProjectPath != null ) {
61
+ objectFactory.fileTree().from(rootDir.resolve(extensionsProjectPath)).matching {
62
+ it.include(" **/build.gradle.kts" )
63
+ }.forEach {
64
+ include(it.relativeTo(rootDir).toPath().joinToString(" :" ))
65
+ }
64
66
}
65
67
66
68
include(extension.patchesProjectPath)
@@ -70,18 +72,20 @@ abstract class SettingsPlugin @Inject constructor(
70
72
// region Apply the plugins
71
73
72
74
gradle.rootProject { rootProject ->
73
- val extensionsProject = try {
74
- rootProject.project(extensionsProjectPath)
75
- } catch (e: UnknownProjectException ) {
76
- return @rootProject
77
- }
75
+ if (extensionsProjectPath != null ) {
76
+ val extensionsProject = try {
77
+ rootProject.project(extensionsProjectPath)
78
+ } catch (e: UnknownProjectException ) {
79
+ null
80
+ }
78
81
79
- extensionsProject.subprojects { extensionProject ->
80
- if (
81
- extensionProject.buildFile.exists() &&
82
- ! extensionProject.parent!! .plugins.hasPlugin(ExtensionPlugin ::class .java)
83
- ) {
84
- extensionProject.pluginManager.apply (ExtensionPlugin ::class .java)
82
+ extensionsProject?.subprojects { extensionProject ->
83
+ if (
84
+ extensionProject.buildFile.exists() &&
85
+ ! extensionProject.parent!! .plugins.hasPlugin(ExtensionPlugin ::class .java)
86
+ ) {
87
+ extensionProject.pluginManager.apply (ExtensionPlugin ::class .java)
88
+ }
85
89
}
86
90
}
87
91
0 commit comments