Skip to content

Commit

Permalink
Merge pull request #867 from conveyal/gradle-8
Browse files Browse the repository at this point in the history
Update build.gradle for gradle 8.x (and future 9.x)
  • Loading branch information
abyrd authored Mar 16, 2023
2 parents 995635a + 074c511 commit 9ff82b8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
9 changes: 3 additions & 6 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,11 @@ jobs:
fetch-depth: 0
# Java setup step completes very fast, no need to run in a preconfigured docker container.
- name: Set up JDK 11
uses: actions/setup-java@v1
uses: actions/setup-java@v3
with:
java-version: 11
- uses: actions/cache@v1
id: cache
with:
path: ~/.gradle/caches
key: gradle-caches
distribution: temurin
cache: 'gradle'
- name: Show version string
run: gradle -q printVersion | head -n1
- name: Build and Test
Expand Down
14 changes: 8 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
plugins {
id 'java'
id 'com.github.johnrengelman.shadow' version '6.0.0'
id 'com.github.johnrengelman.shadow' version '8.1.0'
id 'maven-publish'
id 'com.palantir.git-version' version '0.12.3'
id 'com.palantir.git-version' version '2.0.0'
}

group = 'com.conveyal'
Expand Down Expand Up @@ -72,17 +72,19 @@ tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}

// A task to copy all dependencies of the project into a single directory
// A task to copy all dependency JARs needed at runtime into a single directory
task copyDependencies(type: Copy) {
from configurations.default
from(sourceSets.main.runtimeClasspath) {
include '*.jar'
}
into 'dependencies'
}

// Run R5 as a local analysis backend with all dependencies on the classpath, without building a shadowJar.
task runBackend (type: JavaExec) {
dependsOn(build)
classpath(sourceSets.main.runtimeClasspath)
main("com.conveyal.analysis.BackendMain")
mainClass = 'com.conveyal.analysis.BackendMain'
}

// Start up an analysis local backend from a shaded JAR and ask it to shut down immediately.
Expand All @@ -91,7 +93,7 @@ task runBackend (type: JavaExec) {
task testShadowJarRunnable(type: JavaExec) {
dependsOn(shadowJar)
classpath(shadowJar.archiveFile.get())
main("com.conveyal.analysis.BackendMain")
mainClass = 'com.conveyal.analysis.BackendMain'
jvmArgs("-Dconveyal.immediate.shutdown=true")
}

Expand Down

0 comments on commit 9ff82b8

Please sign in to comment.