Skip to content
This repository has been archived by the owner on Jan 3, 2025. It is now read-only.

Commit

Permalink
Fixed maven-publish plugin to include Elvis on pom.xml file.
Browse files Browse the repository at this point in the history
  • Loading branch information
ThanosFisherman committed Sep 17, 2020
1 parent c00a2d2 commit 79ee2b7
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
6 changes: 3 additions & 3 deletions buildSrc/src/main/kotlin/AndroidConfig.kt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ interface BuildType {

val isMinifyEnabled: Boolean
val isShrinkResources: Boolean
val manifestPlaceholders : Map<String,String>
val manifestPlaceholders: Map<String, String>
val isDebuggable: Boolean
}

Expand All @@ -28,8 +28,8 @@ object BuildTypeDebug : BuildType {
}

object BuildTypeRelease : BuildType {
override val isMinifyEnabled = true
override val isShrinkResources = true
override val isMinifyEnabled = false
override val isShrinkResources = false
override val isDebuggable = false
override val manifestPlaceholders = mapOf("crashlyticsEnabled" to "true", "performanceEnabled" to "true")
}
Expand Down
19 changes: 16 additions & 3 deletions wifiutils/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -77,19 +77,19 @@ val sourcesJar by tasks.creating(Jar::class) {
from(android.sourceSets.getByName("main").java.srcDirs)
}

val artifactDir = "$buildDir/outputs/aar/${project.name}-debug.aar"
val artifactDir = "$buildDir/outputs/aar/${project.name}-release.aar"

publishing {
publications {
create<MavenPublication>(Artifact.ARTIFACT_NAME) {
//from(components["java"]) kinda broken on android
groupId = Artifact.ARTIFACT_GROUP
artifactId = Artifact.ARTIFACT_NAME
version = Artifact.VERSION_NAME
//from(components["java"])
artifacts {
artifact(artifactDir)
artifact(sourcesJar)
artifact(dokkaJar)
artifact(artifactDir)
}

pom.withXml {
Expand All @@ -110,6 +110,19 @@ publishing {
appendNode("url", Artifact.POM_SCM_URL)
}
}
val dependenciesNode = asNode().appendNode("dependencies")
val configurationNames = arrayOf("implementation")
configurationNames.forEach { configurationName ->
configurations[configurationName].allDependencies.distinct().forEach {
if (it.group != null && it.name != null) {
val dependencyNode = dependenciesNode.appendNode("dependency")
dependencyNode.appendNode("groupId", it.group)
dependencyNode.appendNode("artifactId", it.name)
dependencyNode.appendNode("version", it.version)
dependencyNode.appendNode("scope", "runtime")
}
}
}
}
}
}
Expand Down

0 comments on commit 79ee2b7

Please sign in to comment.