-
-
Notifications
You must be signed in to change notification settings - Fork 19
feat: add plugin support #230
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
82 commits
Select commit
Hold shift + click to select a range
5616413
Add raw working impl
buenaflor 4b48be5
Update
buenaflor 51130b0
Update
buenaflor 3410510
Update
buenaflor 2499417
Update
buenaflor e1ba06b
Update plugin
buenaflor 3937b01
Update
buenaflor 5438066
Update
buenaflor f6b4e7c
Update
buenaflor 429e3b1
Update
buenaflor ed5dce8
Update
buenaflor 99104d4
Updatee
buenaflor 0dbb7f6
Update doc
buenaflor 454f85f
Update docs
buenaflor 5bc7070
Remove print
buenaflor 36aab7b
Update
buenaflor 6ef48aa
Update
buenaflor 0bd2eb9
Update comment
buenaflor 18f7906
Update
buenaflor 5b7ccc0
Update
buenaflor 8f8c587
Update
buenaflor 764eda2
Format
buenaflor de523ac
Format
buenaflor 81b5ab9
Merge branch 'main' into feat/add-plugin
buenaflor 8fa4104
Update plugin-build/plugin/src/main/java/io/sentry/kotlin/multiplatfo…
buenaflor 0cdeace
check if isStatic in linking
buenaflor 6fd5837
Update plugin build dir name and ID
buenaflor f1e31a3
Add deps only with compileOnly
buenaflor 392d336
Update
buenaflor 370a396
Updaet
buenaflor 409ec2f
Include gradle plugin version bump
buenaflor abcce27
Update project name
buenaflor 6108cda
Use buildconfig
buenaflor 5dc9130
Remove todo
buenaflor 38db5e8
Change sentry extension name to sentryKmp
buenaflor fb1ca4b
Set androidNative to unsupported targets
buenaflor d3e2891
add symlinks
buenaflor a2ce288
Update
buenaflor f6afac1
Update
buenaflor 50a9e26
Update'
buenaflor 8b718e3
Update
buenaflor 51d5136
Add CI
buenaflor 87f7a7f
Add to craft
buenaflor 6b0eaa5
Remove package.resolved
buenaflor 2f26925
Format
buenaflor bd2c537
Update
buenaflor 38db1a9
Update changelog
buenaflor 1317545
Enable cocoapods sample
buenaflor e96287a
Update
buenaflor b0b1050
Remove podspec from spm sample
buenaflor 2a5cb18
Remove
buenaflor 0e5253d
Format
buenaflor 20f69c2
Update
buenaflor e2b0937
Fix deps
buenaflor 97eeefe
update
buenaflor f8a1366
update
buenaflor 56ab206
Update Changelog
buenaflor 080ea92
add ~> to version
buenaflor f17244a
Add derived data value source for caching
buenaflor ec6cc7b
Merge branch 'main' into feat/add-plugin
buenaflor 02f132d
Run test during ci
buenaflor c446cb1
Update
buenaflor a34cb65
formatting{
buenaflor e846c9c
format
buenaflor 2c78dfd
Skip apple specific configs if there are not apple targets
buenaflor bdf62f7
Fix tests
buenaflor 87e9183
Update CI and skip linker and cocoapods if not macOS host
buenaflor 8698be5
Format code
getsentry-bot c3615e0
update
buenaflor 9de03d2
Update
buenaflor af6385c
update
buenaflor 6a981a8
Add compilation test through samples
buenaflor a6cf258
run allTests for every sample project
buenaflor 2ddc1cd
Update CHANGELOG.md
buenaflor a1f2d67
Merge branch 'main' into feat/add-plugin
buenaflor ca88300
Upload codecov report
buenaflor d140c9a
Default working directory
buenaflor 92db2b5
Merge branch 'main' into feat/add-plugin
buenaflor 97f9bdd
Use kover 0.7.3
buenaflor d48a901
Update
buenaflor 690eb1b
Update
buenaflor 5720a9a
Update
buenaflor File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.