Skip to content

Commit 5c08684

Browse files
committed
remove complex function and add explicit require
1 parent 2b6945b commit 5c08684

File tree

3 files changed

+23
-26
lines changed

3 files changed

+23
-26
lines changed

build.gradle

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,17 @@ tasks.register("artifactDeb") {
375375
dependsOn copyJdk
376376

377377
doLast {
378-
rakeExternal(projectDir, buildDir, 'artifact:deb')
378+
exec {
379+
workingDir projectDir
380+
executable "${projectDir}/vendor/bundle/jruby/3.1.0/bin/rake"
381+
args 'artifact:deb'
382+
environment 'ARCH', System.getenv("ARCH") ?: "x86_64"
383+
environment 'GEM_HOME', "${projectDir}/vendor/bundle/jruby/3.1.0"
384+
environment 'GEM_PATH', "${projectDir}/vendor/bundle/jruby/3.1.0"
385+
standardOutput = System.out
386+
errorOutput = System.err
387+
}
388+
379389
tasks.named('deleteLocalJdk').get().actions.each { it.execute(tasks.named('deleteLocalJdk').get()) }
380390
}
381391
}
@@ -386,7 +396,17 @@ tasks.register("artifactRpm") {
386396
dependsOn copyJdk
387397

388398
doLast {
389-
rakeExternal(projectDir, buildDir, 'artifact:rpm')
399+
exec {
400+
workingDir projectDir
401+
executable "${projectDir}/vendor/bundle/jruby/3.1.0/bin/rake"
402+
args 'artifact:rpm'
403+
environment 'ARCH', System.getenv("ARCH") ?: "x86_64"
404+
environment 'GEM_HOME', "${projectDir}/vendor/bundle/jruby/3.1.0"
405+
environment 'GEM_PATH', "${projectDir}/vendor/bundle/jruby/3.1.0"
406+
standardOutput = System.out
407+
errorOutput = System.err
408+
}
409+
390410
tasks.named('deleteLocalJdk').get().actions.each { it.execute(tasks.named('deleteLocalJdk').get()) }
391411
}
392412
}

rakelib/artifacts.rake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -679,6 +679,7 @@ namespace "artifact" do
679679
require "fpm/errors" # TODO(sissel): fix this in fpm
680680
require "fpm/package/dir"
681681
require "fpm/package/gem" # TODO(sissel): fix this in fpm; rpm needs it.
682+
require "fpm/package/cpan"
682683

683684
basedir = File.join(File.dirname(__FILE__), "..")
684685
dir = FPM::Package::Dir.new

rubyUtils.gradle

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -173,30 +173,6 @@ void rake(File projectDir, File buildDir, String task, String... args) {
173173
}
174174
}
175175

176-
// Spawn rake as external process (for CI compatibility)
177-
def rakeExternal(File projectDir, File buildDir, String task) {
178-
def rakeExecutable = new File(projectDir, "vendor/bundle/jruby/3.1.0/bin/rake")
179-
if (!rakeExecutable.exists()) {
180-
throw new GradleException("Rake executable not found at ${rakeExecutable}")
181-
}
182-
183-
def processBuilder = new ProcessBuilder()
184-
def gemDir = "${projectDir}/vendor/bundle/jruby/3.1.0".toString()
185-
processBuilder.directory(projectDir)
186-
processBuilder.command(rakeExecutable.absolutePath, task)
187-
processBuilder.environment().put("ARCH", System.getenv("ARCH") ?: "x86_64")
188-
processBuilder.environment().put("GEM_HOME", gemDir)
189-
processBuilder.environment().put("GEM_PATH", gemDir)
190-
processBuilder.inheritIO()
191-
192-
def process = processBuilder.start()
193-
def exitCode = process.waitFor()
194-
195-
if (exitCode != 0) {
196-
throw new GradleException("Rake task '${task}' failed with exit code ${exitCode}")
197-
}
198-
}
199-
200176
void setupJruby(File projectDir, File buildDir) {
201177
executeJruby projectDir, buildDir, { ScriptingContainer jruby ->
202178
jruby.currentDirectory = projectDir

0 commit comments

Comments
 (0)