Skip to content

Commit

Permalink
Update integration-test add maven central by default
Browse files Browse the repository at this point in the history
  • Loading branch information
pmendelski committed Nov 15, 2020
1 parent c915cd1 commit e8e9b92
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 10 deletions.
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

## [Unreleased]

## [0.1.10] - 2020-10-15
### Changed
- Update integration-test plugin

### Added
- Add default repository `mavenCentral`

## [0.1.9] - 2020-10-14
### Changed
- In tests use junit platform by default.
Expand All @@ -18,7 +25,8 @@
### Changed
- Update manifest plugin.

[Unreleased]: https://github.com/coditory/gradle-build-plugin/compare/v0.1.9...HEAD
[Unreleased]: https://github.com/coditory/gradle-build-plugin/compare/v0.1.10...HEAD
[1.1.10]: https://github.com/coditory/gradle-build-plugin/compare/v0.1.8...v0.1.10
[1.1.9]: https://github.com/coditory/gradle-build-plugin/compare/v0.1.8...v0.1.9
[1.1.8]: https://github.com/coditory/gradle-build-plugin/compare/v0.1.7...v0.1.8
[1.1.7]: https://github.com/coditory/gradle-build-plugin/compare/v0.1.6...v0.1.7
Expand Down
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,19 @@ plugins {
}
```

## Maven central as the default repository

Adds maven central as the default repository:

```gradle
repositories {
mavenCentral()
}
```

## More verbose test logs

Configures test tasks to produce some output:
Configures test tasks to produce the same output as following:

```gradle
tasks.withType(Test) {
Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ dependencies {
implementation(kotlin("stdlib-jdk8"))
implementation(kotlin("reflect"))
implementation("com.coditory.gradle:manifest-plugin:0.1.9")
implementation("com.coditory.gradle:integration-test-plugin:1.1.10")
implementation("com.coditory.gradle:integration-test-plugin:1.1.11")

testImplementation("org.assertj:assertj-core:3.18.0")
testImplementation("org.junit.jupiter:junit-jupiter-api:5.7.0")
Expand Down
10 changes: 3 additions & 7 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
rootProject.name = "build-plugin"

plugins {
id("com.gradle.enterprise").version("3.4.1")
id("com.gradle.enterprise").version("3.5")
}

rootProject.name = "build-plugin"

gradleEnterprise {
buildScan {
termsOfServiceUrl = "https://gradle.com/terms-of-service"
termsOfServiceAgree = "yes"
if (!System.getenv("CI").isNullOrEmpty()) {
publishAlways()
tag("CI")
}
}
}
1 change: 1 addition & 0 deletions src/main/kotlin/com/coditory/gradle/build/BuildPlugin.kt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ open class BuildPlugin : Plugin<Project> {
project.plugins.apply(ManifestPlugin::class.java)
project.plugins.apply(IntegrationTestPlugin::class.java)
TestLoggingConfiguration.configure(project)
DefaultRepositoryConfiguration.configure(project)
}

companion object {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package com.coditory.gradle.build

import org.gradle.api.Project

internal object DefaultRepositoryConfiguration {
fun configure(project: Project) {
project.repositories.add(project.repositories.mavenCentral())
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package com.coditory.gradle.build

import com.coditory.gradle.build.base.SpecProjectBuilder.Companion.projectWithPlugins
import org.assertj.core.api.Assertions.assertThat
import org.junit.jupiter.api.Test

class ConfigureDefaultRepositorySpec {
@Test
fun `should configure maven central as a default repository`() {
// given
val project = projectWithPlugins("sample-project")
.withGroup("com.coditory")
.withVersion("0.0.1-SNAPSHOT")
.build()

// expect
val repositories = project.repositories
assertThat(repositories.contains(repositories.mavenCentral()))
.isTrue()
}
}

0 comments on commit e8e9b92

Please sign in to comment.