构建Windows 8的手机应用程序的命令行 [英] Building Windows 8 Phone App on Command Line

查看:110
本文介绍了构建Windows 8的手机应用程序的命令行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前移植现有的跨平台框架到Windows Phone 8。

在生成过程是完全自动的,我们使用的是坚如磐石的CI系统。

我可以构建和部署的Windows Phone 8从Visual Studio(前preSS 2012)的样本,
但现在我需要到融入我们的构建脚本。

有没有人曾经成功打造(和部署)通过命令行一个双赢Phone 8的应用程序?
(或者蚂蚁,制造,使用SCons,无论...)

如果是,如何?

任何提示都欢迎。


解决方案

我用下面的bat文件来构建WP7 code(+自动化蚂蚁在它的上面)

。它可能对你有所帮助。

的build.bat

  C:\\ WINDOWS \\ Microsoft.NET \\框架\\ v4.0.30319 \\ MSBuild.exe的build.xml /吨:BuildAndCopy / P:版本= 123

其中的build.xml 是一样的东西(自身建设BuildAll目标下云)

 <项目的xmlns =htt​​p://schemas.microsoft.com/developer/msbuild/2003>
    <导入项目=C:\\ Program Files文件(x86)的\\的MSBuild \\ MSBuildCommunityTasks \\ ​​MSBuild.Community.Tasks.Targets/>
    <&的PropertyGroup GT;
        <主要大于1< /主要与GT;
        <小> 0℃; /小>
        <构建与GT; 0℃; /构建>
        <修订> X< /修订>
        < OutputPath>建立\\< / OutputPath>
        < OutputPathDebug> .. \\建立\\调试\\< / OutputPathDebug>
        < OutputPathRelease> .. \\建立\\< / OutputPathRelease>
    < /&的PropertyGroup GT;
    <目标名称=BuildAllDependsOnTargets =清洁;版本>
        <项目的MSBuild =SomeApp.sln属性=配置=释放; OutputPath = $(OutputPathRelease)/>
        <项目的MSBuild =SomeApp.sln属性=配置=调试; OutputPath = $(OutputPathDebug)/>
    < /目标>
    <目标名称=干净>
        < RemoveDir目录=$(OutputPath)条件=存在('$(OutputPath)')/>
        < MAKEDIR目录=$(OutputPath)条件=!存在('$(OutputPath)')/>
    < /目标>
    <目标名称=版本>
        <消息文本=版本:。$(专业)$(次要)$(建设)$(修订版)/>
        < XMLUPDATE
                命名空间=
                XmlFileName =的WindowsPhone \\属性\\ WMAppManifest.xml
                XPath的=//应用[@版本] // @版本
                值=。$(专业)$(次要)$(建设)$(修订版)/>
    < /目标>    <&的ItemGroup GT;
        < AppFiles包括=$(OutputPath)\\ **​​ \\ * XAP。/>
    < /&的ItemGroup GT;    <目标名称=BuildAndCopyDependsOnTargets =BuildAll>
        <复制
                来源档案=@(AppFiles)
                DestinationFiles=\"@(AppFiles->'\\\\fs\\Public\\projects\\mobile\\SomeAppWP\\$(Major).$(Minor).$(Build).$(Revision)\\%(RecursiveDir)%(Filename)%(Extension)')\"
                />
        <复制
                来源档案=@(AppFiles)
                DestinationFiles=\"@(AppFiles->'\\\\fs\\Public\\projects\\mobile\\SomeAppWP\\latest\\%(RecursiveDir)%(Filename)%(Extension)')\"
                />
    < /目标>
< /项目>

I'm currently porting an existing cross platform framework to Windows Phone 8.

The build process is fully automated and we are using a rock solid CI system.

I can build and deploy Windows Phone 8 samples from Visual Studio (Express 2012), but now I need to integrate that into our build scripts.

Did anybody ever successfully build (and deploy) a Win Phone 8 app via the commandline? (Or ant, make, scons, whatever...)

If yes, how?

Any hints are welcome.

解决方案

I used the following bat file to build WP7 code (+ant automation on top of it). It may be helpful for you.

build.bat

C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe build.xml /t:BuildAndCopy /p:Revision=123

where build.xml is something like (build itself goes under BuildAll target)

<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
    <Import Project="C:\Program Files (x86)\MSBuild\MSBuildCommunityTasks\MSBuild.Community.Tasks.Targets"/>
    <PropertyGroup>
        <Major>1</Major>
        <Minor>0</Minor>
        <Build>0</Build>
        <Revision>x</Revision>
        <OutputPath>Build\</OutputPath>
        <OutputPathDebug>..\Build\Debug\</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="WindowsPhone\Properties\WMAppManifest.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->'\\fs\Public\projects\mobile\SomeAppWP\$(Major).$(Minor).$(Build).$(Revision)\%(RecursiveDir)%(Filename)%(Extension)')"
                />
        <Copy
                SourceFiles="@(AppFiles)"
                DestinationFiles="@(AppFiles->'\\fs\Public\projects\mobile\SomeAppWP\latest\%(RecursiveDir)%(Filename)%(Extension)')"
                />
    </Target>


</Project>

这篇关于构建Windows 8的手机应用程序的命令行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆