0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Androidで、aarを作成する

Androidで、aarを作成する際にkotlinで記載する方法があまりなかったので記事にしたいと思います。
結論としては、下記の記載になります。

build.gradle.kts

plugins {
    alias(libs.plugins.android.library)
    alias(libs.plugins.kotlin.android)
    id("maven-publish")
}

publishing {
    publications {
        register<MavenPublication>("release") {
            groupId = "com.example"
            artifactId = "sample"
            version = "0.0.1"

            afterEvaluate {
                from(components["release"])
            }
        }
    }
    repositories {
        maven {
            url = uri("$rootDir/repository")
        }
    }
}

ビルド

後は、下記でビルドするだけです。
ビルド後、プロジェクト直下にrepositoryディレクトリが作成されて、aarが作成されます。

gradle publishReleaseToRepository
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?