Skip to content
This repository has been archived by the owner on Dec 5, 2024. It is now read-only.

Commit

Permalink
Improve build keychain default settings (#161)
Browse files Browse the repository at this point in the history
Description
===========

A simple patch to set some basic conventions for the default
settings for the build keychain. Without these the keychain
would be created with the default settings (lock after sleep and
lock after 5 minutes) This will ensure that longer builds still can
access the keychain after a compile.

I also set a domain value for the keychain operation to not
write into the system values etc. This is just a precauthion since the
user in question can only set user keychains anyway. But the commandline
arguments can be smaller and it is in general a better way.

Changes
=======

* ![IMPROVE] default build keychain settings
* ![IMPROVE] set domain value for keychain searchlist operations
  • Loading branch information
Larusso authored May 23, 2022
1 parent 43d4eb6 commit 3e757bf
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

package wooga.gradle.build.unity.ios

import com.wooga.security.Domain
import org.gradle.api.Action
import org.gradle.api.Plugin
import org.gradle.api.Project
Expand Down Expand Up @@ -97,6 +98,8 @@ class IOSBuildPlugin implements Plugin<Project> {
task.baseName.convention("build")
task.extension.convention("keychain")
task.password.convention(extension.keychainPassword)
task.lockKeychainAfterTimeout.convention(-1)
task.lockKeychainWhenSleep.convention(true)
task.destinationDir.convention(project.layout.buildDirectory.dir("sign/keychains"))
}
})
Expand Down Expand Up @@ -197,13 +200,15 @@ class IOSBuildPlugin implements Plugin<Project> {

def addKeychain = tasks.create("addKeychain", SecuritySetKeychainSearchList) {
it.dependsOn(buildKeychain)
it.domain.set(Domain.user)
it.action = SecuritySetKeychainSearchList.Action.add
it.keychain(buildKeychain.keychain.map({ it.asFile }))
dependsOn(resetKeychains)
}

def removeKeychain = tasks.create("removeKeychain", SecuritySetKeychainSearchList) {
it.dependsOn(buildKeychain)
it.domain.set(Domain.user)
it.action = SecuritySetKeychainSearchList.Action.remove
it.keychain(buildKeychain.keychain.map({ it.asFile }))
}
Expand Down

0 comments on commit 3e757bf

Please sign in to comment.