Building a WSP File on the Build Machine

半世苍凉 提交于 2019-12-04 14:24:09

问题


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.

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?

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?).


回答1:


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.

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.

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>


来源:https://stackoverflow.com/questions/1274962/building-a-wsp-file-on-the-build-machine

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!