feat: jpa, messaging, notification, mongo, graphql 어댑터터 리펙토링
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import groovy.json.JsonSlurper
|
||||
import org.gradle.api.artifacts.ProjectDependency
|
||||
|
||||
def verifyRuntimeModuleMembership = tasks.register('verifyRuntimeModuleMembership') {
|
||||
group = 'verification'
|
||||
@@ -107,22 +106,30 @@ def verifyRuntimeModuleMembership = tasks.register('verifyRuntimeModuleMembershi
|
||||
(rawModule as Map<String, Object>).id as String
|
||||
}.toSet()
|
||||
|
||||
Set<String> actual = ['api', 'implementation', 'compileOnly', 'runtimeOnly']
|
||||
.collect { String configurationName ->
|
||||
compositionProject.configurations.findByName(configurationName)
|
||||
}
|
||||
.findAll { it != null }
|
||||
.collectMany { configuration ->
|
||||
configuration.dependencies.withType(ProjectDependency).collect {
|
||||
ProjectDependency dependency ->
|
||||
String dependencyId = moduleIdByGradlePath[dependency.path]
|
||||
if (dependencyId == null) {
|
||||
throw new GradleException(
|
||||
"Runtime composition '${compositionId}' depends on unregistered " +
|
||||
"Gradle project '${dependency.path}'.")
|
||||
}
|
||||
dependencyId
|
||||
// The resolved runtime closure, not the declared dependency list.
|
||||
//
|
||||
// A declared-dependency comparison cannot see a leaf that arrives transitively — a
|
||||
// starter pulling in six internal modules puts all six in the bootJar while the registry
|
||||
// records them as belonging to no runtime at all. The membership list then stays clean
|
||||
// precisely because it is not looking at what ships. Resolving runtimeClasspath asks the
|
||||
// question the jar answers.
|
||||
def runtimeClasspath = compositionProject.configurations.findByName('runtimeClasspath')
|
||||
if (runtimeClasspath == null) {
|
||||
throw new GradleException(
|
||||
"Runtime composition '${compositionId}' has no runtimeClasspath configuration.")
|
||||
}
|
||||
Set<String> actual = runtimeClasspath.incoming.resolutionResult.allComponents
|
||||
.findAll { it.id instanceof org.gradle.api.artifacts.component.ProjectComponentIdentifier }
|
||||
.collect { (it.id as org.gradle.api.artifacts.component.ProjectComponentIdentifier).projectPath }
|
||||
.findAll { String projectPath -> projectPath != compositionProject.path }
|
||||
.collect { String projectPath ->
|
||||
String dependencyId = moduleIdByGradlePath[projectPath]
|
||||
if (dependencyId == null) {
|
||||
throw new GradleException(
|
||||
"Runtime composition '${compositionId}' resolves unregistered " +
|
||||
"Gradle project '${projectPath}' onto its runtime classpath.")
|
||||
}
|
||||
dependencyId
|
||||
}
|
||||
.toSet()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user