相关疑难解决方法(0)

Info.plist文件中的配置相关值

我的iOS项目中有三个配置:

  1. 调试
  2. 特设
  3. 发布

现在我想更改应用程序的名称,如下所示:

  1. MyAppDebug
  2. MyAppAdhoc
  3. MyApp(请注意,这个没有后缀)

有没有办法在Xcode中使用某种类型的"compiler-if-else-macro-thing"轻松实现这一点

xcode ios info-plist

19
推荐指数
2
解决办法
9305
查看次数

如果满足两个条件,则执行Ant任务

上面的脚本使用Ant-1.7.1核心语句实现:if dir_is_empty then git-clone else git-fetch

<target name="update" depends="git.clone, git.fetch" />

<target name="check.dir">
  <fileset dir="${dir}" id="fileset"/>
  <pathconvert refid="fileset" property="dir.contains-files" setonempty="false"/>
</target>

<target name="git.clone" depends="check.dir" unless="dir.contains-files">
  <exec executable="git">
    <arg value="clone"/>
    <arg value="${repo}"/>
    <arg value="${dir}"/>
  </exec>
</target>

<target name="git.fetch" depends="check.dir" if="dir.contains-files" >
  <exec executable="git" dir="${dir}">
    <arg value="fetch"/>
  </exec>
</target>
Run Code Online (Sandbox Code Playgroud)

(见我的其他帖子)


但是如何target通过两个条件实现启用?

if dir_does_not_exist or dir_is_empty then git-clone else git-fetch

我目前的尝试:

<target name="git.clone" 
        depends="chk.exist, chk.empty" 
        unless="!dir.exist || dir.noempty" >
  [...]
</target>

<target name="chk.exist">
  <condition property="dir.exist">
    <available …
Run Code Online (Sandbox Code Playgroud)

ant conditional ant-contrib is-empty

11
推荐指数
1
解决办法
2万
查看次数

标签 统计

ant ×1

ant-contrib ×1

conditional ×1

info-plist ×1

ios ×1

is-empty ×1

xcode ×1