34 lines
1.4 KiB
Groovy
34 lines
1.4 KiB
Groovy
/*
|
|
* Copyright 2020 MovingBlocks
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* https://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/
|
|
|
|
// This magically allows subdirs in this subproject to themselves become sub-subprojects in a proper tree structure
|
|
new File(rootDir, 'modules').eachDir { possibleSubprojectDir ->
|
|
def subprojectName = ':modules:' + possibleSubprojectDir.name
|
|
File buildFile = new File(possibleSubprojectDir, "build.gradle")
|
|
File moduleTxt = new File(possibleSubprojectDir, "module.txt")
|
|
if (!buildFile.exists()) {
|
|
logger.warn("***** WARNING: Found a module without a build.gradle, corrupt dir? NOT including $subprojectName *****")
|
|
return
|
|
}
|
|
if (!moduleTxt.exists()) {
|
|
logger.warn("Module $subprojectName has build.gradle, but no module.txt? NOT including $subprojectName")
|
|
return
|
|
}
|
|
logger.info("Module {} has a build file so counting it complete and including it", subprojectName)
|
|
include subprojectName
|
|
}
|
|
|