Skip to content

Commit

Permalink
Update to snapshots 1.0/gradle plugin 3.0 (#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
rbro112 authored and chromy committed May 31, 2024
1 parent fe37ce5 commit 07c9127
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 17 deletions.
8 changes: 1 addition & 7 deletions android/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.emerge)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.ksp)
alias(libs.plugins.kotlin.serialization)
}

Expand Down Expand Up @@ -99,16 +98,11 @@ dependencies {

testImplementation(libs.junit)

androidTestImplementation(libs.emerge.snapshots)
androidTestImplementation(libs.junit)
androidTestImplementation(libs.androidx.core)
androidTestImplementation(libs.androidx.fragment)
androidTestImplementation(libs.androidx.test.core)
androidTestImplementation(libs.androidx.test.ext.junit)
androidTestImplementation(libs.androidx.test.rules)
androidTestImplementation(libs.emerge.snapshots)

// Generates snapshots for any Previews in the main source set
ksp(libs.emerge.snapshots.processor)
// Generates snapshots for any Previews in the androidTest source set
kspAndroidTest(libs.emerge.snapshots.processor)
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ import com.emergetools.hackernews.ui.items.BuildStory

/**
* Example generated snapshot test from androidTest source set.
* To generate a snapshot test for this preview, add the snapshot-processor as a kspAndroidTest
* dependency.
* To generate a snapshot test for this preview, add the androidTest source set to the debug variant.
*/
@Preview
@Composable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ fun BuildComment(

/**
* Example generated snapshot test from main source set.
* To generate a snapshot test for this preview, add the snapshot-processor as a ksp dependency.
*/
@SnapshotTestingPreviews
@Preview
Expand Down
1 change: 0 additions & 1 deletion android/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@ plugins {
alias(libs.plugins.emerge) apply false
alias(libs.plugins.kotlin.serialization) apply false
alias(libs.plugins.kotlin.android) apply false
alias(libs.plugins.ksp) apply false
}
7 changes: 2 additions & 5 deletions android/gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@ androidx-test-ext = "1.1.5"
accompanist = "0.33.2-alpha"
compose-bom = "2024.02.02"
compose-compiler-extension = "1.5.3"
emerge-gradle-plugin = "2.2.0"
emerge-gradle-plugin = "3.0.0"
emerge-perf = "2.1.1"
emerge-snapshots = "0.8.4"
emerge-snapshots = "1.0.0"
kotlin = "1.9.10"
ksp = "1.9.10-1.0.13"
material-compose = "1.6.3"
navigation-compose = "2.7.7"
junit = "1.1.5"
Expand All @@ -24,7 +23,6 @@ android-test = { id = "com.android.test", version.ref = "agp" }
emerge = { id = "com.emergetools.android", version.ref = "emerge-gradle-plugin" }
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" }

[libraries]
accompanist-navigationanim = { module = "com.google.accompanist:accompanist-navigation-animation", version.ref = "accompanist" }
Expand Down Expand Up @@ -52,7 +50,6 @@ compose-ui-tooling-preview = { group = "androidx.compose.ui", name = "ui-tooling
emerge-perf = { module = "com.emergetools.test:performance", version.ref = "emerge-perf" }
emerge-snapshots = { module = "com.emergetools.snapshots:snapshots", version.ref = "emerge-snapshots" }
emerge-snapshots-annotations = { module = "com.emergetools.snapshots:snapshots-annotations", version.ref = "emerge-snapshots" }
emerge-snapshots-processor = { module = "com.emergetools.snapshots:snapshots-processor", version.ref = "emerge-snapshots" }

junit = "junit:junit:4.13.2"

Expand Down
1 change: 0 additions & 1 deletion android/settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ rootProject.name = "HackerNews"
pluginManagement {
repositories {
gradlePluginPortal()
mavenLocal()
google()
}
}
Expand Down

0 comments on commit 07c9127

Please sign in to comment.