Skip to content

Commit

Permalink
Merge a32b3f7 into ec993b6
Browse files Browse the repository at this point in the history
  • Loading branch information
romtsn authored May 14, 2024
2 parents ec993b6 + a32b3f7 commit df921fc
Show file tree
Hide file tree
Showing 7 changed files with 83 additions and 85 deletions.
88 changes: 44 additions & 44 deletions .craft.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
minVersion: 0.29.3
changelogPolicy: auto
targets:
- name: symbol-collector
includeNames: /libsentry(-android)?\.so/
batchType: android
bundleIdPrefix: sentry-android-ndk-
# - name: symbol-collector
# includeNames: /libsentry(-android)?\.so/
# batchType: android
# bundleIdPrefix: sentry-android-ndk-
- name: maven
includeNames: /^sentry.*$/
gradleCliPath: ./gradlew
Expand All @@ -16,43 +16,43 @@ targets:
distDirRegex: /^(sentry-android-|.*-android).*$/
fileReplaceeRegex: /\d+\.\d+\.\d+(-\w+(\.\d+)?)?(-SNAPSHOT)?/
fileReplacerStr: release.aar
- name: github
excludeNames: /^libsentry.*\.so$/
- name: registry
sdks:
maven:io.sentry:sentry:
maven:io.sentry:sentry-spring:
maven:io.sentry:sentry-spring-jakarta:
maven:io.sentry:sentry-spring-boot:
maven:io.sentry:sentry-spring-boot-jakarta:
maven:io.sentry:sentry-spring-boot-starter:
maven:io.sentry:sentry-spring-boot-starter-jakarta:
maven:io.sentry:sentry-servlet:
maven:io.sentry:sentry-servlet-jakarta:
maven:io.sentry:sentry-logback:
maven:io.sentry:sentry-log4j2:
maven:io.sentry:sentry-jul:
maven:io.sentry:sentry-apache-http-client-5:
maven:io.sentry:sentry-android:
maven:io.sentry:sentry-android-core:
maven:io.sentry:sentry-android-ndk:
maven:io.sentry:sentry-android-timber:
maven:io.sentry:sentry-android-okhttp:
maven:io.sentry:sentry-kotlin-extensions:
maven:io.sentry:sentry-android-fragment:
maven:io.sentry:sentry-bom:
maven:io.sentry:sentry-openfeign:
maven:io.sentry:sentry-opentelemetry-agent:
maven:io.sentry:sentry-opentelemetry-agentcustomization:
maven:io.sentry:sentry-opentelemetry-core:
maven:io.sentry:sentry-apollo:
maven:io.sentry:sentry-jdbc:
maven:io.sentry:sentry-graphql:
maven:io.sentry:sentry-quartz:
maven:io.sentry:sentry-okhttp:
maven:io.sentry:sentry-android-navigation:
maven:io.sentry:sentry-compose:
maven:io.sentry:sentry-compose-android:
maven:io.sentry:sentry-compose-desktop:
maven:io.sentry:sentry-apollo-3:
maven:io.sentry:sentry-android-sqlite:
# - name: github
# excludeNames: /^libsentry.*\.so$/
# - name: registry
# sdks:
# maven:io.sentry:sentry:
# maven:io.sentry:sentry-spring:
# maven:io.sentry:sentry-spring-jakarta:
# maven:io.sentry:sentry-spring-boot:
# maven:io.sentry:sentry-spring-boot-jakarta:
# maven:io.sentry:sentry-spring-boot-starter:
# maven:io.sentry:sentry-spring-boot-starter-jakarta:
# maven:io.sentry:sentry-servlet:
# maven:io.sentry:sentry-servlet-jakarta:
# maven:io.sentry:sentry-logback:
# maven:io.sentry:sentry-log4j2:
# maven:io.sentry:sentry-jul:
# maven:io.sentry:sentry-apache-http-client-5:
# maven:io.sentry:sentry-android:
# maven:io.sentry:sentry-android-core:
# maven:io.sentry:sentry-android-ndk:
# maven:io.sentry:sentry-android-timber:
# maven:io.sentry:sentry-android-okhttp:
# maven:io.sentry:sentry-kotlin-extensions:
# maven:io.sentry:sentry-android-fragment:
# maven:io.sentry:sentry-bom:
# maven:io.sentry:sentry-openfeign:
# maven:io.sentry:sentry-opentelemetry-agent:
# maven:io.sentry:sentry-opentelemetry-agentcustomization:
# maven:io.sentry:sentry-opentelemetry-core:
# maven:io.sentry:sentry-apollo:
# maven:io.sentry:sentry-jdbc:
# maven:io.sentry:sentry-graphql:
# maven:io.sentry:sentry-quartz:
# maven:io.sentry:sentry-okhttp:
# maven:io.sentry:sentry-android-navigation:
# maven:io.sentry:sentry-compose:
# maven:io.sentry:sentry-compose-android:
# maven:io.sentry:sentry-compose-desktop:
# maven:io.sentry:sentry-apollo-3:
# maven:io.sentry:sentry-android-sqlite:
11 changes: 1 addition & 10 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -160,16 +160,7 @@ subprojects {
if (this@subprojects.name.contains("-compose")) {
this.configureForMultiplatform(this@subprojects)
} else {
this.getByName("main").contents {
// non android modules
from("build${sep}libs")
from("build${sep}publications${sep}maven")
// android modules
from("build${sep}outputs${sep}aar") {
include("*-release*")
}
from("build${sep}publications${sep}release")
}
this.configureForJvm(this@subprojects)
}
// craft only uses zip archives
this.forEach { dist ->
Expand Down
35 changes: 34 additions & 1 deletion buildSrc/src/main/java/Publication.kt
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,12 @@ private object Consts {
// configure distZip tasks for multiplatform
fun DistributionContainer.configureForMultiplatform(project: Project) {
val sep = File.separator
val version = project.properties["versionName"].toString()

this.maybeCreate("android").contents {
from("build${sep}publications${sep}androidRelease")
from("build${sep}publications${sep}androidRelease") {
renameModule(project.name, version = version)
}
from("build${sep}outputs${sep}aar") {
include("*-release*")
rename {
Expand Down Expand Up @@ -53,6 +56,26 @@ fun DistributionContainer.configureForMultiplatform(project: Project) {
project.tasks.getByName("distZip").finalizedBy(*platformDists)
}

fun DistributionContainer.configureForJvm(project: Project) {
val sep = File.separator
val version = project.properties["versionName"].toString()

this.getByName("main").contents {
// non android modules
from("build${sep}libs")
from("build${sep}publications${sep}maven") {
renameModule(project.name, version = version)
}
// android modules
from("build${sep}outputs${sep}aar") {
include("*-release*")
}
from("build${sep}publications${sep}release") {
renameModule(project.name, version = version)
}
}
}

private fun CopySpec.withJavadoc(renameTo: String = "compose") {
include("*javadoc*")
rename {
Expand All @@ -63,3 +86,13 @@ private fun CopySpec.withJavadoc(renameTo: String = "compose") {
}
}
}

private fun CopySpec.renameModule(projectName: String, renameTo: String = "", version: String) {
var target = ""
if (renameTo.isNotEmpty()) {
target = "-$renameTo"
}
rename {
it.replace("module.json", "$projectName$target-$version.module")
}
}
1 change: 1 addition & 0 deletions sentry-android-core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ dependencies {
compileOnly(projects.sentryAndroidFragment)
compileOnly(projects.sentryAndroidTimber)
compileOnly(projects.sentryCompose)
compileOnly(projects.sentryComposeHelper)

// lifecycle processor, session tracking
implementation(Config.Libs.lifecycleProcess)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ dependencies {
if (applySentryIntegrations) {
implementation(projects.sentryAndroid)
implementation(projects.sentryCompose)
implementation(projects.sentryComposeHelper)
} else {
implementation(projects.sentryAndroidCore)
}
Expand Down
31 changes: 1 addition & 30 deletions sentry-compose/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ kotlin {
compileOnly(compose.runtime)
compileOnly(compose.ui)

api(projects.sentryComposeHelper)
compileOnly(projects.sentryComposeHelper)
}
}
val androidMain by getting {
Expand Down Expand Up @@ -149,32 +149,3 @@ dependencies {
tasks.withType<LibraryAarJarsTask> {
mainScopeClassFiles.setFrom(embedComposeHelperConfig)
}

// we embed the sentry-compose-helper classes to the same .jar above
// so we need to exclude the dependency from the .pom publication and .module metadata
configure<PublishingExtension> {
publications.withType(MavenPublication::class.java).all {
this.pom {
this.withXml {
(asNode().get("dependencies") as NodeList)
.flatMap {
if (it is Node) it.children() else NodeList()
}
.filterIsInstance<Node>()
.filter { dependency ->
val artifactIdNodes = dependency.get("artifactId") as NodeList
artifactIdNodes.any {
(it is Node && it.value().toString().contains("sentry-compose-helper"))
}
}
.forEach { dependency ->
dependency.parent().remove(dependency)
}
}
}
}
}

tasks.withType<GenerateModuleMetadata> {
enabled = false
}
1 change: 1 addition & 0 deletions sentry-samples/sentry-samples-android/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ dependencies {
implementation(projects.sentryAndroidFragment)
implementation(projects.sentryAndroidTimber)
implementation(projects.sentryCompose)
implementation(projects.sentryComposeHelper)
implementation(Config.Libs.fragment)
implementation(Config.Libs.timber)

Expand Down

0 comments on commit df921fc

Please sign in to comment.