Skip to content
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

ISSUE-137: Redefine plugin artifact to work with gradle plugin DSL #208

Merged
merged 3 commits into from
Jun 1, 2024

Conversation

DanielJette
Copy link
Contributor

@DanielJette DanielJette commented Mar 24, 2024

What does this change accomplish?

Resolves #137

How have you achieved it?

After much experimentation, the solution to properly publish the plugin seems to have been to rename the artifact to dev.testify.gradle.plugin (previously just plugin). This allows the plugin to conform to the Plugin DSL .

Scope of Impact and Testing instructions

  1. Check out this branch (137-gradle-plugin)
  2. Publish the Gradle Plugin to the local Maven repository (./gradlew Plugin:publishToMavenLocal)
  3. Create a new Android app project in Android Studio
  4. Edit the settings.gradle.kts to reference mavenLocal()
  5. Edit the root build.gradle.kts:
    plugins {
        id("dev.testify") version "2.0.0" apply false
    }
  6. Edit the app build.gradle.kts:
    plugins {
        id("dev.testify")
    }
  7. Gradle sync and verify that it configures correctly
  8. Open the ExampleInstrumentedTest and add a new test:
    @get:Rule val rule = ScreenshotRule(MainActivity::class.java)
    
    @ScreenshotInstrumentation
    @Test
    fun default() {
        rule.assertSame()
    }
  9. Verify ./gradlew app:screenshotRecord
  10. Verify ./gradlew app:screenshotTest

Alternatively, I have also published this as a preview build. You can test this out by setting the version to 3.0.0-preview04

Notice

Warning

This change must keep main in a shippable state; it may be shipped without further notice.

@AndroidTestifyBot
Copy link
Contributor

AndroidTestifyBot commented Mar 24, 2024

✅ Success! - Legacy Sample screenshot test results

View build for commit b260dbb

@AndroidTestifyBot
Copy link
Contributor

AndroidTestifyBot commented Mar 24, 2024

✅ Success! - Flix Sample screenshot test results

View build for commit b260dbb

@AndroidTestifyBot
Copy link
Contributor

AndroidTestifyBot commented Mar 24, 2024

✅ Success! - Flix Library screenshot test results

View build for commit b260dbb

@DanielJette DanielJette changed the title Define plugin meta-inf with java-gradle-plugin ISSUE-137: Define plugin meta-inf with java-gradle-plugin Mar 24, 2024
@DanielJette DanielJette temporarily deployed to Central Repository Deployment May 19, 2024 20:38 — with GitHub Actions Inactive
@DanielJette DanielJette temporarily deployed to Central Repository Deployment May 19, 2024 21:30 — with GitHub Actions Inactive
@DanielJette DanielJette temporarily deployed to Central Repository Deployment May 19, 2024 22:36 — with GitHub Actions Inactive
@DanielJette DanielJette temporarily deployed to Central Repository Deployment May 19, 2024 23:20 — with GitHub Actions Inactive
@DanielJette DanielJette deployed to Central Repository Deployment May 25, 2024 20:22 — with GitHub Actions Active
@DanielJette DanielJette marked this pull request as ready for review May 26, 2024 17:27
@DanielJette DanielJette requested review from jaredh and a team May 26, 2024 17:28
@DanielJette
Copy link
Contributor Author

@jaredh This seems to work fine without the java-gradle-plugin

@DanielJette DanielJette changed the title ISSUE-137: Define plugin meta-inf with java-gradle-plugin ISSUE-137: Define plugin artifact to work with gradle plugin DSL May 26, 2024
@DanielJette DanielJette changed the title ISSUE-137: Define plugin artifact to work with gradle plugin DSL ISSUE-137: Redefine plugin artifact to work with gradle plugin DSL May 27, 2024
@DanielJette DanielJette merged commit 51d2049 into main Jun 1, 2024
2 checks passed
@DanielJette DanielJette deleted the 137-gradle-plugin branch June 1, 2024 15:22
@DanielJette DanielJette mentioned this pull request Jun 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Plugin [id: 'dev.testify', version: '2.0.0-beta01'] was not found in any of the following sources.
3 participants