@@ -61,34 +61,34 @@ abstract class ResourceConfigurationVariants @Inject constructor(
61
61
62
62
with (resourceConfigurationVariant) {
63
63
64
- val theConsumableConfigurationName =
65
- consumableConfigurationName.get()
66
- val theResourceDirectory = resourceDirectory.get()
64
+ if (resourceDirectory.get().asFile.exists()) {
67
65
68
- // Create a variant-aware consumable configuration for this resource
69
- // configuration's artifacts.
70
- @Suppress(" UnstableApiUsage" )
71
- project.configurations.consumable(theConsumableConfigurationName) {
72
- // TODO: Remove debug logging.
73
- logger.warn(
74
- " Configuring $theConsumableConfigurationName ..." ,
75
- RuntimeException (" Configuration configureAction stacktrace" )
76
- )
66
+ val theConsumableConfigurationName =
67
+ consumableConfigurationName.get()
77
68
78
- attributes {
79
- applyVariantAttributes()
80
- }
81
- }
69
+ // Create a variant-aware consumable configuration for this resource
70
+ // configuration's artifacts.
71
+ @Suppress(" UnstableApiUsage" )
72
+ project.configurations.consumable(theConsumableConfigurationName) {
73
+ // TODO: Remove debug logging.
74
+ logger.warn(
75
+ " Configuring $theConsumableConfigurationName ..." ,
76
+ RuntimeException (" Configuration configureAction stacktrace" )
77
+ )
78
+
79
+ attributes {
80
+ applyVariantAttributes()
81
+ }
82
82
83
- // Any files in "src/main/<resourceConfigurationName>/" are
84
- // resources for this configuration. No build step is necessary, so
85
- // directly add the directory as a project artifact.
86
- if (theResourceDirectory.asFile.exists()) {
87
- project.artifacts.add(
88
- theConsumableConfigurationName,
89
- theResourceDirectory
90
- ) {
91
- type = JVM_RESOURCES_DIRECTORY
83
+ // Any files in "src/main/<resourceConfigurationName>/" are
84
+ // resources for this configuration. No build step is necessary,
85
+ // so directly add the directory as a project artifact.
86
+ project.artifacts.add(
87
+ theConsumableConfigurationName,
88
+ resourceDirectory
89
+ ) {
90
+ type = JVM_RESOURCES_DIRECTORY
91
+ }
92
92
}
93
93
}
94
94
}
0 commit comments