Skip to content

Commit

Permalink
chore: define ext.injected in common-utilities
Browse files Browse the repository at this point in the history
  • Loading branch information
miurahr committed Jan 20, 2025
1 parent 1730507 commit 5cce112
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ interface InjectedExecOps {
ExecOperations getExecOps()
}

ext.injected = project.objects.newInstance(InjectedExecOps)

ext.loadProperties = { propFile ->
def config = new Properties()
if (propFile.canRead()) {
Expand Down
4 changes: 0 additions & 4 deletions build-logic/src/main/groovy/org.omegat.mac-conventions.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ ext.makeHunspellSignTask = {
destinationDir = file(layout.buildDirectory.file("hunspell"))
doLast {
def dylibs = fileTree(dir: destinationDir, include: '**/*.dylib').files
def injected = project.objects.newInstance(InjectedExecOps)
injected.execOps.exec {
commandLine('codesign', '--deep', '--force',
'--sign', project.property('macCodesignIdentity'),
Expand Down Expand Up @@ -208,7 +207,6 @@ ext.makeMacTask = { args ->
delete "$destinationDir/OmegaT.app/Contents/PlugIns/jre.bundle"
}
doLast {
def injected = project.objects.newInstance(InjectedExecOps)
injected.execOps.exec {
commandLine 'codesign', '--deep', '--force',
'--sign', project.property('macCodesignIdentity'),
Expand Down Expand Up @@ -238,7 +236,6 @@ ext.makeMacTask = { args ->
}
inputs.files signedZipTask.get().archiveFile
doLast {
def injected = project.objects.newInstance(InjectedExecOps)
injected.execOps.exec {
// Assuming setup per instructions at
// https://developer.apple.com/documentation/security/notarizing_your_app_before_distribution/customizing_the_notarization_workflow#3087734
Expand All @@ -260,7 +257,6 @@ ext.makeMacTask = { args ->
condition(exePresent('xcrun'), 'XCode is not present in system.')
}
doFirst {
def injected = project.objects.newInstance(InjectedExecOps)
if (args.name.equals("mac")) {
injected.execOps.exec {
commandLine 'xcrun', 'stapler', 'staple', "${macInstallSignedDist.destinationDir}/OmegaT.app"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,6 @@ tasks.register('testAcceptance', Test) {
def lockFile = new File("/tmp/.X${display}-lock")
if (!lockFile.exists()) {
def outputStream = new ByteArrayOutputStream()
def injected = project.objects.newInstance(InjectedExecOps)
def res = injected.execOps.exec {
commandLine 'sh', '-c', "Xvfb :${display} -screen 0 1280x1024x24 >>/dev/null 2>&1 & echo \$!"
standardOutput = outputStream
Expand Down

0 comments on commit 5cce112

Please sign in to comment.