Skip to content
This repository has been archived by the owner on Mar 28, 2023. It is now read-only.

Commit

Permalink
Prevent checkstyle errors from failing the entire build.
Browse files Browse the repository at this point in the history
  • Loading branch information
gchallen committed Jan 14, 2018
1 parent 1d37753 commit aa0901a
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions src/main/groovy/edu/illinois/cs/cs125/gradle/GradeTask.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -245,11 +245,23 @@ class GradeTask extends DefaultTask {
}
project.tasks.clean.execute()
if (gradeConfiguration.checkstyle) {
project.tasks.checkstyleMain.execute()
try {
project.tasks.checkstyleMain.execute()
} catch (Exception e) {
gradeConfiguration.checkstyleFailed = true
reportConfiguration(gradeConfiguration)
throw (e)
}
}
def mainResourcesDir = project.tasks.processResources.getDestinationDir()
project.tasks.processResources.execute()
project.tasks.processTestResources.execute()
try {
project.tasks.processResources.execute()
project.tasks.processTestResources.execute()
} catch (Exception e) {
gradeConfiguration.resourcesFailed = true
reportConfiguration(gradeConfiguration)
throw (e)
}

/*
* We want to ignore errors in this block because we want to continue even if
Expand Down

0 comments on commit aa0901a

Please sign in to comment.