Skip to content

Commit

Permalink
Fix Gradle deprecations
Browse files Browse the repository at this point in the history
  • Loading branch information
chadlwilson committed Dec 9, 2024
1 parent 5376ec2 commit 3b96d99
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ dependencies {
testImplementation group: 'org.jsoup', name: 'jsoup', version: '1.18.3'
}

tasks.withType(JavaCompile) {
tasks.withType(JavaCompile).configureEach {
options.deprecation = true
options.encoding = 'utf-8'
options.warnings = true
Expand All @@ -124,12 +124,18 @@ jar {
}
}

interface InjectedExecOps {
@Inject
ExecOperations getExecOps()
}

task bundleInstall {
inputs.files(project.files('contrib/cloudformation-template/Gemfile', 'contrib/cloudformation-template/Gemfile.lock'))
outputs.dir(project.file('.bundle'))

def injected = project.objects.newInstance(InjectedExecOps)
doLast {
project.exec {
injected.execOps.exec {
commandLine = ['bundle']
workingDir = project.file('contrib/cloudformation-template')
standardOutput = System.out
Expand All @@ -144,8 +150,9 @@ task stackfile {
inputs.file(project.file('contrib/cloudformation-template/ecs_cloud_formation_template.rb'))
outputs.file(project.file("${project.buildDir}/ecs_cloud_formation_template.json"))

def injected = project.objects.newInstance(InjectedExecOps)
doLast {
project.exec {
injected.execOps.exec {
commandLine = ['bundle', 'exec', 'ruby', 'ecs_cloud_formation_template.rb', 'expand']
workingDir = project.file('contrib/cloudformation-template')
standardOutput = new FileOutputStream(project.file("${project.buildDir}/ecs_cloud_formation_template.json"))
Expand Down

0 comments on commit 3b96d99

Please sign in to comment.