@@ -149,7 +149,7 @@ class CustomGradleDistributionPluginTest {
149
149
150
150
@Test
151
151
fun `when custom single gradle distribution is built with non-default distribution type then it contains base distribution type` () {
152
- val testFiles = withDistributionType( " all " ). doTest(" single-distribution-no-templates" , """
152
+ val testFiles = doTest(" single-distribution-no-templates" , """
153
153
plugins {
154
154
id("tech.harmonysoft.oss.custom-gradle-dist-plugin")
155
155
}
@@ -208,7 +208,7 @@ class CustomGradleDistributionPluginTest {
208
208
209
209
@Test
210
210
fun `when multiple distributions are configured with non-default type then multiple distributions with correct names are created` () {
211
- val testFiles = withDistributionType( " all " ). doTest(" multiple-distributions" , """
211
+ val testFiles = doTest(" multiple-distributions" , """
212
212
plugins {
213
213
id("tech.harmonysoft.oss.custom-gradle-dist-plugin")
214
214
}
@@ -231,7 +231,7 @@ class CustomGradleDistributionPluginTest {
231
231
232
232
@Test
233
233
fun `when custom distribution file name mapper is configured in gradle groovy script then it is respected` () {
234
- val testFiles = withDistributionType( " all " ). prepareInput(" single-distribution-no-templates" , """
234
+ val testFiles = prepareInput(" single-distribution-no-templates" , """
235
235
import tech.harmonysoft.oss.gradle.dist.config.CustomDistributionNameMapper
236
236
237
237
plugins {
@@ -257,7 +257,7 @@ class CustomGradleDistributionPluginTest {
257
257
258
258
@Test
259
259
fun `when custom distribution file name mapper is configured in gradle kotlin script then it is respected` () {
260
- val testFiles = withDistributionType( " all " ). doTest(" single-distribution-no-templates" , """
260
+ val testFiles = doTest(" single-distribution-no-templates" , """
261
261
import tech.harmonysoft.oss.gradle.dist.config.CustomDistributionNameMapper
262
262
plugins {
263
263
id("tech.harmonysoft.oss.custom-gradle-dist-plugin")
@@ -446,8 +446,10 @@ class CustomGradleDistributionPluginTest {
446
446
private fun prepareGradleDistributionZip (projectRootDir : File ) {
447
447
val downloadDir = File (projectRootDir, " build/download" )
448
448
Files .createDirectories(downloadDir.toPath())
449
- val zip = File (downloadDir, " gradle-${GRADLE_VERSION } -${distributionType} .zip" )
450
- createGradleDistributionZip(zip)
449
+ listOf (" bin" , " all" ).forEach {
450
+ val zip = File (downloadDir, " gradle-${GRADLE_VERSION } -${it} .zip" )
451
+ createGradleDistributionZip(zip)
452
+ }
451
453
}
452
454
453
455
private fun createGradleDistributionZip (zip : File ) {
@@ -581,13 +583,6 @@ class CustomGradleDistributionPluginTest {
581
583
verify(testFiles.expectedRootDir, File (testFiles.inputRootDir, buildDistsDir))
582
584
}
583
585
584
- private fun withDistributionType (type : String ): CustomGradleDistributionPluginTest {
585
- distributionType = type
586
- return this
587
- }
588
-
589
- private var distributionType = DEFAULT_DISTRIBUTION_TYPE
590
-
591
586
data class TestFiles (
592
587
val inputRootDir : File ,
593
588
val expectedRootDir : File
0 commit comments