-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MBS-12124 create new upload-cd-build-result plugin (#1300)
to get rid of CISteps about release
- Loading branch information
Showing
8 changed files
with
260 additions
and
185 deletions.
There are no files selected for viewing
This file contains 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 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
322 changes: 161 additions & 161 deletions
322
subprojects/delivery/upload-cd-build-result/locking/gradle.lockfile
Large diffs are not rendered by default.
Oops, something went wrong.
29 changes: 29 additions & 0 deletions
29
...pload-cd-build-result/src/gradleTest/kotlin/com/avito/cd/UploadCdBuildResultPluginTest.kt
This file contains 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,29 @@ | ||
package com.avito.cd | ||
|
||
import com.avito.test.gradle.TestProjectGenerator | ||
import com.avito.test.gradle.gradlew | ||
import com.avito.test.gradle.module.AndroidAppModule | ||
import com.avito.test.gradle.plugin.plugins | ||
import org.junit.jupiter.api.Test | ||
import org.junit.jupiter.api.io.TempDir | ||
import java.io.File | ||
|
||
internal class UploadCdBuildResultPluginTest { | ||
|
||
@Test | ||
fun `configuration - success`(@TempDir projectDir: File) { | ||
TestProjectGenerator( | ||
modules = listOf( | ||
AndroidAppModule( | ||
name = "app", | ||
plugins = plugins { | ||
id(PLUGIN_ID) | ||
}, | ||
enableKotlinAndroidPlugin = false, | ||
) | ||
) | ||
).generateIn(projectDir) | ||
|
||
gradlew(projectDir, "tasks", dryRun = false) | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
...ts/delivery/upload-cd-build-result/src/main/kotlin/com/avito/cd/UploadCdBuildResultApi.kt
This file contains 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 |
---|---|---|
@@ -1,3 +1,7 @@ | ||
package com.avito.cd | ||
|
||
internal const val PLUGIN_ID = "com.avito.android.upload-cd-build-result" | ||
|
||
internal const val CD_TASK_GROUP: String = "cd" | ||
|
||
public const val uploadCdBuildResultTaskName: String = "uploadCdBuildResult" |
12 changes: 12 additions & 0 deletions
12
...ivery/upload-cd-build-result/src/main/kotlin/com/avito/cd/UploadCdBuildResultExtension.kt
This file contains 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,12 @@ | ||
package com.avito.cd | ||
|
||
import org.gradle.api.provider.Property | ||
|
||
public abstract class UploadCdBuildResultExtension { | ||
|
||
public abstract val artifactoryUser: Property<String> | ||
|
||
public abstract val artifactoryPassword: Property<String> | ||
|
||
public abstract val suppressFailures: Property<Boolean> | ||
} |
23 changes: 23 additions & 0 deletions
23
...delivery/upload-cd-build-result/src/main/kotlin/com/avito/cd/UploadCdBuildResultPlugin.kt
This file contains 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,23 @@ | ||
package com.avito.cd | ||
|
||
import org.gradle.api.Plugin | ||
import org.gradle.api.Project | ||
import org.gradle.kotlin.dsl.create | ||
import org.gradle.kotlin.dsl.register | ||
|
||
public class UploadCdBuildResultPlugin : Plugin<Project> { | ||
|
||
override fun apply(project: Project) { | ||
|
||
val extension = project.extensions.create<UploadCdBuildResultExtension>("uploadCdBuildResult") | ||
|
||
project.tasks.register<UploadCdBuildResultTask>(uploadCdBuildResultTaskName) { | ||
group = CD_TASK_GROUP | ||
description = "Task for sending CD build result to service" | ||
|
||
this.artifactoryUser.set(extension.artifactoryUser) | ||
this.artifactoryPassword.set(extension.artifactoryPassword) | ||
this.suppressErrors.set(extension.suppressFailures) | ||
} | ||
} | ||
} |
This file contains 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