Skip to content

Commit

Permalink
fix: Do not publish test fixtures
Browse files Browse the repository at this point in the history
Closes: #32
  • Loading branch information
osipxd committed May 7, 2024
1 parent fb20467 commit 5492aa9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
### Fixed

- Fixed Preference DataStore saving (#38)
- Test fixtures are excluded from publication (#32)

### Housekeeping

Expand Down
11 changes: 11 additions & 0 deletions buildSrc/src/main/kotlin/convention.publish.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import com.redmadrobot.build.dsl.ossrh
import org.gradle.api.plugins.internal.JavaPluginHelper
import org.gradle.internal.component.external.model.TestFixturesSupport
import org.gradle.jvm.component.internal.DefaultJvmSoftwareComponent

plugins {
id("com.redmadrobot.publish")
Expand All @@ -9,3 +12,11 @@ publishing {
ossrh { credentials(PasswordCredentials::class) }
}
}

// Exclude test fixtures from publication, as we use it only internally
plugins.withId("org.gradle.java-test-fixtures") {
val component = JavaPluginHelper.getJavaComponent(project) as DefaultJvmSoftwareComponent
val feature = component.features.getByName(TestFixturesSupport.TEST_FIXTURES_FEATURE_NAME)
component.withVariantsFromConfiguration(feature.apiElementsConfiguration) { skip() }
component.withVariantsFromConfiguration(feature.runtimeElementsConfiguration) { skip() }
}

0 comments on commit 5492aa9

Please sign in to comment.