-
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add raw working impl * Update * Update * Update * Update * Update plugin * Update * Update * Update * Update * Update * Updatee * Update doc * Update docs * Remove print * Update * Update * Update comment * Update * Update * Update * Format * Format * Update plugin-build/plugin/src/main/java/io/sentry/kotlin/multiplatform/gradle/plugin/SentryPlugin.kt Co-authored-by: Roman Zavarnitsyn <[email protected]> * check if isStatic in linking * Update plugin build dir name and ID * Add deps only with compileOnly * Update * Updaet * Include gradle plugin version bump * Update project name * Use buildconfig * Remove todo * Change sentry extension name to sentryKmp * Set androidNative to unsupported targets * add symlinks * Update * Update * Update' * Update * Add CI * Add to craft * Remove package.resolved * Format * Update * Update changelog * Enable cocoapods sample * Update * Remove podspec from spm sample * Remove * Format * Update * Fix deps * update * update * Update Changelog * add ~> to version * Add derived data value source for caching * Run test during ci * Update * formatting{ * format * Skip apple specific configs if there are not apple targets * Fix tests * Update CI and skip linker and cocoapods if not macOS host * Format code * update * Update * update * Add compilation test through samples * run allTests for every sample project * Update CHANGELOG.md * Upload codecov report * Default working directory * Use kover 0.7.3 * Update * Update * Update --------- Co-authored-by: Roman Zavarnitsyn <[email protected]> Co-authored-by: Sentry Github Bot <[email protected]>
- Loading branch information
1 parent
91222ef
commit 17a7519
Showing
33 changed files
with
1,142 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
name: "Plugin: sentry-kotlin-multiplatform" | ||
on: | ||
push: | ||
branches: | ||
- main | ||
- release/** | ||
pull_request: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build: | ||
runs-on: macos-latest-xlarge | ||
defaults: | ||
run: | ||
working-directory: sentry-kotlin-multiplatform-gradle-plugin | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: JDK setup | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: 17 | ||
distribution: temurin | ||
|
||
- name: Cached Konan | ||
uses: actions/cache@9b0c1fce7a93df8e3bb8926b0d6e9d89e92f20a7 #v3 | ||
with: | ||
path: ~/.konan | ||
key: ${{ runner.os }}-konan-${{ hashFiles('**/*.gradle*') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }} | ||
restore-keys: ${{ runner.os }}-konan- | ||
|
||
- name: Cached Gradle | ||
uses: gradle/gradle-build-action@842c587ad8aa4c68eeba24c396e15af4c2e9f30a | ||
|
||
- name: Build | ||
run: | | ||
./gradlew build | ||
./gradlew koverXmlReport | ||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@5ecb98a3c6b747ed38dc09f787459979aebb39be # pin@v4 | ||
with: | ||
name: sentry-kotlin-multiplatform-gradle-plugin | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
|
||
archive-distribution: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: JDK setup | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: 17 | ||
distribution: temurin | ||
|
||
- name: Cached Gradle | ||
uses: gradle/gradle-build-action@842c587ad8aa4c68eeba24c396e15af4c2e9f30a | ||
|
||
- name: DistZip | ||
run: | | ||
cd sentry-kotlin-multiplatform-gradle-plugin && ./gradlew distZip | ||
- name: Archive packages | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{ github.sha }} | ||
if-no-files-found: error | ||
path: | | ||
./*/build/distributions/*.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
100 changes: 100 additions & 0 deletions
100
sentry-kotlin-multiplatform-gradle-plugin/build.gradle.kts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
import com.vanniktech.maven.publish.MavenPublishPluginExtension | ||
import io.gitlab.arturbosch.detekt.Detekt | ||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile | ||
|
||
plugins { | ||
alias(libs.plugins.kotlin) | ||
alias(libs.plugins.detekt) | ||
`java-gradle-plugin` | ||
alias(libs.plugins.vanniktech.publish) | ||
id("distribution") | ||
alias(libs.plugins.buildConfig) | ||
alias(libs.plugins.kover) | ||
} | ||
|
||
version = property("versionName").toString() | ||
|
||
group = property("group").toString() | ||
|
||
dependencies { | ||
compileOnly(kotlin("stdlib")) | ||
compileOnly(gradleApi()) | ||
compileOnly(kotlin("gradle-plugin")) | ||
|
||
testImplementation(kotlin("gradle-plugin")) | ||
testImplementation(libs.junit) | ||
testImplementation(libs.junit.params) | ||
testImplementation(libs.mockk) | ||
} | ||
|
||
tasks.test { | ||
useJUnitPlatform() | ||
} | ||
|
||
java { | ||
sourceCompatibility = JavaVersion.VERSION_11 | ||
targetCompatibility = JavaVersion.VERSION_11 | ||
} | ||
|
||
tasks.withType<KotlinCompile> { kotlinOptions { jvmTarget = JavaVersion.VERSION_11.toString() } } | ||
|
||
gradlePlugin { | ||
plugins { | ||
create(property("id").toString()) { | ||
id = property("id").toString() | ||
implementationClass = property("implementationClass").toString() | ||
} | ||
} | ||
} | ||
|
||
val publish = extensions.getByType(MavenPublishPluginExtension::class.java) | ||
// signing is done when uploading files to MC | ||
// via gpg:sign-and-deploy-file (release.kts) | ||
publish.releaseSigningEnabled = false | ||
|
||
tasks.named("distZip").configure { | ||
dependsOn("publishToMavenLocal") | ||
this.doLast { | ||
val distributionFilePath = | ||
"${project.layout.buildDirectory.asFile.get().path}${sep}distributions${sep}${project.name}-${project.version}.zip" | ||
val file = File(distributionFilePath) | ||
if (!file.exists()) { | ||
throw IllegalStateException("Distribution file: $distributionFilePath does not exist") | ||
} | ||
if (file.length() == 0L) { | ||
throw IllegalStateException("Distribution file: $distributionFilePath is empty") | ||
} | ||
} | ||
} | ||
|
||
val sep = File.separator | ||
|
||
distributions { | ||
main { | ||
contents { | ||
from("build${sep}libs") | ||
from("build${sep}publications${sep}maven") | ||
} | ||
} | ||
} | ||
|
||
buildConfig { | ||
useKotlinOutput() | ||
packageName("io.sentry") | ||
className("BuildConfig") | ||
|
||
buildConfigField( | ||
"String", | ||
"SentryCocoaVersion", | ||
provider { "\"${project.property("sentryCocoaVersion")}\"" } | ||
) | ||
} | ||
|
||
detekt { config.setFrom(rootProject.files("../config/detekt/detekt.yml")) } | ||
|
||
tasks.withType<Detekt>().configureEach { | ||
reports { | ||
html.required.set(true) | ||
html.outputLocation.set(file("build/reports/detekt.html")) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
id=io.sentry.kotlin.multiplatform.gradle | ||
implementationClass=io.sentry.kotlin.multiplatform.gradle.SentryPlugin | ||
versionName=0.7.1 | ||
group=io.sentry | ||
# TODO: Update update-cocoa.sh so the cocoa version is auto updated as well | ||
sentryCocoaVersion=8.26.0 |
20 changes: 20 additions & 0 deletions
20
sentry-kotlin-multiplatform-gradle-plugin/gradle/libs.versions.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
[versions] | ||
detekt = "1.23.6" | ||
kotlin = "1.9.23" | ||
pluginPublish = "1.2.1" | ||
buildConfig = "5.3.5" | ||
vanniktechPublish = "0.18.0" | ||
kover = "0.7.3" | ||
|
||
[plugins] | ||
detekt = { id = "io.gitlab.arturbosch.detekt", version.ref = "detekt"} | ||
kotlin = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin"} | ||
pluginPublish = { id = "com.gradle.plugin-publish", version.ref = "pluginPublish"} | ||
vanniktech-publish = { id = "com.vanniktech.maven.publish", version.ref = "vanniktechPublish"} | ||
buildConfig = { id = "com.github.gmazzo.buildconfig", version.ref = "buildConfig"} | ||
kover = { id = "org.jetbrains.kotlinx.kover", version.ref = "kover"} | ||
|
||
[libraries] | ||
junit = "org.junit.jupiter:junit-jupiter-api:5.10.3" | ||
junit-params = "org.junit.jupiter:junit-jupiter-params:5.10.3" | ||
mockk = "io.mockk:mockk:1.13.12" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../gradle/wrapper/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../gradlew |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../gradlew.bat |
15 changes: 15 additions & 0 deletions
15
sentry-kotlin-multiplatform-gradle-plugin/settings.gradle.kts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
pluginManagement { | ||
repositories { | ||
gradlePluginPortal() | ||
mavenCentral() | ||
} | ||
} | ||
|
||
dependencyResolutionManagement { | ||
repositories { | ||
google() | ||
mavenCentral() | ||
} | ||
} | ||
|
||
rootProject.name = "sentry-kotlin-multiplatform-gradle-plugin" |
26 changes: 26 additions & 0 deletions
26
...gradle-plugin/src/main/java/io/sentry/kotlin/multiplatform/gradle/AutoInstallExtension.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package io.sentry.kotlin.multiplatform.gradle | ||
|
||
import org.gradle.api.Project | ||
import org.gradle.api.provider.Property | ||
import javax.inject.Inject | ||
|
||
@Suppress("UnnecessaryAbstractClass") | ||
abstract class AutoInstallExtension @Inject constructor(project: Project) { | ||
private val objects = project.objects | ||
|
||
/** | ||
* Enable auto-installation of the Sentry dependencies through [CocoapodsAutoInstallExtension] | ||
* and [SourceSetAutoInstallExtension]. | ||
* | ||
* Disabling this will prevent the plugin from auto installing any dependency. | ||
* | ||
* Defaults to true. | ||
*/ | ||
val enabled: Property<Boolean> = objects.property(Boolean::class.java).convention(true) | ||
|
||
val cocoapods: CocoapodsAutoInstallExtension = | ||
objects.newInstance(CocoapodsAutoInstallExtension::class.java, project) | ||
|
||
val commonMain: SourceSetAutoInstallExtension = | ||
objects.newInstance(SourceSetAutoInstallExtension::class.java, project) | ||
} |
Oops, something went wrong.