Skip to content

Commit

Permalink
Release 1.6.6 available on Sonatype
Browse files Browse the repository at this point in the history
  • Loading branch information
ThanosFisherman committed Sep 22, 2021
1 parent 8df6206 commit ac6d725
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 76 deletions.
6 changes: 3 additions & 3 deletions buildSrc/src/main/kotlin/Artifact.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import kotlin.collections.LinkedHashMap
object Artifact {

val ARTIFACT_NAME = "wifiutils"
val ARTIFACT_GROUP = "com.thanosfisherman.wifiutils"
val VERSION_NAME = "1.6.5"
val VERSION_CODE = 22
val ARTIFACT_GROUP = "io.github.thanosfisherman.wifiutils"
val VERSION_NAME = "1.6.6"
val VERSION_CODE = 23
val POM_URL = "https://github.com/ThanosFisherman/WifiUtils"
val POM_SCM_URL = "https://github.com/ThanosFisherman/WifiUtils"
val POM_SCM_CONNECTION = "scm:git:github.com/ThanosFisherman/WifiUtils.git"
Expand Down
148 changes: 75 additions & 73 deletions wifiutils/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -77,88 +77,90 @@ artifacts {

credentialsMap.forEach { extra.set(it.key, it.value) }

publishing {
publications {
create<MavenPublication>(Artifact.ARTIFACT_NAME) {
groupId = Artifact.ARTIFACT_GROUP
artifactId = Artifact.ARTIFACT_NAME
version = Artifact.VERSION_NAME

if (project.plugins.findPlugin("com.android.library") != null) {
artifact("$buildDir/outputs/aar/${project.name}-release.aar")
} else {
from(components["java"])
//artifact("$buildDir/libs/${project.getName()}-${version}.jar")
}
artifacts {
artifact(sourcesJar)
artifact(dokkaJar)
}
afterEvaluate {
publishing {
publications {
create<MavenPublication>(Artifact.ARTIFACT_NAME) {
groupId = Artifact.ARTIFACT_GROUP
artifactId = Artifact.ARTIFACT_NAME
version = Artifact.VERSION_NAME

if (project.plugins.findPlugin("com.android.library") != null) {
artifact("$buildDir/outputs/aar/${project.name}-debug.aar")
} else {
from(components["java"])
//artifact("$buildDir/libs/${project.getName()}-${version}.jar")
}
artifacts {
artifact(sourcesJar)
artifact(dokkaJar)
}

pom {
name.set(Artifact.LIBRARY_NAME)
description.set(Artifact.POM_DESC)
url.set(Artifact.POM_URL)
licenses {
license {
name.set(Artifact.POM_LICENSE_NAME)
url.set(Artifact.POM_LICENSE_URL)
distribution.set(Artifact.POM_URL)
pom {
name.set(Artifact.LIBRARY_NAME)
description.set(Artifact.POM_DESC)
url.set(Artifact.POM_URL)
licenses {
license {
name.set(Artifact.POM_LICENSE_NAME)
url.set(Artifact.POM_LICENSE_URL)
distribution.set(Artifact.POM_URL)
}
}
}
developers {
developer {
id.set(Artifact.POM_DEVELOPER_ID)
name.set(Artifact.POM_DEVELOPER_NAME)
email.set(Artifact.DEVELOPER_EMAIL)
developers {
developer {
id.set(Artifact.POM_DEVELOPER_ID)
name.set(Artifact.POM_DEVELOPER_NAME)
email.set(Artifact.DEVELOPER_EMAIL)
}
}
}
scm {
connection.set(Artifact.POM_SCM_CONNECTION)
developerConnection.set(Artifact.POM_SCM_DEV_CONNECTION)
url.set(Artifact.POM_SCM_URL)
}
repositories {
maven {
// change URLs to point to your repos, e.g. http://my.org/repo
val releasesRepoUrl = uri(Artifact.RELEASE_REPO_URL)
val snapshotsRepoUrl = uri(Artifact.SNAPSHOT_REPO_URL)
name = Artifact.REPO_NAME
url = if (version.toString()
.endsWith("SNAPSHOT")
) snapshotsRepoUrl else releasesRepoUrl
credentials {
username = credentialsMap["ossrhUsername"]
password = credentialsMap["ossrhPassword"]
scm {
connection.set(Artifact.POM_SCM_CONNECTION)
developerConnection.set(Artifact.POM_SCM_DEV_CONNECTION)
url.set(Artifact.POM_SCM_URL)
}
repositories {
maven {
// change URLs to point to your repos, e.g. http://my.org/repo
val releasesRepoUrl = uri(Artifact.RELEASE_REPO_URL)
val snapshotsRepoUrl = uri(Artifact.SNAPSHOT_REPO_URL)
name = Artifact.REPO_NAME
url = if (version.toString()
.endsWith("SNAPSHOT")
) snapshotsRepoUrl else releasesRepoUrl
credentials {
username = credentialsMap["ossrhUsername"]
password = credentialsMap["ossrhPassword"]
}
}
}
}

// hack if you wanna include any transitive dependencies. I'm a hackur indeed
/* withXml {
asNode().apply {
appendNode("description", Artifact.POM_DESC)
appendNode("name", Artifact.LIBRARY_NAME)
appendNode("url", Artifact.POM_URL)
appendNode("licenses").appendNode("license").apply {
appendNode("name", Artifact.POM_LICENSE_NAME)
appendNode("url", Artifact.POM_LICENSE_URL)
appendNode("distribution", Artifact.POM_LICENSE_DIST)
}
appendNode("developers").appendNode("developer").apply {
appendNode("id", Artifact.POM_DEVELOPER_ID)
appendNode("name", Artifact.POM_DEVELOPER_NAME)
// hack if you wanna include any transitive dependencies. I'm a hackur indeed
/* withXml {
asNode().apply {
appendNode("description", Artifact.POM_DESC)
appendNode("name", Artifact.LIBRARY_NAME)
appendNode("url", Artifact.POM_URL)
appendNode("licenses").appendNode("license").apply {
appendNode("name", Artifact.POM_LICENSE_NAME)
appendNode("url", Artifact.POM_LICENSE_URL)
appendNode("distribution", Artifact.POM_LICENSE_DIST)
}
appendNode("developers").appendNode("developer").apply {
appendNode("id", Artifact.POM_DEVELOPER_ID)
appendNode("name", Artifact.POM_DEVELOPER_NAME)
}
appendNode("scm").apply {
appendNode("url", Artifact.POM_SCM_URL)
}
}
appendNode("scm").apply {
appendNode("url", Artifact.POM_SCM_URL)
}
}
}*/
}*/
}
}
}
}
}
signing {
sign(publishing.publications[Artifact.ARTIFACT_NAME])
}

signing {
sign(publishing.publications[Artifact.ARTIFACT_NAME])
}

0 comments on commit ac6d725

Please sign in to comment.