Skip to content

Commit

Permalink
Reworked Structure (#5)
Browse files Browse the repository at this point in the history
BREAKING CHANGE
  • Loading branch information
aepfli authored Mar 19, 2021
1 parent c0f6fe6 commit f9d1d8f
Show file tree
Hide file tree
Showing 27 changed files with 759 additions and 358 deletions.
22 changes: 20 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,21 @@ plugins {

version = "${gitVersion()}".replaceFirst(~/^v/, '')

spotless {
groovy {
importOrder() // standard import order

excludeJava()
greclipse()

licenseHeaderFile file("license-header.spotless") // or licenseHeaderFile
}
groovyGradle {
target '*.gradle' // default target of groovyGradle
greclipse()
}
}

repositories {
mavenCentral()
}
Expand Down Expand Up @@ -66,7 +81,11 @@ gradlePlugin {
pluginBundle {
website = 'http://schrottner.at/gradle-gitlab-repositories/'
vcsUrl = 'https://github.com/aepfli/gradle-gitlab-repositories.git'
tags = ['GitLab', 'repositories', 'maven']
tags = [
'GitLab',
'repositories',
'maven'
]
}

test {
Expand All @@ -78,7 +97,6 @@ test {

sourceSets {
functionalTest {

}
}

Expand Down
9 changes: 9 additions & 0 deletions license-header.spotless
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/*
* Copyright 2016-2021 the original author or authors.
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License v2.0 which
* accompanies this distribution and is available at
*
* http://www.eclipse.org/legal/epl-v20.html
*/
Original file line number Diff line number Diff line change
@@ -1,22 +1,28 @@
/*
* This Groovy source file was generated by the Gradle "init" task.
* Copyright 2016-2021 the original author or authors.
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License v2.0 which
* accompanies this distribution and is available at
*
* http://www.eclipse.org/legal/epl-v20.html
*/
package at.schrottner.gradle

import static org.assertj.core.api.Assertions.assertThat

import org.gradle.testkit.runner.BuildResult
import org.gradle.testkit.runner.GradleRunner
import org.junit.jupiter.api.BeforeEach
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.io.TempDir

import static org.assertj.core.api.Assertions.assertThat

class GitlabRepositoriesPluginFunctionalKotlinTests {
private pluginClasspath = getClass().classLoader.findResource("plugin-classpath.txt")
.readLines()
.collect { it.replace("\\\\", "\\\\\\\\") } // escape backslashes in Windows paths
.collect { "\"$it\"" }
.join(", ")
.readLines()
.collect { it.replace("\\\\", "\\\\\\\\") } // escape backslashes in Windows paths
.collect { "\"$it\"" }
.join(", ")

File projectDir
File settingsGradle
Expand Down Expand Up @@ -50,9 +56,9 @@ class GitlabRepositoriesPluginFunctionalKotlinTests {
assertThat(result.output)
.contains("BUILD SUCCESSFUL")
.containsSubsequence(
"added Job-Token: jobToken",
"added Deploy-Token: token0",
"added Deploy-Token: token1"
"added Job-Token: jobToken",
"added Deploy-Token: token0",
"added Deploy-Token: token1"
)
}

Expand All @@ -73,9 +79,9 @@ class GitlabRepositoriesPluginFunctionalKotlinTests {
assertThat(result.output)
.contains("BUILD SUCCESSFUL")
.containsSubsequence(
"added Job-Token: jobToken",
"added Deploy-Token: token0",
"added Deploy-Token: token1"
"added Job-Token: jobToken",
"added Deploy-Token: token0",
"added Deploy-Token: token1"
)
}

Expand All @@ -101,13 +107,12 @@ class GitlabRepositoriesPluginFunctionalKotlinTests {
assertThat(result.output)
.contains("BUILD SUCCESSFUL")
.containsSubsequence(
"added Job-Token: jobToken",
"added Deploy-Token: token0",
"added Deploy-Token: token1",
"Settings evaluated",
"replaced Job-Token: jobToken",
"replaced Private-Token: token0",
"replaced Private-Token: token1"
"added Job-Token: jobToken",
"added Deploy-Token: token0",
"added Deploy-Token: token1",
"Settings evaluated",
"replaced Private-Token: token0",
"replaced Private-Token: token1"
)
}

Expand All @@ -131,13 +136,13 @@ class GitlabRepositoriesPluginFunctionalKotlinTests {
runner.withPluginClasspath()
runner.withArguments("gitLabTask", "-i", "-s")
runner.withProjectDir(projectDir)
// runner. {
//
// // gradle testkit jacoco support
// File("./build/testkit/testkit-gradle.properties")
// .copyTo(File(projectDir, "gradle.properties"))
//
// }
// runner. {
//
// // gradle testkit jacoco support
// File("./build/testkit/testkit-gradle.properties")
// .copyTo(File(projectDir, "gradle.properties"))
//
// }
runner.build()
}

Expand Down
Loading

0 comments on commit f9d1d8f

Please sign in to comment.