加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Windows > 正文

命令行 – 在命令行上构建Windows 8 Phone应用程序

发布时间:2020-12-14 02:09:50 所属栏目:Windows 来源:网络整理
导读:我目前正在将现有的跨平台框架移植到 Windows Phone 8. 构建过程完全自动化,我们正在使用坚如磐石的CI系统. 我可以从Visual Studio(Express 2012)构建和部署Windows Phone 8示例, 但现在我需要将它集成到我们的构建脚本中. 有没有人通过命令行成功构建(和部
我目前正在将现有的跨平台框架移植到 Windows Phone 8.

构建过程完全自动化,我们正在使用坚如磐石的CI系统.

我可以从Visual Studio(Express 2012)构建和部署Windows Phone 8示例,
但现在我需要将它集成到我们的构建脚本中.

有没有人通过命令行成功构建(和部署)Win Phone 8应用程序?
(或蚂蚁,制造,scons,等等……)

如果有,怎么样?

任何提示都是受欢迎的.

解决方法

我使用以下bat文件来构建WP7代码(ant自动化).它可能对你有所帮助.

运行build.bat

C:WindowsMicrosoft.NETFrameworkv4.0.30319MSBuild.exe build.xml /t:BuildAndCopy /p:Revision=123

其中build.xml就像(构建本身属于BuildAll目标)

<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
    <Import Project="C:Program Files (x86)MSBuildMSBuildCommunityTasksMSBuild.Community.Tasks.Targets"/>
    <PropertyGroup>
        <Major>1</Major>
        <Minor>0</Minor>
        <Build>0</Build>
        <Revision>x</Revision>
        <OutputPath>Build&;/OutputPath>
        <OutputPathDebug>..BuildDebug&;/OutputPathDebug>
        <OutputPathRelease>..Build&;/OutputPathRelease>
    </PropertyGroup>
    <Target Name="BuildAll" DependsOnTargets="Clean; Version">
        <msbuild  Projects="SomeApp.sln" Properties="Configuration=Release;OutputPath=$(OutputPathRelease)"/>
        <msbuild  Projects="SomeApp.sln" Properties="Configuration=Debug;OutputPath=$(OutputPathDebug)"/>
    </Target>
    <Target Name="Clean">
        <RemoveDir Directories="$(OutputPath)" Condition="Exists('$(OutputPath)')"/>
        <MakeDir Directories="$(OutputPath)" Condition="!Exists('$(OutputPath)')"/>
    </Target>
    <Target Name="Version">
        <Message Text="Version: $(Major).$(Minor).$(Build).$(Revision)"/>
        <XmlUpdate
                Namespace=""
                XmlFileName="WindowsPhonePropertiesWMAppManifest.xml"
                XPath="//App[@Version]//@Version"
                Value="$(Major).$(Minor).$(Build).$(Revision)"/>
    </Target>

    <ItemGroup>
        <AppFiles Include="$(OutputPath)***.xap"/>
    </ItemGroup>

    <Target Name="BuildAndCopy" DependsOnTargets="BuildAll">
        <Copy
                SourceFiles="@(AppFiles)"
                DestinationFiles="@(AppFiles->'fsPublicprojectsmobileSomeAppWP$(Major).$(Minor).$(Build).$(Revision)%(RecursiveDir)%(Filename)%(Extension)')"
                />
        <Copy
                SourceFiles="@(AppFiles)"
                DestinationFiles="@(AppFiles->'fsPublicprojectsmobileSomeAppWPlatest%(RecursiveDir)%(Filename)%(Extension)')"
                />
    </Target>


</Project>

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读