2017-01-06 4 views
0

Ant를 사용하여 iOS 앱에서 번들 번호를 얻으려고합니다. 관련 스크립트는 다음과 같습니다 :개미 스크립트 - plist 파일의 일부 텍스트를 인쇄하여 속성에 할당하는 방법

<macrodef name="get_build_property"> 
     <attribute name="info-plist"/> 
     <sequential> 
      <exec executable="/usr/libexec/PlistBuddy"  
      resultproperty="app.version.bundle.number" 
      failonerror="false"> 
       <arg value="-c"/> 
       <arg value ="Print :CFBundleVersion"/> 
       <arg value="@{info-plist}"/> 

      </exec> 
      <echo message="app.version.bundle.number: ${app.version.bundle.number}" /> 
     </sequential> 
</macrodef> 

나는 exec에서 올바른 결과를 볼 수 있습니다. 하지만 에코의 메시지는 항상 0이었습니다. PlistBuddy-> Print가 resultproperty에 결과를 설정하지 않았다고 생각합니다. 내가 맞습니까? 그렇다면 어떻게 할 수 있습니까?

미리 감사드립니다.

답변

0

사실 나는 방금 resultproperty 대신 outputproperty를 사용하여 답변을 찾았습니다. 그 후에 작동합니다.