在构建机器上构建 WSP 文件 [英] Building a WSP File on the Build Machine

查看:40
本文介绍了在构建机器上构建 WSP 文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的开发机器上,我安装了 VSeWSS 1.3 并配置了本地 IIS 6,以便我可以构建我的 SharePoint 项目并部署生成的 WSP 文件到本地计算机.WSP文件是打包步骤生成的,我可以在其他机器上成功安装.

On my development machine I installed VSeWSS 1.3 and configured the local IIS 6 so that I can build my SharePoint project and deploy the generated WSP file to the local machine. The WSP file is generated by the Packaging step, which I can successfully install on other machines.

现在我必须将我的项目迁移到我们的构建机器,该机器当前未安装 SharePoint 且未针对 VSeWSS(无 VSeWSS Web 服务端点)进行配置.有没有一种方法可以自动构建 WSP 文件,而无需在构建机器上配置 IIS 以用于 SharePoint 和 VSeWSS?

Now I have to migrate my project to our build machine which currently does not have SharePoint installed and is not configured for VSeWSS (no VSeWSS web service endpoint). Is there a way to automate the building of the WSP file without the need to configure IIS on the build machine for use with SharePoint and VSeWSS?

有些书描述了使用 MakeCab.exe 和定义 DDF 文件的手动步骤,但我没有看到任何由VSeWSS(它是否可能在一个 TEMP 文件夹中生成,我可以用它来配置我的自动构建过程?).

Some of the books describe the manual step of using MakeCab.exe and defining a DDF file, but I don't see any DDF file generated by VSeWSS (is it maybe generated in a TEMP folder which I could use to configure my automated build process?).

推荐答案

我刚刚遇到了同样的问题.我选择了另一种工具来开发整个解决方案:我发现 WSPBuilder 更简洁,更少干扰.它也可以从命令行使用,这对构建文件非常有用.

I just faced the same problem. I opted for another tool for developing the whole solution: I found WSPBuilder much cleaner and less intrusive. It also can be used from the Command line, which is great for Build files.

我修改了一些由 Bil Simser 创建的 Nant 脚本,以便编译和部署项目并将代码从 VSeWSS 移至 WSPBuilder.无论是在我的机器上还是在构建机器上,它都像魅力一样.

I modified some Nant scripts created by Bil Simser in order to compile and deploy the project and move the code from VSeWSS to WSPBuilder. It works like a charm either on my machine or on the build machine.

您可以在 http://www.Codeplex.com 上找到 WSPBuilder,这些目标需要 nantContrib (在 www.tigris.org) 上工作.

You can find WSPBuilder on http://www.Codeplex.com, and these targets need nantContrib (on www.tigris.org) to work.

以下是我使用的一些目标:

Here are some of the targets I'm using:

<target name="build" depends="compile">
  <copy todir="${build.dir}\12\">
    <fileset basedir="${sharepoint.dir}\12">
      <include name="**/*"/>
    </fileset>
  </copy>
  <copy
    file="${sharepoint.dir}\solutionid.txt"
    tofile="${build.dir}\solutionid.txt"
  />
  <call target="buildsolutionfile" />
</target>



<target name="buildsolutionfile">
    <exec program="${wspbuilder.exe}" workingdir="${build.dir}">

      <arg value="-BuildDDF"/>
      <arg value="${debug}"/>

      <arg value="-Cleanup"/>
      <arg value="false"/>

      <arg value="-FolderDestination"/>
      <arg value="${build.dir}"/>

      <arg value="-Outputpath"/>
      <arg value="${build.dir}"/>

      <arg value="-TraceLevel"/>
      <arg value="verbose"/>
    </exec>
    <copy
      file="${build.dir}\${package.file}"
      tofile="${solution.dir}\${package.file}"/>
  </target>



 <target name="addsolution">
    <exec program="${stsadm.exe}" verbose="${verbose}">
      <arg value="-o" />
      <arg value="addsolution" />
      <arg value="-filename" />
      <arg value="${solution.dir}\${package.file}" />
    </exec>
    <call target="spwait" />
  </target>

  <target name="spwait" description="Waits for the timer job to complete.">
    <exec program="${stsadm.exe}" verbose="${verbose}">
      <arg value="-o" />
      <arg value="execadmsvcjobs" />
    </exec>
  </target>
  <target name="app.pool.reset" description="Resets Sharepoint's application pool.">
    <iisapppool action="Restart" pool="${apppool}" server="${server}" />
  </target>
  <target name="deploysolution" depends="addsolution">
    <exec program="${stsadm.exe}" workingdir="${build.dir}"  verbose="${verbose}">
      <arg value="-o" />
      <arg value="deploysolution" />
      <arg value="-name" />
      <arg value="${package.file}" />
      <arg value="-immediate" />
      <arg value="-allowgacdeployment" />
      <arg value="-allcontenturls" />
      <arg value="-force" />
    </exec>
    <call target="spwait" />
    <call target="app.pool.reset" />

  </target>

这篇关于在构建机器上构建 WSP 文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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