@@ -29,8 +29,8 @@ plugins {
2929}
3030
3131buildScan {
32- setTermsOfServiceUrl( " https://gradle.com/terms-of-service" )
33- setTermsOfServiceAgree( " yes" )
32+ termsOfServiceUrl = " https://gradle.com/terms-of-service"
33+ termsOfServiceAgree = " yes"
3434}
3535
3636// See https://github.com/gradle/kotlin-dsl/issues/607#issuecomment-375687119
@@ -110,8 +110,8 @@ fun Project.configureAndroid() {
110110 isAbortOnError = true
111111
112112 baselineFile = file(" $configDir /lint-baseline.xml" )
113- htmlOutput = file(" $reportsDir /lint-results.html" )
114- xmlOutput = file(" $reportsDir /lint-results.xml" )
113+ // htmlOutput = file("$reportsDir/lint-results.html")
114+ // xmlOutput = file("$reportsDir/lint-results.xml")
115115 }
116116 }
117117}
@@ -298,22 +298,34 @@ fun Project.setupPublishing() {
298298
299299 withXml {
300300 asNode().appendNode(" dependencies" ).apply {
301- fun Dependency.write (scope : String ) = appendNode(" dependency" ).apply {
302- appendNode(" groupId" , group)
303- appendNode(" artifactId" , if (group == groupName) {
304- " firebase-ui-$name "
301+ fun ResolvedDependency.write (scope : String ) = appendNode(" dependency" ).apply {
302+ val publicArtifactId = if (moduleGroup == groupName) {
303+ " firebase-ui-$moduleName "
305304 } else {
306- name
307- })
308- appendNode(" version" , version)
305+ moduleName
306+ }
307+ appendNode(" groupId" , moduleGroup)
308+ appendNode(" artifactId" , publicArtifactId)
309+ appendNode(" version" , moduleVersion)
309310 appendNode(" scope" , scope)
310311 }
311312
312- for (dependency in configurations[" api" ].dependencies) {
313- dependency.write( " compile " )
313+ val apiDependencyNames = configurations[" api" ].dependencies.map {
314+ it.name
314315 }
315- for (dependency in configurations[" implementation" ].dependencies) {
316- dependency.write(" runtime" )
316+
317+ val implementationDependencyNames = configurations[" implementation" ].dependencies.map {
318+ it.name
319+ }
320+
321+ configurations[" releaseCompileClasspath" ].resolvedConfiguration.firstLevelModuleDependencies.forEach {
322+ if (apiDependencyNames.contains(it.moduleName)) {
323+ it.write(" compile" )
324+ }
325+
326+ if (implementationDependencyNames.contains(it.moduleName)) {
327+ it.write(" runtime" )
328+ }
317329 }
318330 }
319331 }
0 commit comments