Skip to content

Commit

Permalink
Merge pull request PixarAnimationStudios#673 from autodesk-forks/reso…
Browse files Browse the repository at this point in the history
…lve/adsk/internal-only/feature/pipeline_adsk

Support ios build/test with connected device in both intel/M1 host machine.
  • Loading branch information
yangel2017 authored and GitHub Enterprise committed Nov 13, 2023
2 parents c440c97 + cac203f commit 75e2618
Showing 1 changed file with 27 additions and 2 deletions.
29 changes: 27 additions & 2 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ def windowsNode(platform, config) {
def macNode(platform, config) {
def label = 'OGS && Mac && nogpu'
if ("${platform}".contains("ios")) {
label = 'OGS && M1'
label = 'device'
}
node("${label}") {
def buildInfo
Expand Down Expand Up @@ -704,6 +704,29 @@ def windowsBuild(buildInfo) {
}
}

// Get connected real device name
def getConnectedDeviceName()
{
def realDeviceName = ''
output = COMMONSHELL.capture_script_output("xcrun xctrace list devices").tokenize('\n')
for (line in output) {
line = line.trim()
if(line == '' || line.startsWith('==') || line.contains('simulator')){
continue
}
// The real device would be something like iPhone (16.6) (00008110-001A44CE0220A01E)
// Please only use letters, digitals and '_' for the device name.
def matcher = line =~ /(\w+) \(.+\) \(.+\)/
if(matcher.find()){
realDeviceName = matcher[0][1]
matcher = null
break
}
matcher = null
}
return realDeviceName
}

def macBuild(buildInfo) {
if (!(isDevBranch() || isReleaseBranch()) && (!"${buildInfo.Platform}".contains("ios"))) {
// Check if the package is already deployed
Expand Down Expand Up @@ -748,8 +771,10 @@ def macBuild(buildInfo) {
"""

if ("${buildInfo.Platform}".contains("ios")) {
// Get connected real device name
def deviceName = getConnectedDeviceName()
sh """
export DESTINATION="platform=iOS,name=iPad" ;
export DESTINATION="platform=iOS,name=${deviceName}" ;
${buildInfo.Python} -u build_scripts/build_usd.py ${build_target} --build ${buildInfo.USDgen_build} --src ${buildInfo.USDgen_src} ${buildInfo.USDinst} --build-variant ${buildInfo.BuildVariant} ${build_flags} ${add_flags} -v
"""
}
Expand Down

0 comments on commit 75e2618

Please sign in to comment.