Skip to content
This repository was archived by the owner on Aug 30, 2023. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import com.diffplug.spotless.LineEnding
import com.jfrog.bintray.gradle.BintrayExtension
import com.jfrog.bintray.gradle.tasks.BintrayPublishTask
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.api.tasks.testing.logging.TestLogEvent

plugins {
`java-library`
id("com.diffplug.gradle.spotless") version Config.QualityPlugins.spotlessVersion apply true
id(Config.PublishPlugins.bintrayPlugin) version Config.PublishPlugins.bintrayVersion apply true
jacoco
}

Expand Down Expand Up @@ -34,6 +37,7 @@ allprojects {
}
group = "io.sentry"
version = "2.0.0-SNAPSHOT"
description = "SDK for sentry.io"
tasks {
withType<Test> {
testLogging.showStandardStreams = true
Expand Down
5 changes: 5 additions & 0 deletions buildSrc/src/main/java/Config.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ object Config {
val kotlinGradlePlugin = "gradle-plugin"
}

object PublishPlugins {
val bintrayPlugin = "com.jfrog.bintray"
val bintrayVersion = "1.8.4"
}

object Android {
private val sdkVersion = 29

Expand Down
63 changes: 63 additions & 0 deletions sentry-core/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
import com.jfrog.bintray.gradle.tasks.BintrayPublishTask
import com.jfrog.bintray.gradle.tasks.BintrayUploadTask
import org.gradle.api.publish.PublishingExtension

plugins {
`java-library`
`maven-publish`
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@marandaneto I guess merging #70 will affect this bit

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not a problem

signing
kotlin("jvm")
jacoco
id("net.ltgt.errorprone")
id(Config.PublishPlugins.bintrayPlugin)
}

dependencies {
Expand Down Expand Up @@ -49,4 +56,60 @@ tasks {
dependsOn(jacocoTestCoverageVerification)
dependsOn(jacocoTestReport)
}

withType<BintrayUploadTask> {
bintray {
user = System.getenv("BINTRAY_USER")
key = System.getenv("BINTRAY_KEY")
with(pkg) {
repo = "mvn"
name = project.name
userOrg = "getsentry"
setLicenses("MIT")
websiteUrl = "https://sentry.io"
vcsUrl = "https://github.com/getsentry/sentry-android"
setLabels("sentry", "getsentry", "error-tracking", "crash-reporting")
with(version) {
name = project.version.toString()
vcsTag = project.version.toString()
desc = project.description.toString()
}
}
println("version: $version")
setPublications(project.name)
}
}
}

publishing {
publications {
register(project.name, MavenPublication::class) {
if (project.hasProperty("android")) {
artifact("$buildDir/outputs/aar/${project.name}-release.aar")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the sentry-core module, we don't need android stuff in here

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, this is all very provisional. It will all move to the main gradle file

} else {
from(components["java"])
}
groupId = project.group.toString()
artifactId = project.name
version = project.version.toString()
// artifact(sourcesJar)
// artifact(javadocJar)

if (project.hasProperty("android")) {
pom {
withXml {
asNode().appendNode("dependencies").let { depNode ->
configurations.implementation.get().allDependencies.forEach {
depNode.appendNode("dependency").apply {
appendNode("groupId", it.group)
appendNode("artifactId", it.name)
appendNode("version", it.version)
}
}
}
}
}
}
}
}
}
2 changes: 1 addition & 1 deletion sentry-sample/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import org.jetbrains.kotlin.config.KotlinCompilerVersion
plugins {
id("com.android.application")
kotlin("android")
// id("io.sentry.android.gradle") how to add sentry gradle plugin
id(Config.PublishPlugins.bintrayPlugin)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should go into the modules that would be published, not in the sample app.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right, just playing around. Draft PR

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll add a description of the goal

}

android {
Expand Down