Created
April 15, 2024 15:27
-
-
Save LethalMaus/ff83a129032b9d4b2ccc98b857d6179b to your computer and use it in GitHub Desktop.
artifactory2.build.gradle.kts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| plugins { | |
| apply(plugin = "com.jfrog.artifactory") | |
| apply(plugin = "maven-publish") | |
| } | |
| val sourcesJar by tasks.creating(Jar::class) { | |
| archiveClassifier.set("sources") | |
| from("src/main/java") | |
| } | |
| configure<PublishingExtension> { | |
| publications { | |
| register<MavenPublication>("aar") { | |
| groupId = "<modules_group_id>" // dev.jamescullimore | |
| artifactId = project.name // elchem | |
| version = "<version>" // 3.0.0 | |
| artifact("${layout.buildDirectory.get()}/outputs/aar/${project.name}-release.aar") | |
| artifact(sourcesJar) | |
| withXml { | |
| asNode().appendNode("dependencies").let { | |
| // swap "implementation" with "api" if needed | |
| for (dependency in configurations["implementation"].dependencies) { | |
| it.appendNode("dependency").apply { | |
| appendNode("groupId", dependency.group) | |
| appendNode("artifactId", dependency.name) | |
| appendNode("version", dependency.version) | |
| } | |
| } | |
| } | |
| } | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment