Skip to content

Commit

Permalink
make a first attempt at adding maven config
Browse files Browse the repository at this point in the history
  • Loading branch information
beekhc committed Sep 25, 2024
1 parent 2f335e2 commit 3711765
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 5 deletions.
26 changes: 26 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,32 @@ jobs:
- checkout
- android/start-emulator-and-run-tests:
system-image: system-images;android-30;google_apis;x86
release-build:
executor:
name: android/android-machine
resource-class: large
tag: default
steps:
- checkout
- android/restore-gradle-cache
- android/restore-build-cache
- run:
name: Assemble release build
command: ./gradlew assembleRelease
- store_artifacts:
path: core/build/outputs/aar
publish_maven:
executor:
name: android/android-machine
resource-class: large
tag: default
steps:
- checkout
- gradle/with_cache:
steps:
- run:
name: "Publish Artifacts to Maven"
command: ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository

workflows:
test:
Expand Down
10 changes: 10 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,14 @@ plugins {
alias(libs.plugins.jetbrains.kotlin.android) apply false
alias(libs.plugins.android.library) apply false
alias(libs.plugins.android.application) apply false
alias(libs.plugins.publish.plugin)
}

nexusPublishing {
repositories {
sonatype {
username.set(System.getenv("OSSRH_USERNAME"))
password.set(System.getenv("OSSRH_PASSWORD"))
}
}
}
18 changes: 18 additions & 0 deletions core/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
plugins {
`maven-publish`
alias(libs.plugins.android.library)
alias(libs.plugins.jetbrains.kotlin.android)
}
Expand All @@ -9,6 +10,9 @@ android {

defaultConfig {
minSdk = 21
aarMetadata {
minCompileSdk = 21
}

buildConfigField("String","HONEYCOMB_DISTRO_VERSION","\"0.0.1-alpha\"")

Expand Down Expand Up @@ -73,3 +77,17 @@ dependencies {
androidTestImplementation(libs.opentelemetry.sdk)
androidTestImplementation(libs.opentelemetry.android.agent)
}

publishing {
publications {
register<MavenPublication>("release") {
groupId = "io.honeycomb.android"
artifactId = "honeycomb-opentelemetry-android"
version = "0.0.1-alpha"

afterEvaluate {
from(components["release"])
}
}
}
}
11 changes: 6 additions & 5 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
[versions]
activityCompose = "1.9.0"
agp = "8.5.0"
composeBom = "2024.04.01"
coreKtx = "1.13.1"
desugarLibs = "2.0.4"
espressoCore = "3.6.1"
junit = "4.13.2"
junitVersion = "1.2.1"
kotlin = "1.9.0"
lifecycleRuntimeKtx = "2.8.3"
mockitoCore = "4.11.0"
mockitoKotlin = "4.1.0"
opentelemetry = "1.38.0"
opentelemetryAndroid = "0.7.0-alpha"
opentelemetryInstrumentation = "2.7.0"
lifecycleRuntimeKtx = "2.8.3"
activityCompose = "1.9.0"
composeBom = "2024.04.01"
publish = "1.3.0"

[libraries]
androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" }
Expand Down Expand Up @@ -44,7 +45,7 @@ androidx-ui-test-junit4 = { group = "androidx.compose.ui", name = "ui-test-junit
androidx-material3 = { group = "androidx.compose.material3", name = "material3" }

[plugins]
android-application = { id = "com.android.application", version.ref = "agp" }
android-library = { id = "com.android.library", version.ref = "agp" }
jetbrains-kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
android-application = { id = "com.android.application", version.ref = "agp" }

publish-plugin = { id = "io.github.gradle-nexus.publish-plugin", version.ref = "publish" }

0 comments on commit 3711765

Please sign in to comment.