Skip to content

Commit

Permalink
Migrate to latest Gradle, dependency versions + GH actions
Browse files Browse the repository at this point in the history
  • Loading branch information
chadlwilson committed Sep 24, 2022
1 parent 35a8535 commit 677bfbd
Show file tree
Hide file tree
Showing 9 changed files with 227 additions and 166 deletions.
14 changes: 14 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: weekly
day: friday
- package-ecosystem: gradle
directory: "/"
schedule:
interval: weekly
day: friday
open-pull-requests-limit: 99

5 changes: 3 additions & 2 deletions .github/workflows/pr_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v1
uses: actions/setup-java@v3
with:
java-version: 15
distribution: adopt
- name: Build with Gradle
run: ./gradlew assemble check
5 changes: 3 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,13 @@ jobs:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
PRERELEASE: "${{ github.event.inputs.prerelease }}"
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up JDK
uses: actions/setup-java@v1
uses: actions/setup-java@v3
with:
java-version: 15
distribution: adopt
- name: Release
run: ./gradlew verifyExpRelease githubRelease
10 changes: 6 additions & 4 deletions .github/workflows/test_and_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v1
uses: actions/setup-java@v3
with:
java-version: 15
distribution: adopt
- name: Test with Gradle
run: ./gradlew assemble check
previewGithubRelease:
Expand All @@ -26,12 +27,13 @@ jobs:
GITHUB_USER: "gocd"
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up JDK
uses: actions/setup-java@v1
uses: actions/setup-java@v3
with:
java-version: 15
distribution: adopt
- name: Test with Gradle
run: ./gradlew githubRelease
60 changes: 30 additions & 30 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,52 +38,52 @@ gocdPlugin {
assetsToRelease = [project.tasks.findByName('jar')]
}

sourceCompatibility = 1.8
targetCompatibility = 1.8

version = gocdPlugin.fullVersion(project)

repositories {
mavenCentral()
mavenLocal()
}

sourceSets {
test {
java {
compileClasspath += configurations.compileOnly
runtimeClasspath += configurations.compileOnly
}
}
java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}

ext {
deps = [
gocdPluginApi: 'cd.go.plugin:go-plugin-api:22.2.0',
awsSdk : 'com.amazonaws:aws-java-sdk:1.12.305',
]

versions = project.ext.deps.collectEntries { lib, libGav -> [lib, libGav.split(':').last()] }
}

dependencies {
compile group: 'cd.go.plugin.base', name: 'gocd-plugin-base', version: '0.0.1'
compileOnly group: 'cd.go.plugin', name: 'go-plugin-api', version: '21.2.0'
compile group: 'com.google.code.gson', name: 'gson', version: '2.8.7'
compile group: 'com.amazonaws', name: 'aws-java-sdk-secretsmanager', version: '1.11.931'
compile group: 'com.amazonaws.secretsmanager', name: 'aws-secretsmanager-caching-java', version: '1.0.1'
implementation group: 'cd.go.plugin.base', name: 'gocd-plugin-base', version: '0.0.1'
compileOnly project.deps.gocdPluginApi
implementation group: 'com.google.code.gson', name: 'gson', version: '2.9.1'
implementation group: 'com.amazonaws', name: 'aws-java-sdk-secretsmanager', version: project.versions.awsSdk
implementation group: 'com.amazonaws.secretsmanager', name: 'aws-secretsmanager-caching-java', version: '1.0.1'

testCompile group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: '5.7.2'
testCompile group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: '5.7.2'
testCompile group: 'org.junit.jupiter', name: 'junit-jupiter-params', version: '5.7.2'
testCompile group: 'org.assertj', name: 'assertj-core', version: '3.18.1'
testCompile group: 'org.mockito', name: 'mockito-core', version: '3.7.7'
testCompile group: 'org.jsoup', name: 'jsoup', version: '1.13.1'
testCompile group: 'cd.go.plugin', name: 'go-plugin-api', version: '21.1.0'
testCompile group: 'org.skyscreamer', name: 'jsonassert', version: '1.5.0'
testImplementation platform('org.junit:junit-bom:5.9.1')
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api'
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-params'
testRuntimeOnly group: 'org.junit.jupiter', name: 'junit-jupiter-engine'
testImplementation group: 'org.assertj', name: 'assertj-core', version: '3.23.1'
testImplementation group: 'org.mockito', name: 'mockito-core', version: '4.8.0'
testImplementation group: 'org.jsoup', name: 'jsoup', version: '1.15.3'
testImplementation project.deps.gocdPluginApi
testImplementation group: 'org.skyscreamer', name: 'jsonassert', version: '1.5.1'
}


test {
useJUnitPlatform()
}

jar {
from(configurations.compile) {
from(configurations.runtimeClasspath) {
into "lib/"
}

// from(sourceSets.main.java) {
// into "/"
// }
}

}
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 2 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.6.1-all.zip
distributionSha256Sum=db9c8211ed63f61f60292c69e80d89196f9eb36665e369e7f00ac4cc841c2219
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit 677bfbd

Please sign in to comment.