@@ -108,27 +108,30 @@ internal data class AOSD21(
108108 fun validate (): Component =
109109 apply {
110110 require(id >= 0L ) {
111- " A component's ID must not be negative."
111+ " A component's ID must not be negative, but it is $id ."
112112 }
113113
114114 require(componentName.isNotEmpty()) {
115115 " A component's name length must not be empty."
116116 }
117117
118118 require(componentVersion.length in 1 .. 50 ) {
119- " A component's version length must be in range 1..50."
119+ " A component's version length must be in range 1..50, but '$componentVersion ' has a length of " +
120+ " ${componentVersion.length} ."
120121 }
121122
122123 require(scmUrl.length >= 5 ) {
123- " The SCM or homepage URL must have a length of at least 5."
124+ " The SCM or homepage URL must have a length of at least 5, but '$scmUrl ' has a length of " +
125+ " ${scmUrl.length} ."
124126 }
125127
126128 require(subcomponents.isNotEmpty()) {
127129 " A component must have at least one subcomponent."
128130 }
129131
130- require(subcomponents.first().subcomponentName == FIRST_SUBCOMPONENT_NAME ) {
131- " The first subcomponent must be named 'main'."
132+ val firstSubcomponentName = subcomponents.first().subcomponentName
133+ require(firstSubcomponentName == FIRST_SUBCOMPONENT_NAME ) {
134+ " The first subcomponent must be named 'main', but is it named '$firstSubcomponentName '."
132135 }
133136 }
134137 }
@@ -184,7 +187,8 @@ internal data class AOSD21(
184187 }
185188
186189 require(licenseText.length >= 20 ) {
187- " A subcomponent's license text must have a length of at least 20."
190+ " A subcomponent's license text must have a length of at least 20, but '$licenseText ' has a " +
191+ " length of ${licenseText.length} ."
188192 }
189193
190194 require(selectedLicense.isEmpty() || spdxId.toSpdx().isValidChoice(selectedLicense.toSpdx())) {
0 commit comments