Reputation: 1527
I have the below code running in build.gradle
file. I want to convert it into build.gradle.kts
.
plugins {
...
id 'maven-publish'
}
android {
....
publishing {
singleVariant("release")
}
}
dependencies {
...
}
afterEvaluate {
publishing {
publications {
release(MavenPublication) {
groupId = 'com.arnab.storage'
artifactId = 'Storage'
version = "${project.ext.version.major}.${project.ext.version.minor}.${project.ext.version.build}"
pom {
name = 'Android library for Storage system'
description = 'Useful library to help Android developers to work with Files in Android 10 and higher verison'
}
afterEvaluate {
from components.release
}
}
}
}
}
Upvotes: 0
Views: 39
Reputation: 1527
The converted build.gradle.kts
file code will be some thing like this.
plugins {
...
id("maven-publish")
}
android {
...
publishing {
singleVariant("release")
}
}
dependencies {
...
}
afterEvaluate {
publishing {
publications {
create<MavenPublication>("release") {
groupId = "com.arnab.storage"
artifactId = "Storage"
version = "${project.ext["major"]}.${project.ext["minor"]}.${project.ext["build"]}"
pom {
name.set("Android library for Storage system")
description.set("Useful library to help Android developers to work with Files in Android 10 and higher version")
}
afterEvaluate {
from(components["release"])
}
}
}
}
}
Upvotes: 0