Skip to content

Commit 7756247

Browse files
Simplify checkSamples task
Closes gh-11814
1 parent 3387149 commit 7756247

File tree

6 files changed

+13
-280
lines changed

6 files changed

+13
-280
lines changed

.github/workflows/continuous-integration-workflow.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,13 +98,15 @@ jobs:
9898
- name: Check samples project
9999
env:
100100
LOCAL_REPOSITORY_PATH: ${{ github.workspace }}/build/publications/repos
101-
SAMPLES_INIT_SCRIPT: ${{ github.workspace }}/build/includeRepo/spring-security-ci.gradle
101+
SAMPLES_DIR: ../spring-security-samples
102+
VERSION: ${{ needs.prerequisites.outputs.project_version }}
102103
run: |
103104
export GRADLE_ENTERPRISE_CACHE_USERNAME="$GRADLE_ENTERPRISE_CACHE_USER"
104105
export GRADLE_ENTERPRISE_CACHE_PASSWORD="$GRADLE_ENTERPRISE_CACHE_PASSWORD"
105106
export GRADLE_ENTERPRISE_ACCESS_KEY="$GRADLE_ENTERPRISE_SECRET_ACCESS_KEY"
106107
./gradlew publishMavenJavaPublicationToLocalRepository
107-
./gradlew checkSamples -PsamplesInitScript="$SAMPLES_INIT_SCRIPT" -PlocalRepositoryPath="$LOCAL_REPOSITORY_PATH" --stacktrace
108+
./gradlew cloneSamples -PcloneOutputDirectory="$SAMPLES_DIR"
109+
./gradlew --project-dir "$SAMPLES_DIR" --init-script spring-security-ci.gradle -PlocalRepositoryPath="$LOCAL_REPOSITORY_PATH" -PspringSecurityVersion="$VERSION" :runAllTests
108110
check_tangles:
109111
name: Check for Package Tangles
110112
needs: [ prerequisites ]

build.gradle

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import io.spring.gradle.IncludeRepoTask
2+
13
buildscript {
24
dependencies {
35
classpath "io.spring.javaformat:spring-javaformat-gradle-plugin:$springJavaformatVersion"
@@ -16,7 +18,6 @@ apply plugin: 'io.spring.nohttp'
1618
apply plugin: 'locks'
1719
apply plugin: 's101'
1820
apply plugin: 'io.spring.convention.root'
19-
apply plugin: 'io.spring.convention.include-check-remote'
2021
apply plugin: 'org.jetbrains.kotlin.jvm'
2122
apply plugin: 'org.springframework.security.update-dependencies'
2223
apply plugin: 'org.springframework.security.update-version'
@@ -201,17 +202,13 @@ nohttp {
201202

202203
}
203204

204-
tasks.register('checkSamples') {
205-
includeCheckRemote {
206-
repository = 'spring-projects/spring-security-samples'
207-
ref = samplesBranch
208-
buildScan = true
209-
if (project.hasProperty("samplesInitScript")) {
210-
initScripts = [samplesInitScript]
211-
projectProperties = ["localRepositoryPath": localRepositoryPath, "springSecurityVersion": project.version]
212-
}
205+
tasks.register('cloneSamples', IncludeRepoTask) {
206+
if (!project.hasProperty("cloneOutputDirectory")) {
207+
throw new GradleException("Required parameter 'cloneOutputDirectory' not found")
213208
}
214-
dependsOn checkRemote
209+
repository = 'spring-projects/spring-security-samples'
210+
ref = samplesBranch
211+
outputDirectory = project.file("$cloneOutputDirectory")
215212
}
216213

217214
s101 {

buildSrc/src/main/groovy/io/spring/gradle/IncludeRepoTask.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ abstract class IncludeRepoTask extends DefaultTask {
5454
* Directory where the project template should be copied.
5555
*/
5656
@OutputDirectory
57-
final File outputDirectory = project.file("$project.buildDir/$name")
57+
File outputDirectory = project.file("$project.buildDir/$name")
5858

5959
@TaskAction
6060
void checkoutAndCopy() {

buildSrc/src/main/groovy/io/spring/gradle/convention/IncludeCheckRemotePlugin.groovy

Lines changed: 0 additions & 86 deletions
This file was deleted.

buildSrc/src/main/resources/META-INF/gradle-plugins/io.spring.convention.include-check-remote.properties

Lines changed: 0 additions & 1 deletion
This file was deleted.

buildSrc/src/test/java/io/spring/gradle/convention/IncludeCheckRemotePluginTest.java

Lines changed: 0 additions & 179 deletions
This file was deleted.

0 commit comments

Comments
 (0)